public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            InflaterMain = inflater;
            view         = inflater.Inflate(Resource.Layout.tabview_test, container, false);

            tabLayout = view.FindViewById <TabLayout>(Resource.Id.tabLayout_id);
            viewPager = view.FindViewById <ViewPager>(Resource.Id.viewPager_id);

            adapter = new ViewPagerAdapter(this.Activity.SupportFragmentManager);

            DBRepository dBRepository = new DBRepository();
            UserInfo     user         = dBRepository.GetUserInfo();

            switch (user.group)
            {
            case "Foreman":
                _PendingLists          = new assignment_lists(Library.npcc_types.inf_assignment_type.Pending);
                _UnderFabricationLists = new assignment_lists(Library.npcc_types.inf_assignment_type.UnderFabrication);
                _UnderWeldingLists     = new assignment_lists(Library.npcc_types.inf_assignment_type.UnderWelding);
                _CompletedLists        = new assignment_lists(Library.npcc_types.inf_assignment_type.Completed);

                adapter.AddFragment(_PendingLists, new Java.Lang.String("pending"));
                adapter.AddFragment(_UnderFabricationLists, new Java.Lang.String("Under Fabrication"));
                adapter.AddFragment(_UnderWeldingLists, new Java.Lang.String("Under Welding"));
                adapter.AddFragment(_CompletedLists, new Java.Lang.String("Completed"));

                viewPager.OffscreenPageLimit = 4;
                break;

            case "Fabricator":
            case "Welder":
                _PendingLists = new assignment_lists(Library.npcc_types.inf_assignment_type.Pending);
                adapter.AddFragment(_PendingLists, new Java.Lang.String("pending"));

                viewPager.OffscreenPageLimit = 1;

                break;
            }
            viewPager.Adapter = adapter;
            tabLayout.SetupWithViewPager(viewPager);
            tabLayout.Post(_PendingLists.fill_list);
            tabLayout.TabSelected += TabLayout_TabSelected;

            common_functions.npcc_apply_font(view.FindViewById <TabLayout>(Resource.Id.tabLayout_id));

            ImageService.Instance.InvalidateCacheAsync(FFImageLoading.Cache.CacheType.All);

            return(view);
        }
Пример #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            InflaterMain = inflater;
            view         = inflater.Inflate(Resource.Layout.tabview_test, container, false);

            tabLayout = view.FindViewById <TabLayout>(Resource.Id.tabLayout_id);
            viewPager = view.FindViewById <ViewPager>(Resource.Id.viewPager_id);

            adapter = new ViewPagerAdapter(this.Activity.SupportFragmentManager);
            adapter.AddFragment(new CustomListView(), new Java.Lang.String("CustomListView"));
            adapter.AddFragment(GenericCustomList.NewInstance(Resource.Layout.QrCode_test), new Java.Lang.String("landing_page"));
            adapter.AddFragment(new contact(), new Java.Lang.String("contact"));
            adapter.AddFragment(new QrCode_test(), new Java.Lang.String("QrCode_test"));
            adapter.AddFragment(new assignment_lists(Library.npcc_types.inf_assignment_type.Pending), new Java.Lang.String("CustomListView"));
            adapter.AddFragment(new QrCode_test(), new Java.Lang.String("QrCode_test"));
            adapter.AddFragment(new assignment_lists(Library.npcc_types.inf_assignment_type.Completed), new Java.Lang.String("CustomListView"));
            adapter.AddFragment(new QrCode_test(), new Java.Lang.String("QrCode_test"));
            adapter.AddFragment(new Webview_test(), new Java.Lang.String("Webview_test"));

            viewPager.Adapter = adapter;
            tabLayout.SetupWithViewPager(viewPager);
            common_functions.npcc_apply_font(view.FindViewById <TabLayout>(Resource.Id.tabLayout_id));
            return(view);
        }