protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Index); TabHost tab = FindViewById <TabHost>(Resource.Id.tabHost1); tab.Setup(); TabHost.TabSpec spec1 = tab.NewTabSpec("主页"); spec1.SetContent(Resource.Id.layoutIndex); spec1.SetIndicator("主页"); TabHost.TabSpec spec2 = tab.NewTabSpec("书篮"); spec2.SetContent(Resource.Id.layoutBookbasket); spec2.SetIndicator("书篮"); TabHost.TabSpec spec3 = tab.NewTabSpec("个人中心"); spec3.SetContent(Resource.Id.layoutPrivate); spec3.SetIndicator("个人中心"); tab.AddTab(spec1); tab.AddTab(spec2); tab.AddTab(spec3); TabBookBasket(); TabIndex(); TabPrivate(); }
private void IsMain(bool isInit = true, bool isReq = false) { SetContentView(Resource.Layout.Main); baseModel.Content = CurrentContent.Main; TabHost tabHost = (TabHost)FindViewById(Resource.Id.tabHost); tabHost.Setup(); Android.Widget.TabHost.TabSpec spec1 = tabHost.NewTabSpec("Tab 1"); spec1.SetIndicator("Todo"); spec1.SetContent(Resource.Id.tab1); Android.Widget.TabHost.TabSpec spec2 = tabHost.NewTabSpec("Tab 2"); spec2.SetIndicator("Waiting"); spec2.SetContent(Resource.Id.tab2); Android.Widget.TabHost.TabSpec spec3 = tabHost.NewTabSpec("Tab 3"); spec3.SetIndicator("Done"); spec3.SetContent(Resource.Id.tab3); add = (Button)FindViewById(Resource.Id.Add); add.Click += Main_Button_Click; tab1Content = (ScrollView)FindViewById(Resource.Id.tab1Content); tab2Content = (ScrollView)FindViewById(Resource.Id.tab2Content); tab3Content = (ScrollView)FindViewById(Resource.Id.tab3Content); tabHost.AddTab(spec1); tabHost.AddTab(spec2); tabHost.AddTab(spec3); AddToContent(isInit, isReq); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); TabHost tabHost = (TabHost)FindViewById(Resource.Id.tabHost); tabHost.Setup(); TabHost.TabSpec tabSpec = tabHost.NewTabSpec("xp1"); tabSpec.SetContent(Resource.Id.linear_layout_ports_config_xp1); tabSpec.SetIndicator("XP1"); tabHost.AddTab(tabSpec); tabSpec = tabHost.NewTabSpec("xp2"); tabSpec.SetContent(Resource.Id.linear_layout_ports_config_xp2); tabSpec.SetIndicator("XP2"); tabHost.AddTab(tabSpec); tabSpec = tabHost.NewTabSpec("xt2"); tabSpec.SetContent(Resource.Id.linear_layout_ports_config_xt2); tabSpec.SetIndicator("XT2"); tabHost.AddTab(tabSpec); tabSpec = tabHost.NewTabSpec("xp56"); tabSpec.SetContent(Resource.Id.linear_layout_ports_config_xp56); tabSpec.SetIndicator("XP5/6"); tabHost.AddTab(tabSpec); tabHost.CurrentTab = 0; }
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")); } }
private void InitializeTabs(Bundle savedInstanceState) { mlam = new LocalActivityManager(this, true); tabHost = FindViewById <TabHost> (Resource.Id.tabHost); mlam.DispatchCreate(savedInstanceState); tabHost.Setup(mlam); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.InvoiceScreen, container, false); view = v; InitActionBar(); invoiceTabHeader = InvoiceTabHeader.NewInstance(this); invoiceTabDetails = InvoiceTabDetails.NewInstance(this); invoiceTabDetails.DetailsChanged += invoiceTabDetails_DetailsChanged; invoiceTabHeader.CustomerChanged += invoiceTabHeader_CustomerChanged; tabHost = (TabHost)view.FindViewById(Resource.Id.tabhost); tabHost.Setup(); InitializeTab(); /*if (isTablet) * { * if (Common.isPortrait(this.Activity)) * { * InitPopupMenu(); * } * } */ GC.Collect(); return(v); }
public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle p2) { mRootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_session_detail, null); mTabHost = mRootView.FindViewById <TabHost> (Android.Resource.Id.TabHost); mTabHost.Setup(); mTitle = mRootView.FindViewById <TextView> (Resource.Id.session_title); mSubtitle = mRootView.FindViewById <TextView> (Resource.Id.session_subtitle); mStarred = mRootView.FindViewById <CompoundButton> (Resource.Id.star_button); mStarred.CheckedChange += HandleCheckedChange; mStarred.Focusable = true; mStarred.Clickable = true; // Larger target triggers star toggle View starParent = mRootView.FindViewById <View> (Resource.Id.header_session); FractionalTouchDelegate.SetupDelegate(starParent, mStarred, new RectF(0.6f, 0f, 1f, 0.8f)); mAbstract = mRootView.FindViewById <TextView> (Resource.Id.session_abstract); mRequirements = mRootView.FindViewById <TextView> (Resource.Id.session_requirements); SetupSummaryTab(); SetupNotesTab(); SetupLinksTab(); return(mRootView); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); //Main TabHost tabHost = FindViewById <TabHost> (Resource.Id.tabHost); tabHost.Setup(this.LocalActivityManager); TabHost.TabSpec tabSpec1 = tabHost.NewTabSpec("Contacts"); TabHost.TabSpec tabSpec2 = tabHost.NewTabSpec("Settings"); Intent intent; tabSpec1.SetIndicator("Contacts"); intent = new Intent(this, typeof(ContactsActivity)); intent.AddFlags(ActivityFlags.NewTask); tabSpec1.SetContent(intent); tabSpec2.SetIndicator("Settings"); intent = new Intent(this, typeof(SettingsActivity)); intent.AddFlags(ActivityFlags.NewTask); tabSpec2.SetContent(intent); tabHost.AddTab(tabSpec1); tabHost.AddTab(tabSpec2); tabHost.CurrentTab = 0; intent = new Intent(this, typeof(LoginActivity)); StartActivity(intent); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CustomerDetails, container, false); viewCust = view; InitActionBar(); view.FindViewById <FrameLayout>(Resource.Id.realtabcontent).Visibility = ViewStates.Gone; customer = CustomerInfo.GetCustomer(Activity, this.ObjectId); tbCustCode = (TextView)view.FindViewById(Resource.Id.tbCustomerCode); tbCustName = (TextView)view.FindViewById(Resource.Id.tbCustomerName); tbCustCode.Text = customer.Code; tbCustName.Text = customer.Name; statisticTabMonthly = StatisticTabMonthly.NewInstance(this.ObjectId); statisticTabByDate = StatisticTabByDate.NewInstance(this.ObjectId, customerNames); mTabHost = (TabHost)view.FindViewById(Resource.Id.tabhost); mTabHost.TabChanged += TabHostHandleTabChanged; mTabHost.Setup(); InitializeTab(view); GC.Collect(); return(view); }
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")); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.AssignmentsTabsLayout); tabHost = FindViewById <TabHost> (Resource.Id.assingmentTabHost); //In order to use tabs outside of a TabActivity I have to use this local activity manager and dispatch create the savedInstanceState localManger = new LocalActivityManager(this, true); localManger.DispatchCreate(savedInstanceState); tabHost.Setup(localManger); TabHost.TabSpec assignmentsSpec = tabHost.NewTabSpec("list"); Intent assignmentIntent = new Intent(this, typeof(AssignmentsActivity)); assignmentsSpec.SetContent(assignmentIntent); assignmentsSpec.SetIndicator("list"); TabHost.TabSpec mapViewSpec = tabHost.NewTabSpec("map"); Intent mapViewIntent = new Intent(this, typeof(MapViewActivity)); mapViewSpec.SetContent(mapViewIntent); mapViewSpec.SetIndicator("map"); tabHost.AddTab(assignmentsSpec); tabHost.AddTab(mapViewSpec); tabHost.TabChanged += (sender, e) => { if (tabHost.CurrentTab == 0) { MapData = null; } }; try { if (savedInstanceState != null) { if (savedInstanceState.ContainsKey(Constants.CurrentTab)) { var currentTab = savedInstanceState.GetInt(Constants.CurrentTab, 0); tabHost.CurrentTab = currentTab; } else { tabHost.CurrentTab = 0; } MapData = savedInstanceState.ContainsKey("mapData") ? (MapDataWrapper)savedInstanceState.GetSerializable("mapData") : null; } else { MapData = null; tabHost.CurrentTab = 0; } } catch (Exception) { tabHost.CurrentTab = 0; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); TabHost tabs = (TabHost)FindViewById(Resource.Id.TabHost01); tabs.Setup(); TabHost.TabSpec spec1 = tabs.NewTabSpec("tag01"); spec1.SetContent(Resource.Id.AnalogClock01); spec1.SetIndicator("Analog Clock"); tabs.AddTab(spec1); TabHost.TabSpec spec2 = tabs.NewTabSpec("tag02"); spec2.SetContent(Resource.Id.DigitalClock01); spec2.SetIndicator("Digital Clock"); tabs.AddTab(spec2); TabHost.TabSpec spec3 = tabs.NewTabSpec("tag03"); spec3.SetContent(Resource.Id.imagenview1); spec3.SetIndicator("Imagen"); tabs.AddTab(spec3); TabHost.TabSpec spec4 = tabs.NewTabSpec("tag04"); spec4.SetContent(Resource.Id.textview2); spec4.SetIndicator("Texto"); tabs.AddTab(spec4); TabHost.TabSpec spec5 = tabs.NewTabSpec("tag05"); spec5.SetContent(Resource.Id.btn); spec5.SetIndicator("Boton"); tabs.AddTab(spec5); Button btn1 = FindViewById <Button>(Resource.Id.btn); btn1.Click += delegate { var progressDialog = ProgressDialog.Show(this, "Corriendo", "Espera...", true); new Thread(new ThreadStart(delegate { Thread.Sleep(5000); RunOnUiThread(() => progressDialog.Hide()); })).Start(); new AlertDialog.Builder(this) .SetTitle("Alerta") .SetMessage("Presiona Ok para Continuar") .SetPositiveButton("Ok", delegate { Toast.MakeText(this, "Se presiono Aceptar", ToastLength.Short).Show(); }) .SetNegativeButton("Cancel", delegate { Toast.MakeText(this, "Se presiono Cancelar", ToastLength.Short).Show(); }).Show(); }; }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); Bundle Extras = Intent.Extras; byte[] BackgroundByteArray = Extras.GetByteArray("BackgroundByteArray"); TripInfo = Extras.GetStringArrayList("TripData").ToArray(); Me = new TripClient(Utilizator_Main.INPUT, Utilizator_Main.OUTPUT, new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Login.Username), this); TripId = new SaveUsingSharedPreferences(this).LoadString(SaveUsingSharedPreferences.Tags.Trip.TipId); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Utilizator_Trip); InitiateView(); CheckIfNewInTrip(); test = this; LocalActivityManager LAM = new LocalActivityManager(this, false); LAM.DispatchCreate(savedInstanceState); LAM.DispatchResume(); LAM.DispatchPause(IsFinishing); tabHost.Setup(LAM); int[] Layouturi = new int[] { Resource.Layout.Utilizator_Trip_ChatView, Resource.Layout.Utilizator_Trip_MaskB, Resource.Layout.Utilizator_Trip_MaskC, }; Background.Background = DrawableConverter.ByteArrayToDrawable(BackgroundByteArray, this); SetTypeface.Normal.SetTypeFace(this, UserNume); LeftDrawerListView.Adapter = new Utilizator_Trip_LeftDrawerAdapter(this, Background.Background, new string[] { "Galerie", "Modificare Cont", "As vrea sa cumpar", "Informatii excursie", "Setari", "Iesire Excursie", "Logut" }); // OrganizatorProfilePic.SetImageDrawable(RoundedUserProfile); // OrganizatorNume.Text = "Nume Prenume"; // SetTypeface.Normal.SetTypeFace (this,OrganizatorNume); Pager.Adapter = new Utilizator_Trip_ViewPagerAdapter(SupportFragmentManager, this); for (int i = 0; i < 3; i++) { CreateTab(typeof(Utilizator_Trip_MaskA), Tags[i], string.Empty, TabsIcon[i], tabHost); } tabHost.TabChanged += TabHost_TabChanged; Pager.PageSelected += Pager_PageSelected; ClientGetMessage += Utilizator_Trip_ClientGetMessage; }
private void InitTabMain() { TabHost tabHost = FindViewById <TabHost> (Resource.Id.tabHostMain); tabHost.Setup(); TabHost.TabSpec tabSpec; /* * tabSpec = tabHost.NewTabSpec ("tag0"); * View v0 = this.LayoutInflater.Inflate (Resource.Layout.TabHeader, null); * (v0.FindViewById(Resource.Id.tViewHeader) as TextView).Text = "В ефірі"; * v0.SetBackgroundResource (Resource.Drawable.tab_icon_selector); * tabSpec.SetIndicator (v0); * tabSpec.SetContent (Resource.Id.linearLayout8); * tabHost.AddTab (tabSpec);*/ tabSpec = tabHost.NewTabSpec("tag1"); View v1 = this.LayoutInflater.Inflate(Resource.Layout.TabHeader, null); (v1.FindViewById(Resource.Id.tViewHeader) as TextView).Text = "Останні"; v1.SetBackgroundResource(Resource.Drawable.tab_icon_selector); tabSpec.SetIndicator(v1); tabSpec.SetContent(Resource.Id.layoutHistoryPlay); tabHost.AddTab(tabSpec); tabSpec = tabHost.NewTabSpec("tag2"); View v2 = this.LayoutInflater.Inflate(Resource.Layout.TabHeader, null); (v2.FindViewById(Resource.Id.tViewHeader) as TextView).Text = "Топ 10"; v2.SetBackgroundResource(Resource.Drawable.tab_icon_selector); tabSpec.SetIndicator(v2); tabSpec.SetContent(Resource.Id.layoutTopTen); tabHost.AddTab(tabSpec); /* * tabSpec = tabHost.NewTabSpec ("tag3"); * View v3 = this.LayoutInflater.Inflate (Resource.Layout.TabHeader, null); * (v3.FindViewById(Resource.Id.tViewHeader) as TextView).Text = "Нові пісні"; * v3.SetBackgroundResource (Resource.Drawable.tab_icon_selector); * tabSpec.SetIndicator (v3); * tabSpec.SetContent (Resource.Id.linearLayout8); * tabHost.AddTab (tabSpec); * * tabSpec = tabHost.NewTabSpec ("tag4"); * View v4 = this.LayoutInflater.Inflate (Resource.Layout.TabHeader, null); * (v4.FindViewById(Resource.Id.tViewHeader) as TextView).Text = "Подкасти"; * v4.SetBackgroundResource (Resource.Drawable.tab_icon_selector); * tabSpec.SetIndicator (v4); * tabSpec.SetContent (Resource.Id.linearLayout8); * tabHost.AddTab (tabSpec);*/ tabHost.SetCurrentTabByTag("tag1"); }
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); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_starred); ActivityHelper.SetupActionBar(new Java.Lang.String(Title), new Color(0)); mTabHost = FindViewById <TabHost> (Android.Resource.Id.TabHost); mTabWidget = FindViewById <TabWidget> (Android.Resource.Id.Tabs); mTabHost.Setup(); SetupSessionsTab(); SetupVendorsTab(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); TabHost tabHost = FindViewById(Resource.Id.tabhost_sample) as TabHost; tabHost.Setup(); TabHost.TabSpec tabSpec1 = tabHost.NewTabSpec("SampleTab1"); tabSpec1.SetContent(Resource.Id.tab_sampletab1); tabSpec1.SetIndicator("SampleTab1"); TabHost.TabSpec tabSpec2 = tabHost.NewTabSpec("SampleTab2"); tabSpec2.SetContent(Resource.Id.tab_sampletab2); tabSpec2.SetIndicator("SampleTab2"); tabHost.AddTab(tabSpec1); tabHost.AddTab(tabSpec2); }
private TabHostItemsSourceGenerator([NotNull] TabHost tabHost) { Should.NotBeNull(tabHost, "tabHost"); _tabHost = tabHost; _tabHost.Setup(); _tabToContent = new Dictionary <string, TabInfo>(); _tabFactory = new TabFactory(this); _itemTemplateProvider = new DataTemplateProvider(tabHost, AttachedMemberConstants.ItemTemplate, AttachedMemberConstants.ItemTemplateSelector); _contentTemplateProvider = new DataTemplateProvider(tabHost, AttachedMemberConstants.ContentTemplate, AttachedMemberConstants.ContentTemplateSelector); _selectedItemMember = BindingServiceProvider .MemberProvider .GetBindingMember(tabHost.GetType(), AttachedMemberConstants.SelectedItem, false, false); TryListenActivity(tabHost.Context); _tabHost.TabChanged += TabHostOnTabChanged; }
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; } }
private void makeTabs() { TabHost tabs = (TabHost)FindViewById(Resource.Id.tabhost); tabs.Setup(); TabHost.TabSpec spec = tabs.NewTabSpec("tag1"); spec.SetContent(Resource.Id.tab1); spec.SetIndicator("Tasks"); tabs.AddTab(spec); spec = tabs.NewTabSpec("tag2"); spec.SetContent(Resource.Id.tab2); spec.SetIndicator("Address"); tabs.AddTab(spec); spec = tabs.NewTabSpec("tag3"); spec.SetContent(Resource.Id.tab3); spec.SetIndicator("Map"); tabs.AddTab(spec); }
private void LoadTabs() { tabHost.Setup(mlam); TabHost.TabSpec spec; Intent intent; String vlera = Convert.ToString(companyId); intent = new Intent(this, typeof(Tab1Activity)); intent.PutExtra("UserId", userId); intent.PutExtra("CompanyId", vlera); spec = tabHost.NewTabSpec("Sot").SetIndicator("Sot").SetContent(intent); tabHost.AddTab(spec); intent = new Intent(this, typeof(Tab2Activity)); intent.PutExtra("UserId", userId); intent.PutExtra("CompanyId", vlera); spec = tabHost.NewTabSpec("Të kaluarat").SetIndicator("Të kaluarat").SetContent(intent); tabHost.AddTab(spec); }
public void InitTab() { host.Setup(); TabHost.TabSpec spec = host.NewTabSpec("Jobs"); spec.SetContent(Resource.Id.TabOne); spec.SetIndicator("Jobs"); host.AddTab(spec); spec = host.NewTabSpec("History"); spec.SetContent(Resource.Id.TabTwo); spec.SetIndicator("History"); host.AddTab(spec); spec = host.NewTabSpec("Settings"); spec.SetContent(Resource.Id.TabThree); spec.SetIndicator("Settings"); host.AddTab(spec); }
protected override void OnCreate(Bundle savedInstanceState) { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.TabbedPage); localActivityManager = new LocalActivityManager(this, false); localActivityManager.DispatchCreate(savedInstanceState); TabHost tabHost = FindViewById <TabHost>(Resource.Id.tabsHost); // create the TabHost that will contain the Tabs tabHost.Setup(localActivityManager); CreateTab(typeof(CocktailListview), "COCKTAIL", "COCKTAIL", tabHost); CreateTab(typeof(EditPage), "", "", tabHost); }
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 bundle) { base.OnCreate(bundle); Intent intent = Intent; mQuery = intent.GetStringExtra(SearchManager.Query); SetContentView(Resource.Layout.activity_search); ActivityHelper.SetupActionBar(new Java.Lang.String(Title), new Color(0)); var title = GetString(Resource.String.title_search_query, mQuery); ActivityHelper.SetActionBarTitle(new Java.Lang.String(title)); mTabHost = FindViewById <TabHost> (Android.Resource.Id.TabHost); mTabWidget = FindViewById <TabWidget> (Android.Resource.Id.Tabs); mTabHost.Setup(); SetupSessionsTab(); SetupVendorsTab(); }
private void init_BuySellTabs() { TabHost tabHost = (TabHost)FindViewById(Resource.Id.BuySellTabHost); // инициализация tabHost.Setup(); TabHost.TabSpec tabSpec; //tabHost.SetBackgroundColor(new Color(240, 221, 52)); tabSpec = tabHost.NewTabSpec(Resources.GetString(Resource.String.BuySellTab1)); tabSpec.SetIndicator(Resources.GetString(Resource.String.BuySellTab1)); tabSpec.SetContent(Resource.Id.BuySellTab1); tabHost.AddTab(tabSpec); tabSpec = tabHost.NewTabSpec(Resources.GetString(Resource.String.BuySellTab2)); tabSpec.SetIndicator(Resources.GetString(Resource.String.BuySellTab2)); tabSpec.SetContent(Resource.Id.BuySellTab2); tabHost.AddTab(tabSpec); //tabHost.TabWidget.SetBackgroundDrawable(GetDrawable(Resource.Drawable.TabSelector)); tabHost.TabWidget.StripEnabled = false; for (int i = 0; i < tabHost.TabWidget.ChildCount; i++) { View v = tabHost.TabWidget.GetChildAt(i); v.SetBackgroundResource(Resource.Drawable.TabSelector); RelativeLayout rl = (RelativeLayout)tabHost.TabWidget.GetChildAt(i); rl.SetGravity(GravityFlags.CenterVertical); TextView textView = (TextView)rl.GetChildAt(1); textView.SetTextColor(Resources.GetColorStateList(Resource.Drawable.TabTextColorLogic)); textView.SetMaxHeight(100); var xyi = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); textView.LayoutParameters = xyi; textView.SetTypeface(null, TypefaceStyle.Bold); textView.Gravity = GravityFlags.Center; textView.SetTextSize(Android.Util.ComplexUnitType.Dip, 20); //tabHost.TabWidget.GetChildAt(i).LayoutParameters.Height = 120; } }
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); }
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); viewPager.OffscreenPageLimit = 5; tabsAdapter = new TabsAdapter(this, tabHost, viewPager); tabsAdapter.AddTab(tabHost.NewTabSpec("Goal").SetIndicator(string.Empty, Resources.GetDrawable(Resource.Drawable.target)), Java.Lang.Class.FromType(typeof(GoalFragment)), null); tabsAdapter.AddTab(tabHost.NewTabSpec("Activities").SetIndicator(string.Empty, Resources.GetDrawable(Resource.Drawable.activities)), Java.Lang.Class.FromType(typeof(ActivitiesFragment)), null); tabsAdapter.AddTab(tabHost.NewTabSpec("Contacts").SetIndicator(string.Empty, Resources.GetDrawable(Resource.Drawable.contacts)), Java.Lang.Class.FromType(typeof(ContactsFragment)), null); tabsAdapter.AddTab(tabHost.NewTabSpec("Report").SetIndicator(string.Empty, Resources.GetDrawable(Resource.Drawable.report)), Java.Lang.Class.FromType(typeof(ReportsFragment)), null); if (savedInstanceState != null) { tabHost.SetCurrentTabByTag(savedInstanceState.GetString(tabKeyString)); } }
private void InitializeTabs() { tabHost = this.mActivity.FindViewById <TabHost>(Resource.Id.tabHost); tabHost.Setup(); View tabIndicator = this.mActivity.LayoutInflater.Inflate(Resource.Layout.tab_indicator, tabHost.TabWidget, false); (tabIndicator.FindViewById <TextView>(Android.Resource.Id.Title)).Text = "Network Devices"; (tabIndicator.FindViewById <ImageView>(Android.Resource.Id.Icon)).SetImageResource(Resource.Mipmap.baseline_router_black_48); View tabIndicator2 = this.mActivity.LayoutInflater.Inflate(Resource.Layout.tab_indicator, tabHost.TabWidget, false); (tabIndicator2.FindViewById <TextView>(Android.Resource.Id.Title)).Text = "RTSP Servers"; (tabIndicator2.FindViewById <ImageView>(Android.Resource.Id.Icon)).SetImageResource(Resource.Mipmap.baseline_playlist_play_black_48); spec1 = tabHost.NewTabSpec("Tab1"); spec1.SetContent(Resource.Id.tab1); spec1.SetIndicator(tabIndicator); spec2 = tabHost.NewTabSpec("Tab2"); spec2.SetIndicator(tabIndicator2); spec2.SetContent(Resource.Id.tab2); tabHost.AddTab(spec1); tabHost.AddTab(spec2); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); historyViewModel = ServiceContainer.Resolve <HistoryViewModel> (); menuViewModel = ServiceContainer.Resolve <MenuViewModel> (); var view = inflater.Inflate(Resource.Layout.HistoryFragmentLayout, null, true); searchText = view.FindViewById <EditText> (Resource.Id.historySearchText); searchText.TextChanged += (sender, e) => { if (historySearchAdapter != null) { historySearchAdapter.FilterItems(searchText.Text); historySearchAdapter.NotifyDataSetChanged(); } }; var clearSearch = view.FindViewById <ImageButton> (Resource.Id.historyClearSearch); clearSearch.Click += (sender, e) => searchText.Text = string.Empty; tabHost = view.FindViewById <TabHost> (Resource.Id.historyTabHost); historyListView = view.FindViewById <ListView> (Resource.Id.historyListView); localManger = new LocalActivityManager(Activity, true); localManger.DispatchCreate(savedInstanceState); tabHost.Setup(localManger); var dateIndicator = CreateTab("DATE"); TabHost.TabSpec dateTab = tabHost.NewTabSpec("Date"); dateTab.SetIndicator(dateIndicator); dateTab.SetContent(new TabContent(new TextView(tabHost.Context))); var callsIndicator = CreateTab("CALLS"); TabHost.TabSpec callsTab = tabHost.NewTabSpec("Calls"); callsTab.SetIndicator(callsIndicator); callsTab.SetContent(new TabContent(new TextView(tabHost.Context))); var assignmentIndicator = CreateTab("ASSIGNMENTS"); TabHost.TabSpec assignments = tabHost.NewTabSpec("Assignments"); assignments.SetIndicator(assignmentIndicator); assignments.SetContent(new TabContent(new TextView(tabHost.Context))); tabHost.AddTab(dateTab); tabHost.AddTab(callsTab); tabHost.AddTab(assignments); tabHost.TabChanged += (sender, e) => { if (History != null) { switch (tabHost.CurrentTab) { case 0: historySearchAdapter = new HistoryListAdapter(Activity, Resource.Layout.HistoryItemLayout, History.OrderBy(h => h.Date).ToList()); break; case 1: historySearchAdapter = new HistoryListAdapter(Activity, Resource.Layout.HistoryItemLayout, History.Where(h => h.Type == AssignmentHistoryType.PhoneCall).ToList()); break; default: historySearchAdapter = new HistoryListAdapter(Activity, Resource.Layout.HistoryItemLayout, History.Where(h => h.Type == AssignmentHistoryType.Assignment).ToList()); break; } historySearchAdapter.Assignment = Assignment; historyListView.Adapter = historySearchAdapter; } }; if (History != null) { historySearchAdapter = new HistoryListAdapter(Activity, Resource.Layout.HistoryItemLayout, History.OrderBy(a => a.Date).ToList()); historySearchAdapter.Assignment = Assignment; historyListView.Adapter = historySearchAdapter; } historyListView.ItemClick += (sender, e) => { var intent = new Intent(Activity, typeof(SummaryHistoryActivity)); historyViewModel.SelectedAssignmentHistory = History.ElementAtOrDefault(e.Position); menuViewModel.MenuIndex = 0; StartActivity(intent); }; return(view); }