Ejemplo n.º 1
0
        /// <summary>
        /// Setups the side menu.
        /// </summary>
        /// <returns>The side menu.</returns>
        private async void SetupSideMenu()
        {
            LoginResponse loginResponseObj = mSharedPreferencesManager.GetLoginResponse();

            drawerList = FindViewById <RelativeLayout>(Resource.Id.left_drawer);
            TextView txt_user_name  = FindViewById <TextView>(Resource.Id.txt_user_name);
            TextView txt_user_email = FindViewById <TextView>(Resource.Id.txt_user_email);

            txt_user_name.Text  = loginResponseObj.Name;
            txt_user_email.Text = loginResponseObj.UserEmail;

            menuListView = FindViewById <ExpandableListView>(Resource.Id.listview);

            menuListView.SetOnChildClickListener(this);
            menuListView.SetOnGroupClickListener(this);
            menuListView.SetOnGroupExpandListener(this);

            menuList = GetExpandableMenuItem();
            mAdapter = new SideMenuListExpandableAdapter(mActivity, menuList);

            // set up the drawer's list view with items and click listener
            menuListView.SetAdapter(mAdapter);

            drawerToggle = new MyActionBarDrawerToggle(this,
                                                       drawerLayout, toolbar,
                                                       Resource.String.open_drawer,
                                                       Resource.String.close_drawer);
            drawerLayout.AddDrawerListener(drawerToggle);

            SupportActionBar.SetDisplayShowHomeEnabled(true);

            drawerToggle.SyncState();
            drawerToggle.DrawerIndicatorEnabled = true;

            // Call Email Count webservice
            await GetEmailCounts();
        }