public override bool OnOptionsItemSelected(IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { if (drawer.IsDrawerOpen(list)) { drawer.CloseDrawer(list); } else { drawer.OpenDrawer(list); } return(true); } switch (item.ItemId) { case (SWAP_MENU): App.STATE.SwapLanguage(); return(true); case (RESET_MENU): ResetStorehouseConfirmation(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnCreateOptionsMenu(IMenu menu) { int group = 0; IMenuItem item1 = menu.Add(group, SWAP_MENU, SWAP_MENU, "Swap"); item1.SetShowAsAction((int)ShowAsAction.Never | (int)ShowAsAction.WithText); IMenuItem item2 = menu.Add(group, RESET_MENU, RESET_MENU, "Reset Library"); item2.SetShowAsAction((int)ShowAsAction.Never | (int)ShowAsAction.WithText); //IMenuItem item3 = menu.Add(group, SETTINGS_MENU, SETTINGS_MENU, "Settings"); //item3.SetShowAsAction((int)ShowAsAction.Never | (int)ShowAsAction.WithText); return(base.OnCreateOptionsMenu(menu)); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case global::Android.Resource.Id.Home: Toggle(); return true; case (TRANSLATE_MENU): ThisApp.TranslateLanguageDialog(this).Show(); return true; case (NOTE_MENU): string[] verses = new string[ThisApp.selectedVerses.Count]; if (ThisApp.selectedVerses.Count == 0) { return true; } var intent = new Intent(this, typeof(NoteEditActivity)); StartActivity(intent); return true; } return base.OnOptionsItemSelected(item); }
//public override bool OnCreateOptionsMenu(IMenu menu) //{ // base.OnCreateOptionsMenu(menu); // //menu.Add(0, InsertId, 0, "+Note").SetShowAsAction(ShowAsAction.IfRoom); // SearchView search = new SearchView(SupportActionBar.ThemedContext); // search.SetQueryHint("Search Friends"); // search.SetIconifiedByDefault(true); // return true; //} public override bool OnMenuItemSelected(int featureId, IMenuItem item) { switch (item.ItemId) { case SYNC_MENU: Parse.Initialize(this, "scBTJphDK8yVGGtNhcL9cYee89GbEKuRkygGYXKa", "wlXg6dWeJBCxD3uNbnoCTnnZlpSvvZWOdfyoeREZ"); if (ParseUser.CurrentUser != null) { ThisApp.SuperDialog(this, "Sync My Notes", "Select a type of sync:", "Download", "Upload", delegate { ThisApp.SyncUserNotesFromParse(this); }, delegate { this.FillData(); ThisApp.SyncUserNotesToParse(this, notesList); }, true, "Logout", delegate { Toast.MakeText(this, ParseUser.CurrentUser.Username + " logged out.", ToastLength.Long).Show(); ParseUser.LogOut(); }).Show(); } else { ThisApp.SuperDialog(this, "Sync My Notes", "You are not logged in.\n\nWhen you are logged in and sync your notes, they are stored in a safe parsed database online. Would you like to continue?", "Continue", "Cancel", delegate { var intent = new Intent(this, typeof(LogInActivity)); StartActivity(intent); }, delegate { }, true).Show(); } return true; } return base.OnMenuItemSelected(featureId, item); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case (6): ThisApp.selectedPublication.CurrentPage--; offset--; if (ThisApp.ReaderKind == ReaderKind.EPUBReader) { ReloadEPUBPage(); } else if (ThisApp.ReaderKind == ReaderKind.PublicationReader) { ReloadPublicationPage(); } else if (ThisApp.ReaderKind == ReaderKind.BibleReader) { ReloadBiblePage(); } else if (ThisApp.ReaderKind == ReaderKind.DailyTextReader) { LoadDailyTextReader(); } return true; case (7): ThisApp.selectedPublication.CurrentPage++; offset++; if (ThisApp.ReaderKind == ReaderKind.EPUBReader) { ReloadEPUBPage(); } else if (ThisApp.ReaderKind == ReaderKind.PublicationReader) { ReloadPublicationPage(); } else if (ThisApp.ReaderKind == ReaderKind.BibleReader) { ReloadBiblePage(); } else if (ThisApp.ReaderKind == ReaderKind.DailyTextReader) { LoadDailyTextReader(); } return true; case (9): offset = 0; if (ThisApp.ReaderKind == ReaderKind.EPUBReader) { ReloadEPUBPage(); } else if (ThisApp.ReaderKind == ReaderKind.PublicationReader) { ReloadPublicationPage(); } else if (ThisApp.ReaderKind == ReaderKind.BibleReader) { ReloadBiblePage(); } else if (ThisApp.ReaderKind == ReaderKind.DailyTextReader) { LoadDailyTextReader(); } return true; } return base.OnOptionsItemSelected(item); }
public override bool OnMenuItemSelected(int featureId, IMenuItem item) { if (Android.Resource.Id.Home == item.ItemId) { var top = (new MainActivity()).Class; if (this.Class != top) { Intent intent = new Intent(this, top); intent.AddFlags(ActivityFlags.ClearTop); StartActivity(intent); } } return base.OnMenuItemSelected(featureId, item); }