Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.SearchPage);

            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolbar_search);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout_search);

            SetSupportActionBar(mToolbar);



            FragmentTransaction transaction = FragmentManager.BeginTransaction();
            SlidingTabsFragment fragment    = new SlidingTabsFragment();

            transaction.Replace(Resource.Id.search_fragment, fragment);
            transaction.Commit();
            try
            {
                mDrawerToggle = new MyActionBarDrawerToggle(
                    this,                                       //Host Activity
                    mDrawerLayout,                              //DrawerLayout
                    Resource.String.openDrawer,                 //Opened Message
                    Resource.String.closeDrawer                 //Closed Message
                    );
                mDrawerLayout.SetDrawerListener(mDrawerToggle); //gives drawer toggle permission to call the methods
                SupportActionBar.SetHomeButtonEnabled(true);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetDisplayShowTitleEnabled(true);
                mDrawerToggle.SyncState();
            }
            catch
            {
            }

            mNavView  = FindViewById <NavigationView>(Resource.Id.nav_view_search);
            mHomeItem = FindViewById <AdapterView>(Resource.Id.nav_home);
            mNavView.NavigationItemSelected += MNavView_NavigationItemSelected;

            if (bundle != null)
            {
                if (bundle.GetString("DrawerState") == "Opened")
                {
                    SupportActionBar.SetTitle(Resource.String.openDrawer);
                }
                else
                {
                    SupportActionBar.SetTitle(Resource.String.closeDrawer);
                }
            }
            else
            {
                //first time activity is ran
                SupportActionBar.SetTitle(Resource.String.closeDrawer);
            }
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.ProfilePage);

            mToolbar      = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);



            SetSupportActionBar(mToolbar);


            mBtnChangePassword = FindViewById <Button>(Resource.Id.btnChangePassword);

            mBtnChangePassword.Click += (object sender, EventArgs args) =>
            {
                //Pull up dialog
                FragmentTransaction    transaction    = FragmentManager.BeginTransaction(); //This pulls up the dialog
                dialog_Change_Password changePassword = new dialog_Change_Password();
                changePassword.Show(transaction, "dialog fragment");
            };

            mDrawerToggle = new MyActionBarDrawerToggle(
                this,                                       //Host Activity
                mDrawerLayout,                              //DrawerLayout
                Resource.String.openDrawer,                 //Opened Message
                Resource.String.closeDrawer                 //Closed Message
                );
            mDrawerLayout.SetDrawerListener(mDrawerToggle); //gives drawer toggle permission to call the methods
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            mDrawerToggle.SyncState();

            mNavView  = FindViewById <NavigationView>(Resource.Id.nav_view);
            mHomeItem = FindViewById <AdapterView>(Resource.Id.nav_home);
            mNavView.NavigationItemSelected += MNavView_NavigationItemSelected;

            if (bundle != null)
            {
                if (bundle.GetString("DrawerState") == "Opened")
                {
                    SupportActionBar.SetTitle(Resource.String.openDrawer);
                }
                else
                {
                    SupportActionBar.SetTitle(Resource.String.closeDrawer);
                }
            }
            else
            {
                //first time activity is ran
                SupportActionBar.SetTitle(Resource.String.closeDrawer);
            }
        }