public override bool OnOptionsItemSelected(IMenuItem item) { switch (item?.ItemId) { case Android.Resource.Id.Home: if (mainDrawerLayout.IsDrawerOpen(GravityCompat.Start)) { mainDrawerLayout.CloseDrawer(GravityCompat.Start); } else { mainDrawerLayout.OpenDrawer(GravityCompat.Start); } break; case Resource.Id.CartoonSkipPrevious: (cartoonScreenF as CartoonScreen).SkipCartoon(-1); break; case Resource.Id.CartoonSkipNext: (cartoonScreenF as CartoonScreen).SkipCartoon(1); break; case Resource.Id.RefreshCartoonImageCache: (cartoonScreenF as CartoonScreen).RefreshCartoon(); break; case Resource.Id.CartoonExit: mainDrawerLayout.CloseDrawer(GravityCompat.Start); OnBackPressed(); break; } return(base.OnOptionsItemSelected(item)); }
/// <summary> /// /// </summary> private void Toolbar_MenuItemClick(object sender, V7Toolbar.MenuItemClickEventArgs e) { switch (e.Item.ItemId) { case Resource.Id.home: drawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.End); break; } }
private void BottomAppBar_MenuItemClick(object sender, Android.Support.V7.Widget.Toolbar.MenuItemClickEventArgs e) { if (drawerLayout.IsDrawerOpen(drawerLayout)) { drawerLayout.CloseDrawer(drawerLayout, true); } else { drawerLayout.OpenDrawer(drawerLayout, true); } }
public override bool OnOptionsItemSelected(IMenuItem item) { Log.Error("lv====", "12121212121212121212121212"); switch (item.ItemId) { case Android.Resource.Id.Home: //NavUtils.NavigateUpFromSameTask(this); DrawerLayout.OpenDrawer(GravityCompat.Start); return(true); } return(base.OnOptionsItemSelected(item)); }
//Реагуємо на кліки по Action Bar та висувного списку public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: mDrawerLayout.OpenDrawer((int)GravityFlags.Left); mNavigationView.Menu.FindItem(Resource.Id.nav_list_of_rooms).SetCheckable(true); mNavigationView.Menu.FindItem(Resource.Id.nav_list_of_rooms).SetChecked(true); return(true); case Resource.Id.create_room: Intent intent = new Intent(this, typeof(CreateRoom)); StartActivity(intent); return(true); case Resource.Id.create_cleaning_task: IntentManagement.IntentManagement.CreateIntentToUpdateCleaningTask(this, -1, -1); return(true); default: return(base.OnOptionsItemSelected(item)); } }
private void OnNavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs args) { var homeViewModel = this.ViewModel as HomeViewModel; switch (args.MenuItem.ItemId) { case Android.Resource.Id.Home: _drawer.OpenDrawer(Android.Support.V4.View.GravityCompat.Start); break; case Resource.Id.nav_map: homeViewModel.SelectMenuItemCommand.Execute(MenuSection.Map); break; case Resource.Id.nav_routes: homeViewModel.SelectMenuItemCommand.Execute(MenuSection.Routes); break; case Resource.Id.nav_stops: homeViewModel.SelectMenuItemCommand.Execute(MenuSection.RouteStops); break; case Resource.Id.nav_preferences: homeViewModel.SelectMenuItemCommand.Execute(MenuSection.Preferences); break; case Resource.Id.nav_about: homeViewModel.SelectMenuItemCommand.Execute(MenuSection.About); break; } base.OnOptionsItemSelected(args.MenuItem); }
protected override void OnCreate(Bundle savedInstanceState) { //BitopiSingelton.Instance.CurrentActivity = "Approval Activity"; base.OnCreate(savedInstanceState); //bitopiApplication = (BitopiApplication)this.ApplicationContext; bitopiApplication.CurrentActivity = "Approval Activity"; //bitopiApplication.ReceivingMessages= new Dictionary<string, List<string>>(); //PushNotificationSingleton.Instance.SaveNotification(""); //BitopiSingelton.Instance.ReceivingMessages = new Dictionary<string, List<string>>(); SetContentView(Resource.Layout.ApprovalList); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetCustomView(Resource.Layout.custom_actionbar); rlApproval = FindViewById <RelativeLayout>(Resource.Id.rlApproval); rlApprovalList = FindViewById <RelativeLayout>(Resource.Id.rlApprovalList); tvMsg = FindViewById <TextView>(Resource.Id.tvMsg); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Visibility = ViewStates.Visible; RLleft_drawer = FindViewById <RelativeLayout>(Resource.Id.RLleft_drawer); FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Click += (s, e) => { if (mDrawerLayout.IsDrawerOpen(RLleft_drawer)) { mDrawerLayout.CloseDrawer(RLleft_drawer); } else { mDrawerLayout.OpenDrawer(RLleft_drawer); } }; // base.LoadDrawerView(); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: mDrawerLayout.OpenDrawer((int)GravityFlags.Left); return(true); case Resource.Id.toolbarMenu_pricingType: //show dialog here SupportFragmentTransaction transaction = SupportFragmentManager.BeginTransaction(); PricingTypeDialogFragment pricingTypeDialog = new PricingTypeDialogFragment(); //pass current selected price type t var args = new Bundle(); args.PutString("currentPricingType", mCurrentSelectedPriceType); pricingTypeDialog.Arguments = args; pricingTypeDialog.Show(transaction, "pricingTypeDialogFragment"); return(true); case Resource.Id.toolbarMenu_customer: Android.Widget.Toast.MakeText(this, "Clicked Customer Icon!", Android.Widget.ToastLength.Long).Show(); return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case 16908332: if (drawer.IsDrawerOpen(GravityCompat.Start)) { drawer.CloseDrawer(GravityCompat.Start); } else { drawer.OpenDrawer(GravityCompat.Start); //navigation. } return(true); case 2131230896: /*checkProgress.Visibility = ViewStates.Visible; * fillOld(); * checkProgress.Visibility = ViewStates.Invisible;*/ this.Recreate(); return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { if (mDrawerToggle.OnOptionsItemSelected(item)) { if (mDrawerLayout.IsDrawerOpen(mRightDrawer)) { mDrawerLayout.CloseDrawer(mRightDrawer); } return(true); } switch (item.ItemId) { case Resource.Id.support: if (mDrawerLayout.IsDrawerOpen(mRightDrawer)) { mDrawerLayout.CloseDrawer(mRightDrawer); } else { mDrawerLayout.CloseDrawer(mLeftDrawer); mDrawerLayout.OpenDrawer(mRightDrawer); } return(true); default: return(base.OnOptionsItemSelected(item)); } }
protected virtual void ActionHooker() { logoutBtn.Click += delegate { Android.Support.V7.App.AlertDialog.Builder alertDialog = new Android.Support.V7.App.AlertDialog.Builder(this); alertDialog.SetTitle(GetString(Resource.String.logoutAlert)); alertDialog.SetIcon(Resource.Drawable.ic4c_192x192); alertDialog.SetMessage(GetString(Resource.String.logoutAlertMsg)); alertDialog.SetPositiveButton(GetString(Resource.String.yes), delegate { this.Finish(); StartActivity(typeof(Login)); alertDialog.Dispose(); }); alertDialog.SetNegativeButton(GetString(Resource.String.no), delegate { alertDialog.Dispose(); }); alertDialog.Show(); }; menuImageView.Click += delegate { if (drawerLayout.IsDrawerOpen(navigationView)) { drawerLayout.CloseDrawer(navigationView); } else { drawerLayout.OpenDrawer(navigationView); } }; }
public override void initListner() { ib_menu.Click += delegate(object sender, EventArgs e) { drawer.OpenDrawer(lv_menu); }; vp_content.PageSelected += delegate(object sender, Android.Support.V4.View.ViewPager.PageSelectedEventArgs e) { switch (e.Position) { case 0: tv_title.Text = "Lessons"; break; case 1: tv_title.Text = "Account"; break; case 2: tv_title.Text = "Settings"; break; default: break; } }; }
//Реагуємо на кліки по Action Bar та висувного списку public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: mDrawerLayout.OpenDrawer((int)GravityFlags.Left); mNavigationView.Menu.FindItem(Resource.Id.nav_management).SetCheckable(true); mNavigationView.Menu.FindItem(Resource.Id.nav_management).SetChecked(true); return(true); case Resource.Id.create_cleaning_task: IntentManagement.IntentManagement.CreateIntentToUpdateCleaningTask(this, -1, roomId); return(true); case Resource.Id.delete_room: Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this); builder.SetMessage(Resource.String.delete_alert_dialog_message); builder.SetPositiveButton(Resource.String.positive_button_lined_text_dialog, DeleteAlertDialogPositiveButtonListener); builder.SetNegativeButton(Resource.String.negative_button_lined_text_dialog, DeleteAlertDialogNegativeButtonListener); builder.Create(); builder.Show(); return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: _drawerLayout.CloseDrawer(_rightDrawer); _drawerToggle.OnOptionsItemSelected(item); return(true); case Resource.Id.action_add: if (_drawerLayout.IsDrawerOpen(_rightDrawer)) { _drawerLayout.CloseDrawer(_rightDrawer); } else { _drawerLayout.OpenDrawer(_rightDrawer); _drawerLayout.CloseDrawer(_leftDrawer); } return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: drawerLayout.OpenDrawer(GravityCompat.Start); break; case Resource.Id.filter: ShowRadioButtonDialog(); break; //case Resource.Id.search: // Intent intent = new Intent(this, typeof(SearchActivity)); // Bundle b = new Bundle(); // b.PutString("query", "john"); // intent.PutExtras(b); // StartActivity(intent); // break; default: Toast.MakeText(this, item.TitleFormatted + ": " + "Overflow", ToastLength.Long).Show(); break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { Intent contactsIntent; switch (item.ItemId) { case Resource.Id.myContacts: // Intent это объект, который обеспечивает связывание отдельных компонент во время выполнения (например, двух активити ) contactsIntent = new Intent(this, typeof(ContactsActivity)); StartActivity(contactsIntent); break; case Resource.Id.settings: if (m_DrawerLayout.IsDrawerOpen(m_RightDrawerList)) { //Right Drawer is already open, close it m_DrawerLayout.CloseDrawer(m_RightDrawerList); } else { //Right Drawer is closed, open it m_DrawerLayout.OpenDrawer(m_RightDrawerList); } break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case global::Android.Resource.Id.Home: _drawer.OpenDrawer(GravityCompat.Start); return(true); case Resource.Id.action_brightness: // Need to adjust the Brightness control position here as can guarantee the toolbar has been laid out UpdateBightnessPosition(); // Update the control visibility if (_brightnessControlContainer.Visibility == ViewStates.Visible) { _brightnessControlContainer.Visibility = ViewStates.Invisible; } else { if (EnsureWriteSettingsPrivilege()) { HandleBrightnessPermissionGranted(); } } return(true); } return(base.OnOptionsItemSelected(item)); }
private void ActionToDoWhenHomePressed() { try { if (m_isCreatingNewtrajet) { m_isCreatingNewtrajet = !m_isCreatingNewtrajet; UpdateUIToShowListOrCreateNewtrajet(); } else { //If menu is open, close it. Else, open it. if (m_drawerLayout.IsDrawerOpen(GravityCompat.Start)) { m_drawerLayout.CloseDrawers(); } else { m_drawerLayout.OpenDrawer(GravityCompat.Start); } } } catch (Exception e) { MobileCenter_Helper.ReportError(new FileAccessManager(), e, GetType().Name, MethodBase.GetCurrentMethod().Name); } }
public override bool OnOptionsItemSelected(IMenuItem item) { MyFragment fragement = FragmentManager.FindFragmentByTag <MyFragment>(MyFragment.PAGE_CONTENT); MyUtil.HideSoftKeyboard(this); switch (item.ItemId) { case Resource.Id.nav_home: MyUtil.GoPage(fragement, PAGE.HOME); return(true); case Resource.Id.nav_register: MyUtil.GoPage(fragement, PAGE.REGI); return(true); case Resource.Id.nav_list: MyUtil.GoPage(fragement, PAGE.LIST); return(true); default: if (drawerLayout.IsDrawerOpen(navigationView)) { drawerLayout.CloseDrawers(); } else { drawerLayout.OpenDrawer(navigationView); } return(true); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: hDrawerLayout.CloseDrawer(hRightDrawer); hDrawerToggle.OnOptionsItemSelected(item); return(true); case Resource.Id.add_menu: if (hDrawerLayout.IsDrawerOpen(hRightDrawer)) { hDrawerLayout.CloseDrawer(hRightDrawer); return(true); } else { hDrawerLayout.OpenDrawer(hRightDrawer); hDrawerLayout.CloseDrawer(hLeftDrawer); return(true); } default: return(base.OnOptionsItemSelected(item)); } }
//Menu item selected public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: //Ensure the right drawer is closed drawerLayout.CloseDrawer(rightDrawer_mainLayoutLinearLayout); drawerToggle.OnOptionsItemSelected(item); return(true); case Resource.Id.action_rightDrawerMainMenu: if (drawerLayout.IsDrawerOpen(rightDrawer_mainLayoutLinearLayout)) { //Right Drawer is already open, close it drawerLayout.CloseDrawer(rightDrawer_mainLayoutLinearLayout); } else { //Right Drawer is already closed, open it and just in case close left drawer drawerLayout.OpenDrawer(rightDrawer_mainLayoutLinearLayout); //drawerLayout.CloseDrawer(leftDrawer_mainLayoutLinearLayout); } return(true); default: return(base.OnOptionsItemSelected(item)); } }
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)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); RegisterForDetailsRequests(bundle); SetContentView(Resource.Layout.home); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); _drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); _drawer.SetDrawerShadow(Resource.Drawable.drawer_shadow_light, (int)GravityFlags.Start); _drawerToggle = new MyActionBarDrawerToggle(this, _drawer, Resource.Drawable.ic_drawer_dark, Resource.String.drawer_open, Resource.String.drawer_close); _drawerToggle.DrawerClosed += (_, e) => InvalidateOptionsMenu(); _drawerToggle.DrawerOpened += (_, e) => InvalidateOptionsMenu(); _drawer.SetDrawerListener(_drawerToggle); if (bundle == null) { ViewModel.ShowMenuCommand.Execute(null); _drawer.OpenDrawer((int)GravityFlags.Left); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: //The hamburger icon was clicked which means the drawer toggle will handle the event //all we need to do is ensure the right drawer is closed so the don't overlap mDrawerLayout.CloseDrawer(mRightDrawer); mDrawerToggle.OnOptionsItemSelected(item); return(true); case Resource.Id.action_refresh: //Refresh return(true); case Resource.Id.action_help: if (mDrawerLayout.IsDrawerOpen(mRightDrawer)) { //Right Drawer is already open, close it mDrawerLayout.CloseDrawer(mRightDrawer); } else { //Right Drawer is closed, open it and just in case close left drawer mDrawerLayout.OpenDrawer(mRightDrawer); mDrawerLayout.CloseDrawer(mLeftDrawer); } return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: mDrawerLayout.OpenDrawer((int)GravityFlags.Left); return(true); //case Resource.Id.Account: // Intent intent = new Intent(this, typeof(Account)); // StartActivity(intent); // return (true); case Resource.Id.nav_home_camera: try { //var progressDialog = ProgressDialog.Show(context, "", "Scanning", true); FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.PerformClick(); } catch (System.Exception ex) { string brokenforshit = ex.Message; } return(true); default: return(base.OnOptionsItemSelected(item)); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.EventList); var recyclerView = FindViewById <MvxRecyclerView>(Resource.Id.mvxRecyclerView1); if (recyclerView != null) { recyclerView.HasFixedSize = true; var layoutManager = new LinearLayoutManager(this); recyclerView.SetLayoutManager(layoutManager); recyclerView.AddOnScrollFetchItemsListener(layoutManager, () => ViewModel.LoadMoreTask, () => ViewModel.LoadMoreCommand); } var editText = this.FindViewById <EditText>(Resource.Id.searchtextbox); if (editText != null) { editText.OnTextChangeListener(() => ViewModel.SearchTask, () => ViewModel.SearchCommand, () => ViewModel.CancelLoadDataCommand); } DrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); if (bundle == null) { ViewModel.ShowMenuViewModelCommand.Execute(null); } var menuBtn = FindViewById <ImageButton>(Resource.Id.menu); menuBtn.Click += delegate { DrawerLayout.OpenDrawer(GravityCompat.Start); }; }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: mDrawerLayout.OpenDrawer((int)GravityFlags.Left); break; case Resource.Id.action_language: ChangeLanguage(); //types = allTypes.defenseTypes; //Convert.ConvertInsideTypes(leftSide, rightSide); //Convert.ConvertTextViews(layouts); break; case Resource.Id.action_help: FragmentTransaction transaction = FragmentManager.BeginTransaction(); DialogHelp dialog = new DialogHelp(); dialog.Show(transaction, "Help"); break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item?.ItemId) { case Android.Resource.Id.Home: if (mainDrawerLayout.IsDrawerOpen(GravityCompat.Start)) { mainDrawerLayout.CloseDrawer(GravityCompat.Start); } else { mainDrawerLayout.OpenDrawer(GravityCompat.Start); } break; case Resource.Id.RefreshOldGFDImageCache: _ = ((OldGFDViewerScreen)oldGFDViewerF).DownloadGFDImage(); ((OldGFDViewerScreen)oldGFDViewerF).ShowImage(0); break; case Resource.Id.OldGFDExit: mainDrawerLayout.CloseDrawer(GravityCompat.Start); OnBackPressed(); break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item?.ItemId) { case Android.Resource.Id.Home: if (mainDrawerLayout.IsDrawerOpen(GravityCompat.Start)) { mainDrawerLayout.CloseDrawer(GravityCompat.Start); } else { mainDrawerLayout.OpenDrawer(GravityCompat.Start); } break; } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { if (item.ItemId == Android.Resource.Id.Home) { DrawerLayout.OpenDrawer(GravityCompat.Start); return(true); } return(base.OnOptionsItemSelected(item)); }