Exemplo n.º 1
0
        /// <summary>
        /// Called when [create].
        /// </summary>
        /// <param name="bundle">The bundle.</param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.HomeView);

            var fragments = new List <MvxViewPagerFragmentAdapter.FragmentInfo>
            {
                new MvxViewPagerFragmentAdapter.FragmentInfo
                {
                    FragmentType = typeof(FirstFragment),
                    Title        = "First Fragment",
                    ViewModel    = ViewModel.First
                },
                new MvxViewPagerFragmentAdapter.FragmentInfo
                {
                    FragmentType = typeof(SecondFragment),
                    Title        = "Second Fragment",
                    ViewModel    = ViewModel.Second
                },
                new MvxViewPagerFragmentAdapter.FragmentInfo
                {
                    FragmentType = typeof(ThirdFragment),
                    Title        = "Third Fragment",
                    ViewModel    = ViewModel.Third
                }
            };

            _viewPager         = FindViewById <ViewPager>(Resource.Id.viewPager);
            _adapter           = new MvxViewPagerFragmentAdapter(this, SupportFragmentManager, fragments);
            _viewPager.Adapter = _adapter;

            _pageIndicator = FindViewById <PagerSlidingTabStrip>(Resource.Id.viewPagerIndicator);

            _pageIndicator.SetViewPager(_viewPager);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.PersonDetailsLayout);
            this.PrepareViews();

            ListView mDrawerList = FindViewById <ListView>(Resource.Id.left_drawer);

            mDrawerList.Adapter = new LeftDrawerAdapter(this);

            PersonType = (PersonTypeEnumeration)Intent.GetIntExtra("persontype", (int)PersonTypeEnumeration.Posel);
            PersonId   = Intent.GetIntExtra("id", -1);
            if (PersonId == -1)
            {
                IncorrectId();
            }
            PersonName = Intent.GetStringExtra("name");

            SupportActionBar.Title = String.Concat("Poseł: ", PersonName);

            switch (PersonType)
            {
            case PersonTypeEnumeration.Posel:
            {
                fragmentsTabs.Add("Profil", new PoselProfileFragment());
                fragmentsTabs.Add("Głosowania", new PersonVotesFragment());
                fragmentsTabs.Add("Wystąpienia", new PersonSpeechesFragment());
                fragmentsTabs.Add("Interpelacje", new PersonInterpellationsFragment());
                fragmentsTabs.Add("Współpracownicy", new PoselWspolpracownicyFragment());
                fragmentsTabs.Add("Oświadczenia majątkowe", new PoselOswiadczeniaMajatkoweFragment());
                fragmentsTabs.Add("Rejestr Korzyści", new PoselRejestrKorzysciFragment());
                fragmentsTabs.Add("Aktywność", new PersonNewestFragment());

                break;
            }
            }

            if (fragmentsTabs.Count == 0)
            {
                Toast.MakeText(this, "Nieprawidłowy typ osoby", ToastLength.Long);
                this.Finish();
            }

            tabs  = FindViewById <com.refractored.PagerSlidingTabStrip> (Resource.Id.tabs);
            pager = FindViewById <ViewPager> (Resource.Id.pager);

            tabs.ShouldExpand = false;

            pager.Adapter = new UniversalFragmentPagerAdapter(FragmentManager, fragmentsTabs);
            tabs.SetViewPager(pager);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Called when [create].
        /// </summary>
        /// <param name="bundle">The bundle.</param>
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.HomeView);

            var fragments = new List<MvxViewPagerFragmentAdapter.FragmentInfo>
              {
                new MvxViewPagerFragmentAdapter.FragmentInfo
                {
                  FragmentType = typeof(FirstFragment),
                  Title = "First Fragment",
                  ViewModel = ViewModel.First
                },
                new MvxViewPagerFragmentAdapter.FragmentInfo
                {
                  FragmentType = typeof(SecondFragment),
                  Title = "Second Fragment",
                  ViewModel = ViewModel.Second
                },
                new MvxViewPagerFragmentAdapter.FragmentInfo
                {
                  FragmentType = typeof(ThirdFragment),
                  Title = "Third Fragment",
                  ViewModel = ViewModel.Third
                }
              };

            _viewPager = FindViewById<ViewPager>(Resource.Id.viewPager);
            _adapter = new MvxViewPagerFragmentAdapter(this, SupportFragmentManager, fragments);
            _viewPager.Adapter = _adapter;

            _pageIndicator = FindViewById<PagerSlidingTabStrip>(Resource.Id.viewPagerIndicator);

            _pageIndicator.SetViewPager(_viewPager);
        }