Esempio n. 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            //toolbar
            mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            SetSupportActionBar(mToolbar);

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            //Fragment
            mFragmentContainer = FindViewById <FrameLayout>(Resource.Id.fragmentContainer);

            //Left side menu
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer   = FindViewById <ExpandableListView>(Resource.Id.left_drawer);

            mDrawerToggle = new DrawerToggle(
                this,                           //Host Activity
                mDrawerLayout,                  //DrawerLayout
                Resource.String.openDrawer,     //Opened Message
                Resource.String.closeDrawer     //Closed Message
                );

            mDrawerLayout.AddDrawerListener(mDrawerToggle);

            mDrawerToggle.SyncState();

            npcc_LeftSideMenu objLeft = new npcc_LeftSideMenu(this);

            objLeft.fillLeftSideMenu(mLeftDrawer);


            //set fragment
            setFragments();
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            mToolbar           = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            mDrawerLayout      = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer        = FindViewById <ExpandableListView>(Resource.Id.left_drawer);
            mRightDrawer       = FindViewById <ListView>(Resource.Id.right_drawer);
            mFragmentContainer = FindViewById <FrameLayout>(Resource.Id.fragmentContainer);

            SetSupportActionBar(mToolbar);
            setFragments();

            mLeftDrawer.Tag  = 0;
            mRightDrawer.Tag = 1;

            npcc_LeftSideMenu objLeft = new npcc_LeftSideMenu(this);

            objLeft.fillLeftSideMenu(mLeftDrawer);

            clsRightMenu objRight = new clsRightMenu(this);

            objRight.fillRightSideMenu(mRightDrawer);


            mDrawerToggle = new DrawerToggle(
                this,                                                   //Host Activity
                mDrawerLayout,                                          //DrawerLayout
                Resource.String.openDrawer,                             //Opened Message
                Resource.String.closeDrawer                             //Closed Message
                );

            mDrawerLayout.AddDrawerListener(mDrawerToggle);

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetLogo(Resource.Drawable.logo);

            mDrawerToggle.SyncState();

            //         if (savedInstanceState != null)
            //{
            //             if (savedInstanceState.GetString("DrawerState") == "Opened")
            //	{
            //		SupportActionBar.SetTitle(Resource.String.openDrawer);
            //	}

            //	else
            //	{
            //		SupportActionBar.SetTitle(Resource.String.closeDrawer);
            //	}
            //}

            //else
            //{
            //	//This is the first the time the activity is ran
            //	SupportActionBar.SetTitle(Resource.String.closeDrawer);
            //}
        }