Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.Main);

            view_pager = (FindViewById<ViewPager> (Resource.Id.pager));

            //make the first page the white light fragment
            LightFragmentAdapter adapter = new LightFragmentAdapter (SupportFragmentManager);
            adapter.AddFragment (new WhiteLightFragment ());

            //make the second page the party light fragment
            party_fragment = new PartyLightFragment ();
            adapter.AddFragment (party_fragment);

            view_pager.Adapter = adapter;
            view_pager.AddOnPageChangeListener(new MyOnPageListener (this));
        }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            view_pager = (FindViewById <ViewPager> (Resource.Id.pager));

            //make the first page the white light fragment
            LightFragmentAdapter adapter = new LightFragmentAdapter(SupportFragmentManager);

            adapter.AddFragment(new WhiteLightFragment());

            //make the second page the party light fragment
            party_fragment = new PartyLightFragment();
            adapter.AddFragment(party_fragment);

            view_pager.Adapter = adapter;
            view_pager.AddOnPageChangeListener(new MyOnPageListener(this));
        }