protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.AddItiLayout); string name = Intent.GetStringExtra("name"); string editThis = ""; editThis = Intent.GetStringExtra("editThis"); EditText editItinerary = FindViewById <EditText>(Resource.Id.txtItinerary); editItinerary.Text = editThis; Button btnAdd = FindViewById <Button>(Resource.Id.btnAdd); btnAdd.Click += ((sender, e) => { EditText txtItinerary = FindViewById <EditText>(Resource.Id.txtItinerary); DBItineraryRepository dbr = new DBItineraryRepository(); string result = dbr.InsertRecord(name, txtItinerary.Text); Toast.MakeText(this, result, ToastLength.Short).Show(); var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", name); SetResult(Result.Ok, intent); Finish(); }); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.itineraryAndTtbLayout); Button btnTTB = FindViewById <Button>(Resource.Id.btnTTB); Button btnITI = FindViewById <Button>(Resource.Id.btnITI); btnTTB.Click += (sender, e) => { DBItineraryRepository dbr = new DBItineraryRepository(); var resultTable = dbr.CreateTableChecklist(); var intent = new Intent(this, typeof(MainT2B)); intent.PutExtra("button", "ttb"); StartActivity(intent); OverridePendingTransition(Resource.Animation.slide_right, Resource.Animation.fade_out); }; btnITI.Click += (sender, e) => { DBItineraryRepository dbr = new DBItineraryRepository(); var result = dbr.CreateTable(); var intent = new Intent(this, typeof(MainT2B)); intent.PutExtra("button", "iti"); StartActivity(intent); OverridePendingTransition(Resource.Animation.slide_right, Resource.Animation.fade_out); }; }
//Our Main Menu Activity protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); RequestWindowFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.mainMenuLayout); DBItineraryRepository dbr = new DBItineraryRepository(); var result = dbr.CreateDB(); Button btnMountainList = FindViewById <Button>(Resource.Id.btnMountainList); Button btnThingsToBring = FindViewById <Button>(Resource.Id.btnThingsToBring); Button btnNoTrace = FindViewById <Button>(Resource.Id.btnLeaveNoTrace); Button btnMountainMap = FindViewById <Button>(Resource.Id.btnMountainMap); Button btnSettings = FindViewById <Button>(Resource.Id.btnSetting); btnMountainList.Click += (sender, e) => { const string message = "Data Fetching, Please wait."; var intent = new Intent(this, typeof(MountainListAct)); Toast.MakeText(this, message, ToastLength.Short).Show(); StartActivity(intent); OverridePendingTransition(Resource.Animation.slide_right, Resource.Animation.fade_out); Finish(); }; btnThingsToBring.Click += (sender, e) => { var resultTable = dbr.CreateTableChecklist(); var resultTableIti = dbr.CreateTable(); var intent = new Intent(this, typeof(ItiAndTtbActivity)); StartActivity(intent); OverridePendingTransition(Resource.Animation.slide_right, Resource.Animation.fade_out); }; btnNoTrace.Click += (sender, e) => { var intent = new Intent(this, typeof(EssentialsAct)); StartActivity(intent); OverridePendingTransition(Resource.Animation.slide_right, Resource.Animation.fade_out); }; btnMountainMap.Click += (sender, e) => { var intent = new Intent(this, typeof(MountainMapAct)); StartActivity(intent); OverridePendingTransition(Resource.Animation.fade_in, Resource.Animation.fade_out); Finish(); }; btnSettings.Click += (sender, e) => { var resultTable = dbr.CreateTableSettings(); var intent = new Intent(this, typeof(SettingsAct)); StartActivity(intent); OverridePendingTransition(Resource.Animation.fade_in, Resource.Animation.fade_out); }; }
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { var i = new Intent(); string name = Intent.GetStringExtra("name"); //when regester activity retrun data, it will be execute if (requestCode == 1 && resultCode == Result.Ok) { TextView tv = FindViewById <TextView>(Resource.Id.txtLists); DBItineraryRepository dbr = new DBItineraryRepository(); string outputValue = ""; string othersValue = ""; // TextView txtList = FindViewById<TextView>(Resource.Id.txtList); try { string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormItinerary.db3"); var db = new SQLiteConnection(dbPath); var items = db.Get <ChecklistClass>(name); if (items.backpackValue == "1") { outputValue += "Backpack" + "\n"; } if (items.bootsValue == "1") { outputValue += "Boots" + "\n"; } if (items.plasticbagValue == "1") { outputValue += "Plastic Bag and Trashbag" + "\n"; } if (items.toiletriesValue == "1") { outputValue += "Toiletries" + "\n"; } if (items.outdoorclothesValue == "1") { outputValue += "Outdoor clothes" + "\n"; } if (items.trailfoodValue == "1") { outputValue += "Trail food" + "\n"; } if (items.packedlunchValue == "1") { outputValue += "Packed lunch" + "\n"; } if (items.trailwaterValue == "1") { outputValue += "Trail water and sports drink" + "\n"; } if (items.firstaidkitValue == "1") { outputValue += "First aid kit" + "\n"; } if (items.survivalkitValue == "1") { outputValue += "Survival kit" + "\n"; } if (items.messkitValue == "1") { outputValue += "Mess kit" + "\n"; } if (items.drinkingcupValue == "1") { outputValue += "Drinking cup" + "\n"; } if (items.spoonforkValue == "1") { outputValue += "Spoon and fork" + "\n"; } if (items.identificationValue == "1") { outputValue += "Dog tag / Identification" + "\n"; } if (items.whistleValue == "1") { outputValue += "Whistle" + "\n"; } if (items.raingearValue == "1") { outputValue += "Rain gear" + "\n"; } if (items.jacketValue == "1") { outputValue += "Windbreaker / Jacket" + "\n"; } if (items.sunprotectionValue == "1") { outputValue += "Sun protection" + "\n"; } if (items.flashlightValue == "1") { outputValue += "Headlamp / Flashlight" + "\n"; } if (items.multitoolValue == "1") { outputValue += "Folding knife / Multitool" + "\n"; } if (items.mobilephoneValue == "1") { outputValue += "Mobile phone" + "\n"; } if (items.camerabatteriesValue == "1") { outputValue += "Camera and Batteries" + "\n"; } if (items.trekkingpoleValue == "1") { outputValue += "Trekking pole" + "\n"; } if (items.blanketValue == "1") { outputValue += "Sleeping bag / Blanket" + "\n"; } if (items.extraclothesValue == "1") { outputValue += "Extra clothes" + "\n"; } if (items.sandalsValue == "1") { outputValue += "Sandals / Slippers" + "\n"; } if (items.campwaterValue == "1") { outputValue += "Camp water / Container" + "\n"; } if (items.precookfoodValue == "1") { outputValue += "Pre-cooked food" + "\n"; } if (items.riceValue == "1") { outputValue += "Rice and eggs" + "\n"; } if (items.tyingstringValue == "1") { outputValue += "Tying strings" + "\n"; } if (items.stovefuelValue == "1") { outputValue += "Stove fuel" + "\n"; } if (items.lighterValue == "1") { outputValue += "Lighter" + "\n"; } if (items.matchesValue == "1") { outputValue += "Matches" + "\n"; } if (items.boloValue == "1") { outputValue += "Bolo" + "\n"; } if (items.mapcompassValue == "1") { outputValue += "Map and Compass" + "\n"; } if (items.stoveValue == "1") { outputValue += "Stove" + "\n"; } if (items.cooksetValue == "1") { outputValue += "Cook set" + "\n"; } if (items.flagValue == "1") { outputValue += "Club flag" + "\n"; } if (items.tentValue == "1") { outputValue += "Tent" + "\n"; } if (items.groundsheetValue == "1") { outputValue += "Groundsheet" + "\n"; } if (items.ropeValue == "1") { outputValue += "Rope" + "\n"; } if (items.trowelValue == "1") { outputValue += "Towel" + "\n"; } othersValue = items.othersValue; } catch { } tv.Text = outputValue; TextView others = FindViewById <TextView>(Resource.Id.txtOthers); others.Text = othersValue; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.listsLayout); // Create your application here string name = Intent.GetStringExtra("name"); TextView tv = FindViewById <TextView>(Resource.Id.txtLists); DBItineraryRepository dbr = new DBItineraryRepository(); string outputValue = ""; string othersValue = ""; try { string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormItinerary.db3"); var db = new SQLiteConnection(dbPath); var items = db.Get <ChecklistClass>(name); if (items.backpackValue == "1") { outputValue += "Backpack" + "\n"; } if (items.bootsValue == "1") { outputValue += "Boots" + "\n"; } if (items.plasticbagValue == "1") { outputValue += "Plastic Bag and Trashbag" + "\n"; } if (items.toiletriesValue == "1") { outputValue += "Toiletries" + "\n"; } if (items.outdoorclothesValue == "1") { outputValue += "Outdoor clothes" + "\n"; } if (items.trailfoodValue == "1") { outputValue += "Trail food" + "\n"; } if (items.packedlunchValue == "1") { outputValue += "Packed lunch" + "\n"; } if (items.trailwaterValue == "1") { outputValue += "Trail water and sports drink" + "\n"; } if (items.firstaidkitValue == "1") { outputValue += "First aid kit" + "\n"; } if (items.survivalkitValue == "1") { outputValue += "Survival kit" + "\n"; } if (items.messkitValue == "1") { outputValue += "Mess kit" + "\n"; } if (items.drinkingcupValue == "1") { outputValue += "Drinking cup" + "\n"; } if (items.spoonforkValue == "1") { outputValue += "Spoon and fork" + "\n"; } if (items.identificationValue == "1") { outputValue += "Dog tag / Identification" + "\n"; } if (items.whistleValue == "1") { outputValue += "Whistle" + "\n"; } if (items.raingearValue == "1") { outputValue += "Rain gear" + "\n"; } if (items.jacketValue == "1") { outputValue += "Windbreaker / Jacket" + "\n"; } if (items.sunprotectionValue == "1") { outputValue += "Sun protection" + "\n"; } if (items.flashlightValue == "1") { outputValue += "Headlamp / Flashlight" + "\n"; } if (items.multitoolValue == "1") { outputValue += "Folding knife / Multitool" + "\n"; } if (items.mobilephoneValue == "1") { outputValue += "Mobile phone" + "\n"; } if (items.camerabatteriesValue == "1") { outputValue += "Camera and Batteries" + "\n"; } if (items.trekkingpoleValue == "1") { outputValue += "Trekking pole" + "\n"; } if (items.blanketValue == "1") { outputValue += "Sleeping bag / Blanket" + "\n"; } if (items.extraclothesValue == "1") { outputValue += "Extra clothes" + "\n"; } if (items.sandalsValue == "1") { outputValue += "Sandals / Slippers" + "\n"; } if (items.campwaterValue == "1") { outputValue += "Camp water / Container" + "\n"; } if (items.precookfoodValue == "1") { outputValue += "Pre-cooked food" + "\n"; } if (items.riceValue == "1") { outputValue += "Rice and eggs" + "\n"; } if (items.tyingstringValue == "1") { outputValue += "Tying strings" + "\n"; } if (items.stovefuelValue == "1") { outputValue += "Stove fuel" + "\n"; } if (items.lighterValue == "1") { outputValue += "Lighter" + "\n"; } if (items.matchesValue == "1") { outputValue += "Matches" + "\n"; } if (items.boloValue == "1") { outputValue += "Bolo" + "\n"; } if (items.mapcompassValue == "1") { outputValue += "Map and Compass" + "\n"; } if (items.stoveValue == "1") { outputValue += "Stove" + "\n"; } if (items.cooksetValue == "1") { outputValue += "Cook set" + "\n"; } if (items.flagValue == "1") { outputValue += "Club flag" + "\n"; } if (items.tentValue == "1") { outputValue += "Tent" + "\n"; } if (items.groundsheetValue == "1") { outputValue += "Groundsheet" + "\n"; } if (items.ropeValue == "1") { outputValue += "Rope" + "\n"; } if (items.trowelValue == "1") { outputValue += "Towel" + "\n"; } othersValue = items.othersValue; } catch { } tv.Text = outputValue; TextView others = FindViewById <TextView>(Resource.Id.txtOthers); others.Text = othersValue; ImageButton add = FindViewById <ImageButton>(Resource.Id.imageButtonAdd); add.Click += (sender, e) => { var intent = new Intent(this, typeof(ThingsToBringAct)); intent.PutExtra("name", name); StartActivityForResult(intent, 1); OverridePendingTransition(Resource.Animation.slide_right, Resource.Animation.fade_out); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.detailLayout); FindViews(); Fonts(); Android.Content.Intent i = this.Intent; string iname = i.Extras.GetString("MTNAME"); string iimg0 = i.Extras.GetString("IMG0"); string iimg1 = i.Extras.GetString("IMG1"); string iimg2 = i.Extras.GetString("IMG2"); string iimg3 = i.Extras.GetString("IMG3"); string iimg4 = i.Extras.GetString("IMG4"); string iimg5 = i.Extras.GetString("IMG5"); string ilocation = i.Extras.GetString("LOCATION"); string ijumpoff = i.Extras.GetString("JUMPOFF"); string idescription = i.Extras.GetString("DESCRIPTION"); string ibackground = i.Extras.GetString("BACKGROUND"); string iitinerary = i.Extras.GetString("ITINERARY"); string ipracticalities = i.Extras.GetString("PRACTICALITIES"); string iattire = i.Extras.GetString("ATTIRE"); string ittb = i.Extras.GetString("TTB"); string inote = i.Extras.GetString("NOTE"); string iimgdesc00 = i.Extras.GetString("IMGD0"); string iimgdesc01 = i.Extras.GetString("IMGD1"); string iimgdesc02 = i.Extras.GetString("IMGD2"); string iimgdesc03 = i.Extras.GetString("IMGD3"); string iimgdesc04 = i.Extras.GetString("IMGD4"); string iimgdesc05 = i.Extras.GetString("IMGD5"); string ividdesc = i.Extras.GetString("VIDD"); var imageBitmap0 = ("https://ia801506.us.archive.org/35/items/mj_anda_yahoo_Pics/" + iimg0 + ".jpg"); var imageBitmap1 = ("https://ia801506.us.archive.org/35/items/mj_anda_yahoo_Pics/" + iimg1 + ".jpg"); var imageBitmap2 = ("https://ia801506.us.archive.org/35/items/mj_anda_yahoo_Pics/" + iimg2 + ".jpg"); var imageBitmap3 = ("https://ia801506.us.archive.org/35/items/mj_anda_yahoo_Pics/" + iimg3 + ".jpg"); var imageBitmap4 = ("https://ia801506.us.archive.org/35/items/mj_anda_yahoo_Pics/" + iimg4 + ".jpg"); var imageBitmap5 = "https://ia801506.us.archive.org/35/items/mj_anda_yahoo_Pics/" + iimg5 + ".jpg"; Picasso.With(this).Load(imageBitmap0).Into(mtimg0); Picasso.With(mContext).Load(imageBitmap1).Into(mtimg1); Picasso.With(mContext).Load(imageBitmap2).Into(mtimg2); Picasso.With(mContext).Load(imageBitmap3).Into(mtimg3); Picasso.With(mContext).Load(imageBitmap4).Into(mtimg4); Picasso.With(mContext).Load(imageBitmap5).Into(mtimg5); tmtname.Text = iname; tmtloc.Text = ilocation; tjumpoff.Text = ijumpoff; tdesc.Text = idescription; tbackground.Text = ibackground; titinerary.Text = iitinerary; tpracticalities.Text = ipracticalities; tattire.Text = iattire; tttb.Text = ittb; tnote.Text = inote; timgdesc00.Text = iimgdesc00; timgdesc01.Text = iimgdesc01; timgdesc02.Text = iimgdesc02; timgdesc03.Text = iimgdesc03; timgdesc04.Text = iimgdesc04; timgdesc05.Text = iimgdesc05; tviddesc.Text = ividdesc; Button btnItinerary = FindViewById <Button>(Resource.Id.btnItinerary); btnItinerary.Click += ((sender, e) => { DBItineraryRepository dbr = new DBItineraryRepository(); var result = dbr.CreateTable(); var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", iname); StartActivity(intent); FadeInAnim(); }); mtimg0.Click += Mtimg0_Click; mtimg1.Click += Mtimg1_Click; mtimg2.Click += Mtimg2_Click; mtimg3.Click += Mtimg3_Click; mtimg4.Click += Mtimg4_Click; mtimg5.Click += Mtimg5_Click; videoimg.Click += Videoimg_Click; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.MainT2BLayout); // Create your application here LinearLayout layoutLists = FindViewById <LinearLayout>(Resource.Id.layoutList); DBItineraryRepository dbr = new DBItineraryRepository(); TextView Apo = FindViewById <TextView>(Resource.Id.Apo); string button = Intent.GetStringExtra("button"); Apo.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "APO"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "APO"); StartActivity(intent); } SlideRightAnim(); }; TextView AltoPeak = FindViewById <TextView>(Resource.Id.AltoPeak); AltoPeak.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "ALTO PEAK"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "ALTO PEAK"); StartActivity(intent); } SlideRightAnim(); }; TextView Arayat = FindViewById <TextView>(Resource.Id.Arayat); Arayat.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "ARAYAT"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "ARAYAT"); StartActivity(intent); } SlideRightAnim(); }; TextView Banoi = FindViewById <TextView>(Resource.Id.Banoi); Banoi.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "BANOI"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "BANOI"); StartActivity(intent); } SlideRightAnim(); }; TextView Batolusong = FindViewById <TextView>(Resource.Id.Batolusong); Batolusong.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "BATOLUSONG"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "BATOLUSONG"); StartActivity(intent); } SlideRightAnim(); }; TextView Batulao = FindViewById <TextView>(Resource.Id.Batulao); Batulao.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "BATULAO"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "BATULAO"); StartActivity(intent); } SlideRightAnim(); }; TextView Binacayan = FindViewById <TextView>(Resource.Id.Binacayan); Binacayan.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "BINACAYAN"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "BINACAYAN"); StartActivity(intent); } SlideRightAnim(); }; TextView Candalaga = FindViewById <TextView>(Resource.Id.Candalaga); Candalaga.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "CANDALAGA"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "CANDALAGA"); StartActivity(intent); } SlideRightAnim(); }; TextView Cristobal = FindViewById <TextView>(Resource.Id.Cristobal); Cristobal.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "CRISTOBAL"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "CRISTOBAL"); StartActivity(intent); } SlideRightAnim(); }; TextView DulangDulang = FindViewById <TextView>(Resource.Id.DulangDulang); DulangDulang.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "DULANG-DULANG"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "DULANG-DULANG"); StartActivity(intent); } SlideRightAnim(); }; TextView GuitingGuiting = FindViewById <TextView>(Resource.Id.GuitingGuiting); GuitingGuiting.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "GUITING-GUITING"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "GUITING-GUITING"); StartActivity(intent); } SlideRightAnim(); }; TextView Halcon = FindViewById <TextView>(Resource.Id.Halcon); Halcon.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "HALCON"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "HALCON"); StartActivity(intent); } SlideRightAnim(); }; TextView Hamiguitan = FindViewById <TextView>(Resource.Id.Hamiguitan); Hamiguitan.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "HAMIGUITAN"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "HAMIGUITAN"); StartActivity(intent); } SlideRightAnim(); }; TextView HibokHibok = FindViewById <TextView>(Resource.Id.HibokHibok); HibokHibok.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "HIBOKHIBOK"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "HIBOKHIBOK"); StartActivity(intent); } SlideRightAnim(); }; TextView Kalatungan = FindViewById <TextView>(Resource.Id.Kalatungan); Kalatungan.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "KALATUNGAN"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "KALATUNGAN"); StartActivity(intent); } SlideRightAnim(); }; TextView Kanlaon = FindViewById <TextView>(Resource.Id.Kanlaon); Kanlaon.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "KANLAON"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "KANLAON"); StartActivity(intent); } SlideRightAnim(); }; TextView Kitanglad = FindViewById <TextView>(Resource.Id.Kitanglad); Kitanglad.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "KITANGLAD"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "KITANGLAD"); StartActivity(intent); } SlideRightAnim(); }; TextView Lubog = FindViewById <TextView>(Resource.Id.Lubog); Lubog.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "LUBOG"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "LUBOG"); StartActivity(intent); } SlideRightAnim(); }; TextView Maculot = FindViewById <TextView>(Resource.Id.Maculot); Maculot.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MACULOT"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MACULOT"); StartActivity(intent); } SlideRightAnim(); }; TextView Madjaas = FindViewById <TextView>(Resource.Id.Madjaas); Madjaas.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MADJAAS"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MADJAAS"); StartActivity(intent); } SlideRightAnim(); }; TextView Makiling = FindViewById <TextView>(Resource.Id.Makiling); Makiling.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MAKILING"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MAKILING"); StartActivity(intent); } SlideRightAnim(); }; TextView ManabuPeak = FindViewById <TextView>(Resource.Id.ManabuPeak); ManabuPeak.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MANABU PEAK"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MANABU PEAK"); StartActivity(intent); } SlideRightAnim(); }; TextView Mantalingajan = FindViewById <TextView>(Resource.Id.Matalingajan); Mantalingajan.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MATALINGAJAN"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MATALINGAJAN"); StartActivity(intent); } SlideRightAnim(); }; TextView Marami = FindViewById <TextView>(Resource.Id.Marami); Marami.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MARAMI"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MARAMI"); StartActivity(intent); } SlideRightAnim(); }; TextView Matutum = FindViewById <TextView>(Resource.Id.Matutum); Matutum.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "MATUTUM"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "MATUTUM"); StartActivity(intent); } SlideRightAnim(); }; TextView Napulak = FindViewById <TextView>(Resource.Id.Napulak); Napulak.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "NAPULAK"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "NAPULAK"); StartActivity(intent); } SlideRightAnim(); }; TextView OsmenaPeak = FindViewById <TextView>(Resource.Id.OsmenaPeak); OsmenaPeak.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "OSMEÑA PEAK"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "OSMEÑA PEAK"); StartActivity(intent); } SlideRightAnim(); }; TextView Pamitinan = FindViewById <TextView>(Resource.Id.Pamitinan); Pamitinan.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "PAMITINAN"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "PAMITINAN"); StartActivity(intent); } SlideRightAnim(); }; TextView PicoDeLoro = FindViewById <TextView>(Resource.Id.PicoDeLoro); PicoDeLoro.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "PICO DE LORO"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "PICO DE LORO"); StartActivity(intent); } SlideRightAnim(); }; TextView Pulag = FindViewById <TextView>(Resource.Id.Pulag); Pulag.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "PULAG"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "PULAG"); StartActivity(intent); } SlideRightAnim(); }; TextView Romelo = FindViewById <TextView>(Resource.Id.Romelo); Romelo.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "ROMELO"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "ROMELO"); StartActivity(intent); } SlideRightAnim(); }; TextView Taal = FindViewById <TextView>(Resource.Id.Taal); Taal.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "TAAL VOLCANO"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "TAAL VOLCANO"); StartActivity(intent); } SlideRightAnim(); }; TextView Talamitam = FindViewById <TextView>(Resource.Id.Talamitam); Talamitam.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "TALAMITAM"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "TALAMITAM"); StartActivity(intent); } SlideRightAnim(); }; TextView Talomo = FindViewById <TextView>(Resource.Id.Talomo); Talomo.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "TALOMO"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "TALOMO"); StartActivity(intent); } SlideRightAnim(); }; TextView TarakRidge = FindViewById <TextView>(Resource.Id.TarakRidge); TarakRidge.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "TARAK RIDGE"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "TARAK RIDGE"); StartActivity(intent); } SlideRightAnim(); }; TextView TayakHill = FindViewById <TextView>(Resource.Id.TayakHill); TayakHill.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "TAYAK HILL"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "TAYAK HILL"); StartActivity(intent); } SlideRightAnim(); }; TextView TresMarias = FindViewById <TextView>(Resource.Id.TresMarias); TresMarias.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "TRES MARIAS"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "TRES MARIAS"); StartActivity(intent); } SlideRightAnim(); }; TextView Ulap = FindViewById <TextView>(Resource.Id.Ulap); Ulap.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "ULAP"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "ULAP"); StartActivity(intent); } SlideRightAnim(); }; TextView Victoria = FindViewById <TextView>(Resource.Id.Victoria); Victoria.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "VICTORIA"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "VICTORIA"); StartActivity(intent); } SlideRightAnim(); }; TextView WhitePeak = FindViewById <TextView>(Resource.Id.WhitePeak); WhitePeak.Click += (sender, e) => { if (button == "ttb") { var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", "WHITE PEAK"); StartActivity(intent); } else if (button == "iti") { var intent = new Intent(this, typeof(itineraryAct)); intent.PutExtra("name", "WHITE PEAK"); StartActivity(intent); } SlideRightAnim(); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.mountainMap); //settings database getting records InitializeLocationManager(); DBItineraryRepository dbr = new DBItineraryRepository(); var terrain = "terrain"; var terrainValue = "1"; var normal = "normal"; var normalValue = "0"; var satellite = "satellite"; var satelliteValue = "0"; var hybrid = "toiletries"; var hybridValue = "0"; try { var terrainResult = dbr.GetRecordSettings(terrain); terrainValue = terrainResult; var normalResult = dbr.GetRecordSettings(normal); normalValue = normalResult; var satelliteResult = dbr.GetRecordSettings(satellite); satelliteValue = satelliteResult; var hybridResult = dbr.GetRecordSettings(hybrid); hybridValue = hybridResult; } catch (Exception ex) { } MapFragment mapFrag = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map); GoogleMap map = mapFrag.Map; map.SetOnInfoWindowClickListener(this); // position LatLng locations = new LatLng(13, 122); CameraPosition.Builder builder = CameraPosition.InvokeBuilder(); builder.Target(locations); builder.Zoom(6); CameraPosition cameraPosition = builder.Build(); CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition); if (map != null) { map.Clear(); map.MapType = GoogleMap.MapTypeTerrain; if (terrainValue == "1") { map.MapType = GoogleMap.MapTypeTerrain; } else if (normalValue == "1") { map.MapType = GoogleMap.MapTypeNormal; } else if (satelliteValue == "1") { map.MapType = GoogleMap.MapTypeSatellite; } else if (hybridValue == "1") { map.MapType = GoogleMap.MapTypeHybrid; } map.UiSettings.ZoomControlsEnabled = true; map.UiSettings.CompassEnabled = true; map.MoveCamera(cameraUpdate); mountainsRepository = new MountainsService(); mMountains = mountainsRepository.GetAllMountains(); foreach (Mountain item in mMountains) { marker = map.AddMarker(new MarkerOptions() .SetPosition(new LatLng(item.Lat, item.Lng)) .SetTitle(item.MtName) .SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueYellow))); } } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.thingsToBringLayout); // Create your application here DBItineraryRepository dbr = new DBItineraryRepository(); string name = Intent.GetStringExtra("name"); // instantiate names and values var backpackValue = "0"; var bootsValue = "0"; var plasticbagValue = "0"; var toiletriesValue = "0"; var outdoorclothesValue = "0"; var trailfoodValue = "0"; var packedlunchValue = "0"; var trailwaterValue = "0"; var firstaidkitValue = "0"; var survivalkitValue = "0"; var messkitValue = "0"; var drinkingcupValue = "0"; var spoonforkValue = "0"; var identificationValue = "0"; var whistleValue = "0"; var raingearValue = "0"; var jacketValue = "0"; var sunprotectionValue = "0"; var flashlightValue = "0"; var multitoolValue = "0"; var mobilephoneValue = "0"; var camerabatteriesValue = "0"; var trekkingpoleValue = "0"; var blanketValue = "0"; var extraclothesValue = "0"; var sandalsValue = "0"; var campwaterValue = "0"; var precookfoodValue = "0"; var riceValue = "0"; var tyingstringValue = "0"; var stovefuelValue = "0"; var lighterValue = "0"; var matchesValue = "0"; var boloValue = "0"; var mapcompassValue = "0"; var stoveValue = "0"; var cooksetValue = "0"; var flagValue = "0"; var tentValue = "0"; var groundsheetValue = "0"; var ropeValue = "0"; var trowelValue = "0"; var othersValue = ""; CheckBox cbbackpacks = FindViewById <CheckBox>(Resource.Id.cbBackpacks); CheckBox cbboots = FindViewById <CheckBox>(Resource.Id.cbBoots); CheckBox cbplasticbags = FindViewById <CheckBox>(Resource.Id.cbPlasticBags); CheckBox cbtoiletries = FindViewById <CheckBox>(Resource.Id.cbToiletries); CheckBox cboutdoorclothes = FindViewById <CheckBox>(Resource.Id.cbOutdoorClothes); CheckBox cbtrailfood = FindViewById <CheckBox>(Resource.Id.cbTrailFood); CheckBox cbpackedlunch = FindViewById <CheckBox>(Resource.Id.cbPackedLunch); CheckBox cbtrailwater = FindViewById <CheckBox>(Resource.Id.cbTrailWater); CheckBox cbfirstaidkit = FindViewById <CheckBox>(Resource.Id.cbFirstAidKit); CheckBox cbsurvivalkit = FindViewById <CheckBox>(Resource.Id.cbSurvivalKit); CheckBox cbmesskit = FindViewById <CheckBox>(Resource.Id.cbMessKit); CheckBox cbdrinkingcup = FindViewById <CheckBox>(Resource.Id.cbDrinkingCup); CheckBox cbspoonfork = FindViewById <CheckBox>(Resource.Id.cbSpoonFork); CheckBox cbidentification = FindViewById <CheckBox>(Resource.Id.cbIdentification); CheckBox cbwhistle = FindViewById <CheckBox>(Resource.Id.cbWhistle); CheckBox cbraingear = FindViewById <CheckBox>(Resource.Id.cbRainGear); CheckBox cbjacket = FindViewById <CheckBox>(Resource.Id.cbJacket); CheckBox cbsunprotection = FindViewById <CheckBox>(Resource.Id.cbSunProtection); CheckBox cbflashlight = FindViewById <CheckBox>(Resource.Id.cbFlashlight); CheckBox cbmultitool = FindViewById <CheckBox>(Resource.Id.cbMultitool); CheckBox cbmobilephone = FindViewById <CheckBox>(Resource.Id.cbMobilePhone); CheckBox cbcamerabatteries = FindViewById <CheckBox>(Resource.Id.cbCameraBatteries); CheckBox cbtrekkingpole = FindViewById <CheckBox>(Resource.Id.cbTrekkingPole); CheckBox cbblanket = FindViewById <CheckBox>(Resource.Id.cbBlanket); CheckBox cbextraclothes = FindViewById <CheckBox>(Resource.Id.cbExtraClothes); CheckBox cbsandals = FindViewById <CheckBox>(Resource.Id.cbSandals); CheckBox cbcampwater = FindViewById <CheckBox>(Resource.Id.cbCampWater); CheckBox cbprecookfood = FindViewById <CheckBox>(Resource.Id.cbPrecookedFood); CheckBox cbrice = FindViewById <CheckBox>(Resource.Id.cbRiceEggs); CheckBox cbtyingstring = FindViewById <CheckBox>(Resource.Id.cbTyingString); CheckBox cbstovefuel = FindViewById <CheckBox>(Resource.Id.cbStoveFuel); CheckBox cblighter = FindViewById <CheckBox>(Resource.Id.cbLighter); CheckBox cbmatches = FindViewById <CheckBox>(Resource.Id.cbMatches); CheckBox cbbolo = FindViewById <CheckBox>(Resource.Id.cbBolo); CheckBox cbmapcompass = FindViewById <CheckBox>(Resource.Id.cbMapCompass); CheckBox cbstove = FindViewById <CheckBox>(Resource.Id.cbStove); CheckBox cbcookset = FindViewById <CheckBox>(Resource.Id.cbCookset); CheckBox cbflag = FindViewById <CheckBox>(Resource.Id.cbFlag); CheckBox cbtent = FindViewById <CheckBox>(Resource.Id.cbTent); CheckBox cbgroundsheet = FindViewById <CheckBox>(Resource.Id.cbGroundsheet); CheckBox cbrope = FindViewById <CheckBox>(Resource.Id.cbRope); CheckBox cbtrowel = FindViewById <CheckBox>(Resource.Id.cbTrowel); EditText txtOthers = FindViewById <EditText>(Resource.Id.txtOthers); //getting the value of the checkbox from database try { string dbPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormItinerary.db3"); var db = new SQLiteConnection(dbPath); string outputValue = ""; var item = db.Get <ChecklistClass>(name); backpackValue = item.backpackValue; bootsValue = item.bootsValue; plasticbagValue = item.plasticbagValue; toiletriesValue = item.toiletriesValue; outdoorclothesValue = item.outdoorclothesValue; trailfoodValue = item.trailfoodValue; packedlunchValue = item.packedlunchValue; trailwaterValue = item.trailwaterValue; firstaidkitValue = item.firstaidkitValue; survivalkitValue = item.survivalkitValue; messkitValue = item.messkitValue; drinkingcupValue = item.drinkingcupValue; spoonforkValue = item.spoonforkValue; identificationValue = item.identificationValue; whistleValue = item.whistleValue; raingearValue = item.raingearValue; jacketValue = item.jacketValue; sunprotectionValue = item.sunprotectionValue; flashlightValue = item.flashlightValue; multitoolValue = item.multitoolValue; mobilephoneValue = item.mobilephoneValue; camerabatteriesValue = item.camerabatteriesValue; trekkingpoleValue = item.trekkingpoleValue; blanketValue = item.blanketValue; extraclothesValue = item.extraclothesValue; sandalsValue = item.sandalsValue; campwaterValue = item.campwaterValue; precookfoodValue = item.precookfoodValue; riceValue = item.riceValue; tyingstringValue = item.tyingstringValue; stovefuelValue = item.stovefuelValue; lighterValue = item.lighterValue; matchesValue = item.matchesValue; boloValue = item.boloValue; mapcompassValue = item.mapcompassValue; stoveValue = item.stoveValue; cooksetValue = item.cooksetValue; flagValue = item.flagValue; tentValue = item.tentValue; groundsheetValue = item.groundsheetValue; ropeValue = item.ropeValue; trowelValue = item.trowelValue; othersValue = item.othersValue; } catch (Exception ex) { } //implementing the value if (backpackValue == "0") { cbbackpacks.Checked = false; } else if (backpackValue == "1") { cbbackpacks.Checked = true; } if (bootsValue == "0") { cbboots.Checked = false; } else if (bootsValue == "1") { cbboots.Checked = true; } if (plasticbagValue == "0") { cbplasticbags.Checked = false; } else if (plasticbagValue == "1") { cbplasticbags.Checked = true; } if (toiletriesValue == "0") { cbtoiletries.Checked = false; } else if (toiletriesValue == "1") { cbtoiletries.Checked = true; } if (outdoorclothesValue == "0") { cboutdoorclothes.Checked = false; } else if (outdoorclothesValue == "1") { cboutdoorclothes.Checked = true; } if (trailfoodValue == "0") { cbtrailfood.Checked = false; } else if (trailfoodValue == "1") { cbtrailfood.Checked = true; } if (packedlunchValue == "0") { cbpackedlunch.Checked = false; } else if (packedlunchValue == "1") { cbpackedlunch.Checked = true; } if (trailwaterValue == "0") { cbtrailwater.Checked = false; } else if (trailwaterValue == "1") { cbtrailwater.Checked = true; } if (firstaidkitValue == "0") { cbfirstaidkit.Checked = false; } else if (firstaidkitValue == "1") { cbfirstaidkit.Checked = true; } if (survivalkitValue == "0") { cbsurvivalkit.Checked = false; } else if (survivalkitValue == "1") { cbsurvivalkit.Checked = true; } if (messkitValue == "0") { cbmesskit.Checked = false; } else if (messkitValue == "1") { cbmesskit.Checked = true; } if (drinkingcupValue == "0") { cbdrinkingcup.Checked = false; } else if (drinkingcupValue == "1") { cbdrinkingcup.Checked = true; } if (spoonforkValue == "0") { cbspoonfork.Checked = false; } else if (spoonforkValue == "1") { cbspoonfork.Checked = true; } if (identificationValue == "0") { cbidentification.Checked = false; } else if (identificationValue == "1") { cbidentification.Checked = true; } if (whistleValue == "0") { cbwhistle.Checked = false; } else if (whistleValue == "1") { cbwhistle.Checked = true; } if (raingearValue == "0") { cbraingear.Checked = false; } else if (raingearValue == "1") { cbraingear.Checked = true; } if (jacketValue == "0") { cbjacket.Checked = false; } else if (jacketValue == "1") { cbjacket.Checked = true; } if (sunprotectionValue == "0") { cbsunprotection.Checked = false; } else if (sunprotectionValue == "1") { cbsunprotection.Checked = true; } if (flashlightValue == "0") { cbflashlight.Checked = false; } else if (flashlightValue == "1") { cbflashlight.Checked = true; } if (multitoolValue == "0") { cbmultitool.Checked = false; } else if (multitoolValue == "1") { cbmultitool.Checked = true; } if (mobilephoneValue == "0") { cbmobilephone.Checked = false; } else if (mobilephoneValue == "1") { cbmobilephone.Checked = true; } if (camerabatteriesValue == "0") { cbcamerabatteries.Checked = false; } else if (camerabatteriesValue == "1") { cbcamerabatteries.Checked = true; } if (trekkingpoleValue == "0") { cbtrekkingpole.Checked = false; } else if (trekkingpoleValue == "1") { cbtrekkingpole.Checked = true; } if (blanketValue == "0") { cbblanket.Checked = false; } else if (blanketValue == "1") { cbblanket.Checked = true; } if (extraclothesValue == "0") { cbextraclothes.Checked = false; } else if (extraclothesValue == "1") { cbextraclothes.Checked = true; } if (sandalsValue == "0") { cbsandals.Checked = false; } else if (sandalsValue == "1") { cbsandals.Checked = true; } if (campwaterValue == "0") { cbcampwater.Checked = false; } else if (campwaterValue == "1") { cbcampwater.Checked = true; } if (precookfoodValue == "0") { cbprecookfood.Checked = false; } else if (precookfoodValue == "1") { cbprecookfood.Checked = true; } if (riceValue == "0") { cbrice.Checked = false; } else if (riceValue == "1") { cbrice.Checked = true; } if (tyingstringValue == "0") { cbtyingstring.Checked = false; } else if (tyingstringValue == "1") { cbtyingstring.Checked = true; } if (stovefuelValue == "0") { cbstovefuel.Checked = false; } else if (stovefuelValue == "1") { cbstovefuel.Checked = true; } if (lighterValue == "0") { cblighter.Checked = false; } else if (lighterValue == "1") { cblighter.Checked = true; } if (matchesValue == "0") { cbmatches.Checked = false; } else if (matchesValue == "1") { cbmatches.Checked = true; } if (boloValue == "0") { cbbolo.Checked = false; } else if (boloValue == "1") { cbbolo.Checked = true; } if (mapcompassValue == "0") { cbmapcompass.Checked = false; } else if (mapcompassValue == "1") { cbmapcompass.Checked = true; } if (stoveValue == "0") { cbstove.Checked = false; } else if (stoveValue == "1") { cbstove.Checked = true; } if (cooksetValue == "0") { cbcookset.Checked = false; } else if (cooksetValue == "1") { cbcookset.Checked = true; } if (flagValue == "0") { cbflag.Checked = false; } else if (flagValue == "1") { cbflag.Checked = true; } if (tentValue == "0") { cbtent.Checked = false; } else if (tentValue == "1") { cbtent.Checked = true; } if (groundsheetValue == "0") { cbgroundsheet.Checked = false; } else if (groundsheetValue == "1") { cbgroundsheet.Checked = true; } if (ropeValue == "0") { cbrope.Checked = false; } else if (ropeValue == "1") { cbrope.Checked = true; } if (trowelValue == "0") { cbtrowel.Checked = false; } else if (trowelValue == "1") { cbtrowel.Checked = true; } txtOthers.Text = othersValue; //saving Button btnSave = FindViewById <Button>(Resource.Id.btnSave); btnSave.Click += (sender, e) => { if (cbbackpacks.Checked == true) { backpackValue = "1"; } else if (cbbackpacks.Checked == false) { backpackValue = "0"; } if (cbboots.Checked == true) { bootsValue = "1"; } else if (cbboots.Checked == false) { bootsValue = "0"; } if (cbplasticbags.Checked == true) { plasticbagValue = "1"; } else if (cbplasticbags.Checked == false) { plasticbagValue = "0"; } if (cbtoiletries.Checked == true) { toiletriesValue = "1"; } else if (cbtoiletries.Checked == false) { toiletriesValue = "0"; } if (cboutdoorclothes.Checked == true) { outdoorclothesValue = "1"; } else if (cboutdoorclothes.Checked == false) { outdoorclothesValue = "0"; } if (cbtrailfood.Checked == true) { trailfoodValue = "1"; } else if (cbtrailfood.Checked == false) { trailfoodValue = "0"; } if (cbpackedlunch.Checked == true) { packedlunchValue = "1"; } else if (cbpackedlunch.Checked == false) { packedlunchValue = "0"; } if (cbtrailwater.Checked == true) { trailwaterValue = "1"; } else if (cbtrailwater.Checked == false) { trailwaterValue = "0"; } if (cbfirstaidkit.Checked == true) { firstaidkitValue = "1"; } else if (cbfirstaidkit.Checked == false) { firstaidkitValue = "0"; } if (cbsurvivalkit.Checked == true) { survivalkitValue = "1"; } else if (cbsurvivalkit.Checked == false) { survivalkitValue = "0"; } if (cbmesskit.Checked == true) { messkitValue = "1"; } else if (cbmesskit.Checked == false) { messkitValue = "0"; } if (cbdrinkingcup.Checked == true) { drinkingcupValue = "1"; } else if (cbdrinkingcup.Checked == false) { drinkingcupValue = "0"; } if (cbspoonfork.Checked == true) { spoonforkValue = "1"; } else if (cbspoonfork.Checked == false) { spoonforkValue = "0"; } if (cbidentification.Checked == true) { identificationValue = "1"; } else if (cbidentification.Checked == false) { identificationValue = "0"; } if (cbwhistle.Checked == true) { whistleValue = "1"; } else if (cbwhistle.Checked == false) { whistleValue = "0"; } if (cbraingear.Checked == true) { raingearValue = "1"; } else if (cbraingear.Checked == false) { raingearValue = "0"; } if (cbjacket.Checked == true) { jacketValue = "1"; } else if (cbjacket.Checked == false) { jacketValue = "0"; } if (cbsunprotection.Checked == true) { sunprotectionValue = "1"; } else if (cbsunprotection.Checked == false) { sunprotectionValue = "0"; } if (cbflashlight.Checked == true) { flashlightValue = "1"; } else if (cbflashlight.Checked == false) { flashlightValue = "0"; } if (cbmultitool.Checked == true) { multitoolValue = "1"; } else if (cbmultitool.Checked == false) { multitoolValue = "0"; } if (cbmobilephone.Checked == true) { mobilephoneValue = "1"; } else if (cbmobilephone.Checked == false) { mobilephoneValue = "0"; } if (cbcamerabatteries.Checked == true) { camerabatteriesValue = "1"; } else if (cbcamerabatteries.Checked == false) { camerabatteriesValue = "0"; } if (cbtrekkingpole.Checked == true) { trekkingpoleValue = "1"; } else if (cbtrekkingpole.Checked == false) { trekkingpoleValue = "0"; } if (cbblanket.Checked == true) { blanketValue = "1"; } else if (cbblanket.Checked == false) { blanketValue = "0"; } if (cbextraclothes.Checked == true) { extraclothesValue = "1"; } else if (cbextraclothes.Checked == false) { extraclothesValue = "0"; } if (cbsandals.Checked == true) { sandalsValue = "1"; } else if (cbsandals.Checked == false) { sandalsValue = "0"; } if (cbcampwater.Checked == true) { campwaterValue = "1"; } else if (cbcampwater.Checked == false) { campwaterValue = "0"; } if (cbprecookfood.Checked == true) { precookfoodValue = "1"; } else if (cbprecookfood.Checked == false) { precookfoodValue = "0"; } if (cbrice.Checked == true) { riceValue = "1"; } else if (cbrice.Checked == false) { riceValue = "0"; } if (cbtyingstring.Checked == true) { tyingstringValue = "1"; } else if (cbtyingstring.Checked == false) { tyingstringValue = "0"; } if (cbstovefuel.Checked == true) { stovefuelValue = "1"; } else if (cbstovefuel.Checked == false) { stovefuelValue = "0"; } if (cblighter.Checked == true) { lighterValue = "1"; } else if (cblighter.Checked == false) { lighterValue = "0"; } if (cbmatches.Checked == true) { matchesValue = "1"; } else if (cbmatches.Checked == false) { matchesValue = "0"; } if (cbbolo.Checked == true) { boloValue = "1"; } else if (cbbolo.Checked == false) { boloValue = "0"; } if (cbmapcompass.Checked == true) { mapcompassValue = "1"; } else if (cbmapcompass.Checked == false) { mapcompassValue = "0"; } if (cbstove.Checked == true) { stoveValue = "1"; } else if (cbstove.Checked == false) { stoveValue = "0"; } if (cbcookset.Checked == true) { cooksetValue = "1"; } else if (cbcookset.Checked == false) { cooksetValue = "0"; } if (cbflag.Checked == true) { flagValue = "1"; } else if (cbflag.Checked == false) { flagValue = "0"; } if (cbtent.Checked == true) { tentValue = "1"; } else if (cbtent.Checked == false) { tentValue = "0"; } if (cbgroundsheet.Checked == true) { groundsheetValue = "1"; } else if (cbgroundsheet.Checked == false) { groundsheetValue = "0"; } if (cbrope.Checked == true) { ropeValue = "1"; } else if (cbrope.Checked == false) { ropeValue = "0"; } if (cbtrowel.Checked == true) { trowelValue = "1"; } else if (cbtrowel.Checked == false) { trowelValue = "0"; } var result = dbr.InsertRecordChecklist(name, backpackValue, bootsValue, plasticbagValue, toiletriesValue, outdoorclothesValue, trailfoodValue, packedlunchValue, trailwaterValue, firstaidkitValue, survivalkitValue, messkitValue, drinkingcupValue, spoonforkValue, identificationValue, whistleValue, raingearValue, jacketValue, sunprotectionValue, flashlightValue, multitoolValue, mobilephoneValue, camerabatteriesValue, trekkingpoleValue, blanketValue, extraclothesValue, sandalsValue, campwaterValue, precookfoodValue, riceValue, tyingstringValue, stovefuelValue, lighterValue, matchesValue, boloValue, mapcompassValue, stoveValue, cooksetValue, flagValue, tentValue, groundsheetValue, ropeValue, trowelValue, txtOthers.Text ); Toast.MakeText(this, result, ToastLength.Short).Show(); var intent = new Intent(this, typeof(listsActivity)); intent.PutExtra("name", name); SetResult(Result.Ok, intent); Finish(); OverridePendingTransition(Resource.Animation.fade_in, Resource.Animation.fade_out); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.settingsLayout); // Create your application here DBItineraryRepository dbr = new DBItineraryRepository(); var terrain = "terrain"; var terrainValue = "1"; var normal = "normal"; var normalValue = "0"; var satellite = "satellite"; var satelliteValue = "0"; var hybrid = "toiletries"; var hybridValue = "0"; RadioButton rbTerrain = FindViewById <RadioButton>(Resource.Id.rbTerrain); RadioButton rbNormal = FindViewById <RadioButton>(Resource.Id.rbNormal); RadioButton rbSatellite = FindViewById <RadioButton>(Resource.Id.rbSatellite); RadioButton rbHybrid = FindViewById <RadioButton>(Resource.Id.rbHybrid); Button aboutbuttonn = FindViewById <Button>(Resource.Id.btnAbout); aboutbuttonn.Click += Aboutbuttonn_Click; try { var terrainResult = dbr.GetRecordSettings(terrain); terrainValue = terrainResult; var normalResult = dbr.GetRecordSettings(normal); normalValue = normalResult; var satelliteResult = dbr.GetRecordSettings(satellite); satelliteValue = satelliteResult; var hybridResult = dbr.GetRecordSettings(hybrid); hybridValue = hybridResult; } catch (Exception ex) { } //implementing the value if (terrainValue == "1") { rbTerrain.Checked = true; rbNormal.Checked = false; rbSatellite.Checked = false; rbHybrid.Checked = false; } else if (normalValue == "1") { rbNormal.Checked = true; } else if (satelliteValue == "1") { rbSatellite.Checked = true; } else if (hybridValue == "1") { rbHybrid.Checked = true; } //saving Button btnSave = FindViewById <Button>(Resource.Id.btnSave); btnSave.Click += (sender, e) => { if (rbTerrain.Checked == true) { terrainValue = "1"; normalValue = "0"; hybridValue = "0"; satelliteValue = "0"; } else if (rbNormal.Checked == true) { terrainValue = "0"; normalValue = "1"; hybridValue = "0"; satelliteValue = "0"; } else if (rbSatellite.Checked == true) { terrainValue = "0"; normalValue = "0"; hybridValue = "0"; satelliteValue = "1"; } else if (rbHybrid.Checked == true) { terrainValue = "0"; normalValue = "0"; hybridValue = "1"; satelliteValue = "0"; } var result = dbr.InsertRecordSettings(terrain, terrainValue); dbr.InsertRecordSettings(normal, normalValue); dbr.InsertRecordSettings(satellite, satelliteValue); dbr.InsertRecordSettings(hybrid, hybridValue); Toast.MakeText(this, result, ToastLength.Short).Show(); Finish(); }; }