Beispiel #1
0
 public TabManager(FragmentActivity activity, TabHost tabHost, int containerId)
 {
     _activity    = activity;
     _tabHost     = tabHost;
     _containerId = containerId;
     _tabHost.SetOnTabChangedListener(this);
 }
 public TabsAdapter(FragmentActivity activity, TabHost tabHost, ViewPager pager) : base(activity.SupportFragmentManager)
 {
     _context   = activity;
     _tabHost   = tabHost;
     _viewPager = pager;
     _tabHost.SetOnTabChangedListener(this);
     _viewPager.Adapter = this;
     _viewPager.SetOnPageChangeListener(this);
 }
Beispiel #3
0
 public TabsAdapter(FragmentActivity activity, TabHost tabHost, ViewPager pager) : base(activity.GetSupportFragmentManager())
 {
     mContext   = activity;
     mTabHost   = tabHost;
     mViewPager = pager;
     mTabHost.SetOnTabChangedListener(this);
     mViewPager.SetAdapter(this);
     mViewPager.SetOnPageChangeListener(this);
 }
Beispiel #4
0
        private void InitializeTabHost(Bundle args)
        {
            _tabHost = (TabHost)FindViewById(global::Android.Resource.Id.TabHost);
            _tabHost.Setup();

            AddTabs(args);

            if (_lookup.Any())
            {
                OnTabChanged(_lookup.First().Key);
            }

            _tabHost.SetOnTabChangedListener(this);
        }
        private void initialiseTabHost(Bundle args)
        {
            mTabHost = (TabHost)FindViewById(Android.Resource.Id.TabHost);
            mTabHost.Setup();
            TabInfo tabInfo = null;

            SamplePlanningActivity.addTab(this, this.mTabHost, this.mTabHost.NewTabSpec("Tab1").SetIndicator("Not Received"),
                                          (tabInfo = new TabInfo("Tab1", typeof(SampleNotReceived), args != null ? args : new Bundle())));

            this.mapTabInfo.Add(tabInfo.tag, tabInfo);

            SamplePlanningActivity.addTab(this, this.mTabHost, this.mTabHost.NewTabSpec("Tab2").SetIndicator("Not Delivered"),
                                          (tabInfo = new TabInfo("Tab2", typeof(SampleNotDelivered), args != null ? args : new Bundle())));
            this.mapTabInfo.Add(tabInfo.tag, tabInfo);
            SamplePlanningActivity.addTab(this, this.mTabHost, this.mTabHost.NewTabSpec("Tab3").SetIndicator("Upcoming"),
                                          (tabInfo = new TabInfo("Tab3", typeof(SampleUpcomoing), args != null ? args : new Bundle())));
            this.mapTabInfo.Add(tabInfo.tag, tabInfo);
            // Default to first tab
            this.OnTabChanged("Tab1");
            //
            mTabHost.SetOnTabChangedListener(this);
        }