public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CizimEkrani, container, false); fingerPaintCanvasView = view.FindViewById <FingerPaintCanvasView>(Resource.Id.fingerPaintCanvasView1); fingerPaintCanvasView.SetBackgroundColor(Color.Transparent); KapatButton = view.FindViewById <ImageButton>(Resource.Id.ımageButton10); TemizleButton = view.FindViewById <ImageButton>(Resource.Id.ımageButton9); TemizleButton.Click += TemizleButton_Click; KapatButton.Click += KapatButtonEvent; fingerPaintCanvasView.StrokeWidth = 10; fingerPaintCanvasView.StrokeColor = Color.ParseColor("#11122E"); KalinlikButtonList = new List <ImageButton>() { view.FindViewById <ImageButton>(Resource.Id.ımageButton1), view.FindViewById <ImageButton>(Resource.Id.ımageButton2), view.FindViewById <ImageButton>(Resource.Id.ımageButton3), view.FindViewById <ImageButton>(Resource.Id.ımageButton4), view.FindViewById <ImageButton>(Resource.Id.ımageButton5), }; RenkButtonList = new List <ImageButton>() { view.FindViewById <ImageButton>(Resource.Id.ımageButton6), view.FindViewById <ImageButton>(Resource.Id.ımageButton7), view.FindViewById <ImageButton>(Resource.Id.ımageButton8), }; for (int i = 0; i < KalinlikButtonList.Count; i++) { KalinlikButtonList[i].Tag = i; KalinlikButtonList[i].Click += KalinlikButton_Click; } for (int i = 0; i < RenkButtonList.Count; i++) { RenkButtonList[i].Tag = i; RenkButtonList[i].Click += RenkButtonList_Click; } KalinlikButtonList[2].SetBackgroundColor(Color.ParseColor("#d3d3d3")); return(view); }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get a reference to the FingerPaintCanvasView from the Main.axml file fingerPaintCanvasView = FindViewById <FingerPaintCanvasView>(Resource.Id.canvasView); // Set up the Spinner to select stroke color Spinner colorSpinner = FindViewById <Spinner>(Resource.Id.colorSpinner); colorSpinner.ItemSelected += OnColorSpinnerItemSelected; var adapter = ArrayAdapter.CreateFromResource(this, Resource.Array.colors_array, Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); colorSpinner.Adapter = adapter; // Set up the Clear button Button btnClear = FindViewById <Button>(Resource.Id.btnClear); btnClear.Click += BtnClear_Click; //Open camera and click picture and save background Button btnCamera = FindViewById <Button>(Resource.Id.btnCamera); btnCamera.Click += BtnCamera_Click; //Save Image To Local Button btnSave = FindViewById <Button>(Resource.Id.btnSave); btnSave.Click += BtnSave_Click; // Go To Next Activity Button btnNext = FindViewById <Button>(Resource.Id.btnNext); btnNext.Click += BtnNext_Click; txtNote = FindViewById <EditText>(Resource.Id.txtNote); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Long).Show(); } }