예제 #1
0
        private void nav_NavigationItemSelected(object sender, NavigationEventArgs args)
        {
            var containerResId = Resource.Id.fragment_container;

            var transaction = SupportFragmentManager.BeginTransaction();
            transaction.SetTransition((int)SupportFragmentTransaction.TransitFragmentOpen);

            if (args.NavItemPosition == NavigationDestination.List) {
                list_fragment = list_fragment ?? new SampleListFragment();
                list_fragment.FastScrollEnabled = false;
                transaction.Replace(containerResId, list_fragment);
            } else if (args.NavItemPosition == NavigationDestination.Grid) {
                grid_fragment = grid_fragment ?? new GridFragment();
                transaction.Replace(containerResId, grid_fragment);
            } else if (args.NavItemPosition == NavigationDestination.ScrollView) {
                image_fragment = new ImageFragment(Resource.Drawable.android_flavors);
                transaction.Replace(containerResId, image_fragment);
            } else if (args.NavItemPosition == NavigationDestination.ListFastScroll) {
                list_fragment = list_fragment ?? new SampleListFragment();
                list_fragment.FastScrollEnabled = true;
                transaction.Replace(containerResId, list_fragment);
            } else if (args.NavItemPosition == NavigationDestination.ExpandableList) {
                expandablelist_fragment = expandablelist_fragment ?? new ExpandableListFragment();
                transaction.Replace(containerResId, expandablelist_fragment);
            }

            transaction.AddToBackStack(null);
            transaction.Commit();
        }
예제 #2
0
        private void nav_NavigationItemSelected(object sender, NavigationEventArgs args)
        {
            var containerResId = Resource.Id.fragment_container;

            var transaction = SupportFragmentManager.BeginTransaction();
            transaction.SetTransition((int)SupportFragmentTransaction.TransitFragmentOpen);

            if (args.NavItemPosition == 0) {
                list_fragment = list_fragment ?? new SampleListFragment();
                transaction.Replace(containerResId, list_fragment);
            } else if (args.NavItemPosition == 1) {
                grid_fragment = grid_fragment ?? new GridFragment();
                transaction.Replace(containerResId, grid_fragment);
            } else if (args.NavItemPosition == 2) {
                image_fragment = new ImageFragment(Resource.Drawable.android_flavors);
                transaction.Replace(containerResId, image_fragment);
            }

            transaction.AddToBackStack(null);
            transaction.Commit();
        }
예제 #3
0
 public GridAdapter(GridFragment fragment, Context context, int textViewResId, List <string> objects) : base(context, textViewResId, objects)
 {
     this.fragment = fragment;
 }
예제 #4
0
 public GridAdapter(GridFragment fragment, Context context, int textViewResId, List<string> objects)
     : base(context, textViewResId, objects)
 {
     this.fragment = fragment;
 }