protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.FiveWandH); SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar)); // ensure that the system bar color gets drawn Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); // set the title of both the activity and the action bar Title = SupportActionBar.Title = "5W+1H"; ewoObj = JsonConvert.DeserializeObject <EWO>(Intent.GetStringExtra("ewoObject")); WhoEditText = FindViewById <EditText>(Resource.Id.WhoEditText); WhenEditText = FindViewById <EditText>(Resource.Id.WhenEditText); WhatEditText = FindViewById <EditText>(Resource.Id.WhatEditText); WhereEditText = FindViewById <EditText>(Resource.Id.WhereEditText); WhichEditText = FindViewById <EditText>(Resource.Id.WhichEditText); HowEditText = FindViewById <EditText>(Resource.Id.HowEditText); editing = Intent.GetBooleanExtra("edit", false); if (!String.IsNullOrWhiteSpace(ewoObj.What)) { WhatEditText.Text = ewoObj.What; } if (!String.IsNullOrWhiteSpace(ewoObj.Who)) { WhoEditText.Text = ewoObj.Who; } if (!String.IsNullOrWhiteSpace(ewoObj.Which)) { WhichEditText.Text = ewoObj.Which; } if (!String.IsNullOrWhiteSpace(ewoObj.When)) { WhenEditText.Text = ewoObj.When; } if (!String.IsNullOrWhiteSpace(ewoObj.Where)) { WhereEditText.Text = ewoObj.Where; } if (!String.IsNullOrWhiteSpace(ewoObj.How)) { HowEditText.Text = ewoObj.How; } Button nextButton = FindViewById <Button>(Resource.Id.Next5WHDescription); Button skipButton = FindViewById <Button>(Resource.Id.Skip5WHDescription); Button backButton = FindViewById <Button>(Resource.Id.Back5WHDescription); backButton.Click += BackButton_Click; nextButton.Click += NextButton_Click; skipButton.Click += SkipButton_Click; if (editing) { skipButton.Visibility = ViewStates.Invisible; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.RootCauseLayout); SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar)); // ensure that the system bar color gets drawn Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); // set the title of both the activity and the action bar Title = SupportActionBar.Title = "Type of Root Cause"; r1 = FindViewById <RadioButton>(Resource.Id.radioButtonr1); r2 = FindViewById <RadioButton>(Resource.Id.radioButtonr2); r3 = FindViewById <RadioButton>(Resource.Id.radioButtonr3); r4 = FindViewById <RadioButton>(Resource.Id.radioButtonr4); r5 = FindViewById <RadioButton>(Resource.Id.radioButtonr5); r6 = FindViewById <RadioButton>(Resource.Id.radioButtonr6); ewoObj = JsonConvert.DeserializeObject <EWO>(Intent.GetStringExtra("ewoObject")); editing = Intent.GetBooleanExtra("edit", false); if (string.IsNullOrWhiteSpace(ewoObj.RootCause)) { SetRootCauseUi(r1.Text); } else { SetRootCauseUi(ewoObj.RootCause); } Button nextButton = FindViewById <Button>(Resource.Id.NextButtonRootCause); Button skipButton = FindViewById <Button>(Resource.Id.SkipButtonRootCause); Button backButton = FindViewById <Button>(Resource.Id.BackButtonRootCause); skipButton.Click += SkipButton_Click; backButton.Click += BackButton_Click; nextButton.Click += NextButton_Click; if (editing) { skipButton.Visibility = ViewStates.Invisible; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.EwoInfo); SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar)); // ensure that the system bar color gets drawn Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); // set the title of both the activity and the action bar Title = SupportActionBar.Title = "EW Details"; infoRadioButtonA = FindViewById <RadioButton>(Resource.Id.radioButtonA); infoRadioButtonB = FindViewById <RadioButton>(Resource.Id.radioButtonB); infoRadioButtonC = FindViewById <RadioButton>(Resource.Id.radioButtonC); infoRadioButton1 = FindViewById <RadioButton>(Resource.Id.radioButtonl1); infoRadioButton2 = FindViewById <RadioButton>(Resource.Id.radioButtonl2); infoRadioButton3 = FindViewById <RadioButton>(Resource.Id.radioButtonl3); infoRadioButton4 = FindViewById <RadioButton>(Resource.Id.radioButtonl4); infoRadioButton5 = FindViewById <RadioButton>(Resource.Id.radioButtonl5); infoRadioButton6 = FindViewById <RadioButton>(Resource.Id.radioButtonl6); infoRadioButtonm1 = FindViewById <RadioButton>(Resource.Id.radioButtonm1); infoRadioButtonm2 = FindViewById <RadioButton>(Resource.Id.radioButtonm2); infoRadioButtonm3 = FindViewById <RadioButton>(Resource.Id.radioButtonm3); infoRadioButtonm4 = FindViewById <RadioButton>(Resource.Id.radioButtonm4); infoRadioButtonm5 = FindViewById <RadioButton>(Resource.Id.radioButtonm5); infoRadioButtonm6 = FindViewById <RadioButton>(Resource.Id.radioButtonm6); string j = Intent.GetStringExtra("ewoObject"); j.ToString(); ewoObj = JsonConvert.DeserializeObject <EWO>(Intent.GetStringExtra("ewoObject")); editing = Intent.GetBooleanExtra("edit", false); if (string.IsNullOrWhiteSpace(ewoObj.EwoNo)) { ewoObj.EwoNo = generateEwoNum(); } if (string.IsNullOrWhiteSpace(ewoObj.Shift)) { ewoObj.Shift = "A"; } if (string.IsNullOrWhiteSpace(ewoObj.line)) { ewoObj.line = "1"; } if (string.IsNullOrWhiteSpace(ewoObj.Machine)) { ewoObj.Machine = "Mixer"; } SetShiftUi(ewoObj.Shift); SetLineUi(ewoObj.line); SetMachineUi(ewoObj.Machine); var ewoNumEditText = FindViewById <EditText>(Resource.Id.InfoEwoNumberEditText); var ewoDateEdit = FindViewById <DatePicker>(Resource.Id.InfoDateEditText); ewoDateEdit.DateTime = ewoObj.Date; ewoNumEditText.Text = ewoObj.EwoNo; Button nextButton = FindViewById <Button>(Resource.Id.NextButtonInfo); Button skipButton = FindViewById <Button>(Resource.Id.SkipButtonInfo); Button backButton = FindViewById <Button>(Resource.Id.BackButtonInfo); skipButton.Click += SkipButton_Click; nextButton.Click += NextButton_Click; backButton.Click += BackButton_Click; if (editing) { skipButton.Visibility = ViewStates.Invisible; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ewoObj = JsonConvert.DeserializeObject <EWO>(Intent.GetStringExtra("ewoObject")); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Overview); SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar)); TableLayout tl = FindViewById <TableLayout>(Resource.Id.tableLayoutInfo); ButtonRow = FindViewById <TableRow>(Resource.Id.tableRow12); tl.RemoveView(ButtonRow); namedObjects = new Dictionary <string, View>(); namedObjects.Add("EwoNo", FindViewById(Resource.Id.textViewEwo)); namedObjects.Add("Date", FindViewById(Resource.Id.textViewDate)); namedObjects.Add("Line", FindViewById(Resource.Id.textViewLine)); namedObjects.Add("Shift", FindViewById(Resource.Id.textViewShift)); namedObjects.Add("Machine", FindViewById(Resource.Id.textViewMachine)); foreach (var v in namedObjects.Values) { v.Click += EditInfo; } namedObjects.Add("Picture", FindViewById(Resource.Id.ewoPhotoImageView)); namedObjects.Last().Value.Click += PictureEdit; _imageView = FindViewById <ImageViewAsync>(Resource.Id.ewoPhotoImageView); namedObjects.Add("Faliure", FindViewById(Resource.Id.TextViewFailureDecription)); namedObjects.Last().Value.Click += FaliureDescription;; try { _imageView.SetImageResource(Resource.Drawable.img_placeholder); } catch { } if (!string.IsNullOrEmpty(ewoObj.pictureLocalPath)) { Intent mediaScanIntent = new Intent(Intent.ActionMediaScannerScanFile); // Display in ImageView. We will resize the bitmap to fit the display // Loading the full sized image will consume to much memory // and cause the application to crash. int height = 800; int width = 600; App.bitmap = ewoObj.pictureLocalPath.LoadAndResizeBitmap(width, height); if (App.bitmap != null) { _imageView.SetImageBitmap(App.bitmap); App.bitmap = null; } GC.Collect(); } else if (!string.IsNullOrEmpty(ewoObj.pictureSmallUrl)) { SetImage(); } tl.AddView(textRow("What")); namedObjects.Last().Value.Click += WandHedit; tl.AddView(textRow("When")); namedObjects.Last().Value.Click += WandHedit; tl.AddView(textRow("Where")); namedObjects.Last().Value.Click += WandHedit; tl.AddView(textRow("Who")); namedObjects.Last().Value.Click += WandHedit; tl.AddView(textRow("Which")); namedObjects.Last().Value.Click += WandHedit; tl.AddView(textRow("How")); namedObjects.Last().Value.Click += WandHedit; tl.AddView(textRow("RootCause")); namedObjects.Last().Value.Click += RootCauseEdit;; tl.AddView(ButtonRow); if (string.IsNullOrWhiteSpace(ewoObj.EwoNo)) { ewoObj.EwoNo = generateEwoNum(); } if (string.IsNullOrWhiteSpace(ewoObj.Shift)) { ewoObj.Shift = "A"; } if (string.IsNullOrWhiteSpace(ewoObj.line)) { ewoObj.line = "1"; } if (string.IsNullOrWhiteSpace(ewoObj.Machine)) { ewoObj.Machine = "Mixer"; } if (string.IsNullOrWhiteSpace(ewoObj.faliureDescription)) { ewoObj.faliureDescription = ""; } if (string.IsNullOrWhiteSpace(ewoObj.RootCause)) { ewoObj.RootCause = ""; } if (String.IsNullOrWhiteSpace(ewoObj.What)) { ewoObj.What = ""; } if (String.IsNullOrWhiteSpace(ewoObj.Who)) { ewoObj.Who = ""; } if (String.IsNullOrWhiteSpace(ewoObj.Which)) { ewoObj.Which = ""; } if (String.IsNullOrWhiteSpace(ewoObj.When)) { ewoObj.When = ""; } if (String.IsNullOrWhiteSpace(ewoObj.Where)) { ewoObj.Where = ""; } if (String.IsNullOrWhiteSpace(ewoObj.How)) { ewoObj.How = ""; } submitButton = FindViewById <Button>(Resource.Id.SubmitButtonOverView); saveButton = FindViewById <Button>(Resource.Id.SaveButtonOverView); backButton = FindViewById <Button>(Resource.Id.BackButtonOverView); backButton.Click += BackButton_Click; submitButton.Click += SubmitButton_Click; saveButton.Click += SaveButton_Click; saveButton.Text = "Save"; // ensure that the system bar color gets drawn Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); // set the title of both the activity and the action bar Title = SupportActionBar.Title = "Overview"; setupUi(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.PictureSelection); SetSupportActionBar(FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar)); // ensure that the system bar color gets drawn Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); // set the title of both the activity and the action bar Title = SupportActionBar.Title = "Picture Selection"; _imageView = FindViewById <ImageViewAsync>(Resource.Id.imageView1); ewoObj = JsonConvert.DeserializeObject <EWO>(Intent.GetStringExtra("ewoObject")); editing = Intent.GetBooleanExtra("edit", false); if (!string.IsNullOrEmpty(ewoObj.pictureLocalPath)) { //selected = true; //FileSelect = false; // Make it available in the gallery // Display in ImageView. We will resize the bitmap to fit the display // Loading the full sized image will consume to much memory // and cause the application to crash. int height = 800; int width = 600; App.bitmap = ewoObj.pictureLocalPath.LoadAndResizeBitmap(width, height); if (App.bitmap != null) { _imageView.SetImageBitmap(App.bitmap); App.bitmap = null; } GC.Collect(); } else if (!string.IsNullOrEmpty(ewoObj.pictureSmallUrl)) { SetImage(); } Button openGalleryButton = FindViewById <Button>(Resource.Id.PictureSelectGalleryButton); Button openCameraButton = FindViewById <Button>(Resource.Id.PictureSelectCamearaButton); Button openLedgerButton = FindViewById <Button>(Resource.Id.PictureSelectLegerButton); Button nextButton = FindViewById <Button>(Resource.Id.NextButtonPictureSelect); Button skipButton = FindViewById <Button>(Resource.Id.SkipButtonPictureSelect); Button backButton = FindViewById <Button>(Resource.Id.BackButtonPictureSelect); skipButton.Click += SkipButton_Click; backButton.Click += BackButton_Click; nextButton.Click += NextButton_Click; if (editing) { skipButton.Visibility = ViewStates.Invisible; } if (IsThereAnAppToTakePictures()) { CreateDirectoryForPictures(); openCameraButton.Click += TakeAPicture; openGalleryButton.Click += ButtonOnClick; } }