package jp.ac.titech.sharp4k.cuten.app;
+import jp.ac.titech.sharp4k.cuten.BaseApp;
+import jp.ac.titech.sharp4k.cuten.R;
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Paint;
import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
+import android.widget.ImageView;
import android.widget.LinearLayout;
-import jp.ac.titech.sharp4k.cuten.BaseApp;
+import android.widget.Toast;
-public class CircuitTask extends BaseApp {
+public class CircuitTask extends BaseApp implements OnClickListener{
+ static final int FP = ViewGroup.LayoutParams.FILL_PARENT;
+ static final int WC = ViewGroup.LayoutParams.WRAP_CONTENT;
+
private static final String TAG = CircuitTask.class.getSimpleName();
private Context cxt;
private Resources res;
+ private Button submitBtn;
+ private Button[] selectBtnAllay;
+
@Override
- protected View createView(Context cxt, Resources res) {
+ protected View createView(final Context cxt, Resources res) {
// TODO 自動生成されたメソッド・スタブ
this.cxt = cxt;
this.res = res;
LinearLayout layout = new LinearLayout(cxt);
- Button button = new Button(cxt);
+ layout.setLayoutParams(new LayoutParams(FP, WC));
+ layout.setOrientation(LinearLayout.VERTICAL);
+
+ ImageView imageView = new ImageView(cxt);
+ imageView.setImageResource(R.drawable.question);
+
+ LinearLayout selectBtnLayout = new LinearLayout(cxt);
+ selectBtnLayout.setOrientation(LinearLayout.HORIZONTAL);
+ selectBtnLayout.setLayoutParams(new LayoutParams(FP, FP));
+ selectBtnAllay = new Button[3];
+
+ for(Button btn : selectBtnAllay){
+ btn = new Button(cxt);
+ btn.setOnClickListener(this);
+ btn.setWidth(FP);
+ btn.setHeight(WC);
+ selectBtnLayout.addView(btn);
+ }
+
+ submitBtn = new Button(cxt);
+ submitBtn.setText("Submit");
+ submitBtn.setOnClickListener(this);
- layout.addView(button);
+ layout.addView(imageView);
+ layout.addView(selectBtnLayout);
+ layout.addView(submitBtn);
return layout;
}
protected void onClose() {
super.onClose();
}
+
+ @Override
+ public void onClick(View v) {
+ // TODO 自動生成されたメソッド・スタブ
+ if(v.equals(submitBtn)){
+ Toast.makeText(cxt, "SUBMIT", Toast.LENGTH_LONG).show();
+ }else{
+ Toast.makeText(cxt, "なんか押した?", Toast.LENGTH_LONG).show();
+ }
+ }
+
}