Exemple #1
0
        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_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);

            case Resource.Id.action_fragment1:
                ShowFragment(mFragment1);
                SupportActionBar.Title = " - " + Resources.GetString(Resource.String.Frag1Title);
                return(true);

            case Resource.Id.action_fragment2:
                ShowFragment(mFragment2);
                SupportActionBar.Title = " - " + Resources.GetString(Resource.String.Frag2Title);
                return(true);

            case Resource.Id.action_fragment3:
                ShowFragment(mFragment3);
                SupportActionBar.Title = " - " + Resources.GetString(Resource.String.Frag3Title);
                return(true);

            case Resource.Id.action_fragment5:
                StartActivity(typeof(Fragment5));
                SupportActionBar.Title = " - " + Resources.GetString(Resource.String.Frag5Title);
                return(true);

            case Resource.Id.action_Logout:
                SecureStorage.Remove("oauth_token");
                StartActivity(typeof(LoginActivity));
                Finish();
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }
Exemple #2
0
        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
                mDrawerToggle.OnOptionsItemSelected(item);
                return(true);

            case Resource.Id.action_Logout:
                SecureStorage.Remove("oauth_token");
                StartActivity(typeof(LoginActivity));
                Finish();
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }