コード例 #1
0
        public static StationsFragment NewInstance(IStationsView view, IStationsPresenter presenter)
        {
            var fragment = new StationsFragment
            {
                _view      = view,
                _presenter = presenter
            };

            return(fragment);
        }
コード例 #2
0
        private void SetupTabs()
        {
            var tabs = new List <StationsTab>
            {
                new StationsTab(StationsFragment.NewInstance(this, _presenter), "Todas"),
                new StationsTab(StationsFragment.NewInstance(this, _lowLightStationsPresenter), "Poca disponibilidad"),
                new StationsTab(StationsFragment.NewInstance(this, _topAvailableStationsPresenter), "Top 5")
            };

            var mainPageAdapter = new StationsTabAdapter(SupportFragmentManager, tabs);

            _viewPager = FindViewById <ViewPager>(Resource.Id.viewPager);
            _viewPager.OffscreenPageLimit = 3;
            _viewPager.Adapter            = mainPageAdapter;
            _viewPager.SetPageTransformer(true, new ScaleTransformer());
        }