Beispiel #1
0
        //main logic

        private void AboutTextView_Click(object sender, EventArgs e)
        {
            var intent = new Intent(this, typeof(About));

            StartActivity(intent);
            drawerLayout.CloseDrawer(drawerContainer);
        }
Beispiel #2
0
        private void ListItemClicked(int position)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = new Fragment1();
                break;

            case 1:
                fragment = new Fragment2();
                break;

            case 2:
                fragment = new Fragment3(this);
                break;

            default:
                fragment = new Fragment1();
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();

            drawerList.SetItemChecked(position, true);
            SupportActionBar.Title = title = Sections[position];
            drawer.CloseDrawer(drawerList);
        }
 public void CloseDrawer()
 {
     if (drawer.IsDrawerOpen(GravityCompat.Start))
     {
         drawer.CloseDrawer(GravityCompat.Start);
     }
 }
 void MLeftDrawer_ItemClick(object sender, Android.Widget.AdapterView.ItemClickEventArgs e)
 {
     if (e != null)
     {
         if (e.Position == 0)
         {
             SupportActionBar.SetTitle(Resource.String.animals);
             mDrawerLayout.CloseDrawer(mLeftDrawer);
             ShowFragment(ViewEnumeration.VIEW_ANIMAL);
         }
         else if (e.Position == 1)
         {
             SupportActionBar.SetTitle(Resource.String.scientists);
             mDrawerLayout.CloseDrawer(mLeftDrawer);
             ShowFragment(ViewEnumeration.VIEW_SCIENTIST);
         }
     }
 }
        void OnMenuItemClick(int position)
        {
            base.FragmentManager
            .BeginTransaction()
            .Replace(Resource.Id.frameLayout, fragments[position])
            .Commit();

            this.Title = titles[position];

            drawerLayout.CloseDrawer(menuListView);
        }