public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Resource.Id.addToFavorites: recipe.IsFavorite = !recipe.IsFavorite; SetFavoriteDrawable(recipe.IsFavorite); break; case Resource.Id.about: StartActivity(typeof(AboutActivity)); break; case Android.Resource.Id.Home: Finish(); break; case Resource.Id.oneServing: SetServings(1); item.SetChecked(true); break; case Resource.Id.twoServings: SetServings(2); item.SetChecked(true); break; case Resource.Id.fourServings: SetServings(4); item.SetChecked(true); break; } return(true); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (ViewModel.IsBusy) { return(base.OnOptionsItemSelected(item)); } switch (item.ItemId) { case Resource.Id.menu_refresh: ViewModel.RefreshCommand.Execute(null); return(true); case Resource.Id.menu_stats: var intent = new Intent(this, typeof(StatisticsView)); intent.PutExtra("name", ViewModel.GroupName); intent.PutExtra("id", ViewModel.GroupId); StartActivity(intent); return(true); case Resource.Id.menu_filter_events: Settings.ShowAllEvents = !Settings.ShowAllEvents; ViewModel.RefreshCommand.Execute(null); SupportInvalidateOptionsMenu(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (ViewModel.IsBusy) { return(base.OnOptionsItemSelected(item)); } switch (item.ItemId) { case Resource.Id.menu_about: var builder = new AlertDialog.Builder(this); builder .SetTitle(Resource.String.menu_about) .SetMessage(Resource.String.about) .SetPositiveButton(Resource.String.ok, delegate { }); AlertDialog alert = builder.Create(); alert.Show(); return(true); case Resource.Id.menu_refresh: ViewModel.RefreshLoginCommand.Execute(null); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { // This is called when the Home (Up) button is pressed in the action bar. // Create a simple intent that starts the hierarchical parent activity and // use NavUtils in the Support Package to ensure proper handling of Up. var upIntent = new Intent(this, typeof(MainActivity)); if (NavUtils.ShouldUpRecreateTask(this, upIntent)) { // This activity is not part of the application's task, so create a new task // with a synthesized back stack. TaskStackBuilder.Create(this) // If there are ancestor activities, they should be added here. .AddNextIntent(upIntent) .StartActivities(); this.Finish(); } else { // This activity is part of the application's task, so simply // navigate up to the hierarchical parent activity. NavUtils.NavigateUpTo(this, upIntent); } return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item)//מימוש התפריט { switch (item.ItemId) //מחליף את האיף ועוזר לקצר את הקוד באמצעות סוויץ על לחיצה על האיטם אידי { case Resource.Id.action_start: //וקייס כדי לממש את התנאי באיידי הספציפי { Intent intent = new Intent(this, typeof(FirstService)); // הפעלת הפונקציה StartService(intent); Toast.MakeText(this, "you started the music", ToastLength.Long).Show(); return(true); } case Resource.Id.action_stop: //עצירת השיר { Intent intent = new Intent(this, typeof(FirstService)); StopService(intent); Toast.MakeText(this, "you stop the music", ToastLength.Long).Show(); return(true); } } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Resource.Id.menu_settings: var intent = new Intent(this, typeof(SettingsActivity)); StartActivity(intent); return(true); case Resource.Id.menu_history: var intent2 = new Intent(this, typeof(HistoryActivity)); StartActivity(intent2); return(true); case Resource.Id.menu_share: var intent3 = new Intent(Intent.ActionSend); intent3.PutExtra(Intent.ExtraText, string.Format(Resources.GetString(Resource.String.share_steps_today), stepCount.Text)); intent3.SetType("text/plain"); StartActivity(Intent.CreateChooser(intent3, Resources.GetString(Resource.String.share_steps_on))); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { Finish(); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (interruptorCaja.OnOptionsItemSelected(item)) { return true; } return base.OnOptionsItemSelected(item); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.TitleFormatted.ToString() == "Menu 2") { Toast.MakeText(Activity, "Selected Menu 2.", ToastLength.Short).Show(); return(true); } return(false); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { // If this callback does not handle the item click, onPerformDefaultAction // of the ActionProvider is invoked. Hence, the provider encapsulates the // complete functionality of the menu item. Toast.MakeText(this, Resource.String.action_bar_settings_action_provider_no_handling, ToastLength.Short).Show(); return(false); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == global::Android.Resource.Id.Home && SupportFragmentManager.BackStackEntryCount > 0) { SupportFragmentManager.PopBackStack(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { this.StartActivity(typeof(HomeActivity)); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == Resource.Id.logout) { ViewModel.LogoutCommand.Execute(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Resource.Id.actionSettings: Toast.MakeText(this, "Clicked on Settings", ToastLength.Short).Show(); break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: drawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.Start); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home && !_slidingLayout.IsOpen) { _slidingLayout.SmoothSlideOpen(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (item.ItemId == Resource.Id.simple_item) { Toast.MakeText(Activity, "Selected nested fragment's menu item.", ToastLength.Short).Show(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { int id = item.ItemId; if (id == Resource.Id.action_settings) { return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { int id = item.ItemId; switch (id) { case Resource.Id.teste: Toast.MakeText(this, "Teste clicado", ToastLength.Short).Show(); break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { // Respond to the action bar's Up/Home button case Android.Resource.Id.Home: Finish(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: Finish(); break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case MENU_SEARCH_ID: ViewModel?.ShowSearchCommand.Execute(null); return(base.OnOptionsItemSelected(item)); } return(base.OnOptionsItemSelected(item)); }
// Called when the user selects a contextual menu item public bool OnActionItemClicked(ActionMode mode, Android.Views.IMenuItem item) { if (ActionItemClicked != null) { return(ActionItemClicked.Invoke(mode, item)); } else { return(false); // Return false if nothing is done } }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { //case Resource.Id.Main: //Intent it = new Intent(this, typeof(The_MainActivity)); //return true; default: return(false); } }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: OnBackPressed(); return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: drawer.OpenDrawer((int)Android.Views.GravityFlags.Left); return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case Resource.Id.gc: GC.Collect(); return(true); default: break; } return(base.OnOptionsItemSelected(item)); }
void SwapFragmentForMenuItem(Android.Views.IMenuItem item) { // set item selected in the navigation item.SetChecked(true); switch (item.ItemId) { case Resource.Id.nav_posts: ShowFragment(new PostsFragment()); break; default: break; } }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { switch (item.ItemId) { case 1: { _viewModel.OptionMenuSelectedCommand.Execute(item.ItemId); } return(true); default: return(false); } }
public override bool OnOptionsItemSelected(Android.Views.IMenuItem item) { if (ViewModel.IsBusy) { return(base.OnOptionsItemSelected(item)); } switch (item.ItemId) { case Resource.Id.menu_refresh: ViewModel.RefreshCommand.Execute(null); return(true); } return(base.OnOptionsItemSelected(item)); }