protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.MainScreenActivityView); //this.Window.AddFlags(WindowManagerFlags.Fullscreen); PopulateTabs (); _tabHost = FindViewById<TabHost>(Resource.Id.tabHost1); //set selected tab if there is a topic (coming from a notification) try { string topic = Intent.GetStringExtra("topic"); if (topic != null) { _tabHost.SetCurrentTabByTag (topic); } } catch(Exception e) { } _refresher = FindViewById<SwipeRefreshLayout>(Resource.Id.refresher1); _refresher.Refresh += delegate { PopulateSermons(); PopulatePrayerRequests(); PopulateElders(); _refresher.Refreshing = false; }; _gestureListener = new GestureListener(); _gestureListener.LeftEvent += GestureRight; _gestureListener.RightEvent += GestureLeft; _gestureDetector = new GestureDetector(this, _gestureListener); }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView(Resource.Layout.fragment_tabs); tabHost = FindViewById<TabHost>(Android.Resource.Id.TabHost); tabHost.Setup(); tabManager = new TabManager(this, tabHost, Resource.Id.realtabcontent); tabManager.AddTab(tabHost.NewTabSpec("simple").SetIndicator("Simple"), Java.Lang.Class.FromType(typeof(FragmentStackSupport.CountingFragment)), null); tabManager.AddTab(tabHost.NewTabSpec("contacts").SetIndicator("Custom"), Java.Lang.Class.FromType(typeof(LoaderCursorSupport.CursorLoaderListFragment)), null); /*tabManager.AddTab(tabHost.NewTabSpec("contacts").SetIndicator("Contacts"), LoaderCursorSupport.CursorLoaderListFragment.class, null); tabManager.AddTab(tabHost.NewTabSpec("custom").SetIndicator("Custom"), LoaderCustomSupport.AppListFragment.class, null); tabManager.AddTab(mttabHost.NewTabSpec("throttle").SetIndicator("Throttle"), LoaderThrottleSupport.ThrottledLoaderListFragment.class, null); */ if (savedInstanceState != null) { tabHost.SetCurrentTabByTag(savedInstanceState.GetString("tab")); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); MenuId = Resource.Menu.MainMenu; SetContentView(Resource.Layout.fragment_tabs); m_TabHost = FindViewById<TabHost>(Android.Resource.Id.TabHost); m_TabHost.Setup(); m_ViewPager = FindViewById<ViewPager>(Resource.Id.pager); m_TabsAdapter = new TabsAdapter(this, m_TabHost, m_ViewPager); ActionBar = FindViewById<ActionBar>(Resource.Id.actionbar); ActionBar.Title = "Look Fragments"; ActionBar.CurrentActivity = this; AddHomeAction(); var action = new MenuItemActionBarAction(this, this, Resource.Id.menu_search, Resource.Drawable.ic_action_search_dark, Resource.String.menu_string_search); ActionBar.AddAction(action); var spec = m_TabHost.NewTabSpec("tv"); spec.SetIndicator("Tab 1", Resources.GetDrawable(Resource.Drawable.ic_launcher)); m_TabsAdapter.AddTab(spec, Java.Lang.Class.FromType(typeof(FramgmentTab1)), null); spec = m_TabHost.NewTabSpec("tab2"); spec.SetIndicator("Tab 2", Resources.GetDrawable(Resource.Drawable.ic_launcher)); m_TabsAdapter.AddTab(spec, Java.Lang.Class.FromType(typeof(FramgmentTab2)), null); if (bundle != null) { m_TabHost.SetCurrentTabByTag(bundle.GetString("tab")); } else { m_TabHost.CurrentTab = 0; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); MenuId = Resource.Menu.mainmenu; SetContentView(Resource.Layout.fragment_tabs); _tabHost = FindViewById<TabHost>(Android.Resource.Id.TabHost); _tabHost.Setup(); _viewPager = FindViewById<ViewPager>(Resource.Id.pager); _tabsAdapter = new TabsAdapter(this, _tabHost, _viewPager); LegacyBar = FindViewById<Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.Title = "Look Fragments"; AddHomeAction(typeof (HomeActivity), Resource.Drawable.icon); var action = new MenuItemLegacyBarAction(this, Resource.Id.menu_search, Resource.Drawable.ic_action_search_dark, Resource.String.menu_string_search); LegacyBar.AddAction(action); TabHost.TabSpec spec = _tabHost.NewTabSpec("tv"); spec.SetIndicator("Tab 1", Resources.GetDrawable(Resource.Drawable.icon)); _tabsAdapter.AddTab(spec, Class.FromType(typeof (FramgmentTab1)), null); spec = _tabHost.NewTabSpec("tab2"); spec.SetIndicator("Tab 2", Resources.GetDrawable(Resource.Drawable.icon)); _tabsAdapter.AddTab(spec, Class.FromType(typeof (FramgmentTab2)), null); if (bundle != null) { _tabHost.SetCurrentTabByTag(bundle.GetString("tab")); } else { _tabHost.CurrentTab = 0; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView(Resource.Layout.fragment_tabs_pager); tabHost = FindViewById<TabHost>(Android.Resource.Id.TabHost); tabHost.Setup(); viewPager = FindViewById<ViewPager>(Resource.Id.pager); tabsAdapter = new TabsAdapter(this, tabHost, viewPager); tabsAdapter.AddTab(tabHost.NewTabSpec("simple").SetIndicator("Simple"), Java.Lang.Class.FromType(typeof(FragmentStackSupport.CountingFragment)), null); tabsAdapter.AddTab(tabHost.NewTabSpec("contacts").SetIndicator("Custom"), Java.Lang.Class.FromType(typeof(LoaderCursorSupport.CursorLoaderListFragment)), null); if (savedInstanceState != null) { tabHost.SetCurrentTabByTag(savedInstanceState.GetString("tab")); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layouts.fragment_tabs_pager); mTabHost = (TabHost)FindViewById(global::Android.R.Id.Tabhost); mTabHost.Setup(); mViewPager = (ViewPager)FindViewById(R.Ids.pager); mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager); mTabsAdapter.AddTab(mTabHost.NewTabSpec("simple").SetIndicator("Simple"), typeof(FragmentStackSupport.CountingFragment), null); mTabsAdapter.AddTab(mTabHost.NewTabSpec("contacts").SetIndicator("Contacts"), typeof(LoaderCursorSupport.CursorLoaderListFragment), null); mTabsAdapter.AddTab(mTabHost.NewTabSpec("custom").SetIndicator("Custom"), typeof(LoaderCustomSupport.AppListFragment), null); mTabsAdapter.AddTab(mTabHost.NewTabSpec("throttle").SetIndicator("Throttle"), typeof(LoaderThrottleSupport.ThrottledLoaderListFragment), null); if (savedInstanceState != null) { mTabHost.SetCurrentTabByTag(savedInstanceState.GetString("tab")); } }
private void PopulateTabs() { _tabHost = FindViewById<TabHost> (Resource.Id.tabHost1); _tabHost.Setup (); var spec1 = _tabHost.NewTabSpec ("sermons"); spec1.SetContent (Resource.Id.sermonsLayout); spec1.SetIndicator ("Sermons"); var spec2 = _tabHost.NewTabSpec ("prayerRequests"); spec2.SetContent (Resource.Id.prayerRequestsLayout); spec2.SetIndicator ("Prayer Requests"); var spec3 = _tabHost.NewTabSpec ("elders"); spec3.SetContent (Resource.Id.eldersLayout); spec3.SetIndicator ("Elders"); _tabHost.AddTab (spec1); _tabHost.AddTab (spec2); _tabHost.AddTab (spec3); _tabHost.SetCurrentTabByTag ("prayerRequests"); for (int j = 0; j < _tabHost.TabWidget.ChildCount; j++) { TextView tv = (TextView)_tabHost.TabWidget.GetChildAt (j).FindViewById (Android.Resource.Id.Title); tv.SetTextColor(Android.Graphics.Color.ParseColor("#FFFFFF")); } //PopulateSermons (); PopulatePrayerRequests(); PopulateElders(); }