/** * Build and add "sessions" tab. */ private void SetupSessionsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.Id = Resource.Id.fragment_sessions; fragmentContainer.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent); FindViewById <ViewGroup> (Android.Resource.Id.TabContent).AddView(fragmentContainer); Intent intent = new Intent(Intent.ActionView, ScheduleContract.Sessions.CONTENT_STARRED_URI); var fm = SupportFragmentManager; mSessionsFragment = (SessionsFragment)fm.FindFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new SessionsFragment(); mSessionsFragment.Arguments = IntentToFragmentArguments(intent); fm.BeginTransaction() .Add(Resource.Id.fragment_sessions, mSessionsFragment, "sessions") .Commit(); } // Sessions content comes from reused activity mTabHost.AddTab(mTabHost.NewTabSpec(TAG_SESSIONS) .SetIndicator(BuildIndicator(Resource.String.starred_sessions)) .SetContent(Resource.Id.fragment_sessions)); }
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); }
public void InitializeTab() { TabHost.TabSpec spec1 = tabHost.NewTabSpec("Info"); spec1.SetContent(Resource.Id.realtabcontent); spec1.SetIndicator(this.Activity.LayoutInflater.Inflate(Resource.Layout.invoice_tab_button_header, null)); tabHost.AddTab(spec1); TabHost.TabSpec spec2 = tabHost.NewTabSpec("Details"); spec2.SetContent(Resource.Id.tab2); spec2.SetIndicator(this.Activity.LayoutInflater.Inflate(Resource.Layout.invoice_tab_button_details, null)); tabHost.AddTab(spec2); for (int i = 0; i < tabHost.TabWidget.ChildCount; i++) { View tab = tabHost.TabWidget.GetChildAt(i); tab.SetBackgroundResource(Resource.Drawable.main_button_selector); tab.SetMinimumHeight(18); } var ft = FragmentManager.BeginTransaction(); ft.Replace(Resource.Id.realtabcontent, invoiceTabHeader); ft.SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentFade); ft.Commit(); var ft1 = FragmentManager.BeginTransaction(); ft1.Replace(Resource.Id.tab2, invoiceTabDetails); ft1.SetTransition(Android.Support.V4.App.FragmentTransaction.TransitFragmentFade); ft1.Commit(); }
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); }
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 Add(int insertionIndex, int count) { var manager = GetCollectionViewManager(); if (manager == null) { if (insertionIndex == TabHost.TabWidget.TabCount) { for (int i = 0; i < count; i++) { TabHost.AddTab(CreateTabSpec(insertionIndex + i)); } } else { Refresh(); } } else { for (int i = 0; i < count; i++) { int index = insertionIndex + i; manager.Insert(TabHost, index, CreateTabSpec(index)); } } }
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(); }; }
private void InitaliseTabs() { Resources res = this.ApplicationContext.Resources; TabHost tabHost = this.TabHost; tabHost.AddTab(tabHost.NewTabSpec("tabRoomSourceList").SetIndicator(res.GetString(Resource.String.roomlist)).SetContent(new Intent(this, typeof(RoomSourceListActivity)))); tabHost.AddTab(tabHost.NewTabSpec("tabLibraryList").SetIndicator(res.GetString(Resource.String.mediaserverlist)).SetContent(new Intent(this, typeof(LibraryListActivity)))); tabHost.CurrentTab = 0; }
private void SetupIntent() { this.mTabHost = this.TabHost; TabHost localTabHost = this.mTabHost; localTabHost.AddTab(BuildTabSpec("A_TAB", Resource.String.main_home, Resource.Drawable.icon_1_n, this.mAIntent)); localTabHost.AddTab(BuildTabSpec("B_TAB", Resource.String.main_news, Resource.Drawable.icon_2_n, this.mBIntent)); localTabHost.AddTab(BuildTabSpec("C_TAB", Resource.String.main_manage_date, Resource.Drawable.icon_3_n, this.mCIntent)); }
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"); }
protected override void Add(int insertionIndex, int count) { if (insertionIndex == _tabHost.TabWidget.TabCount) { for (int i = 0; i < count; i++) { _tabHost.AddTab(CreateTabSpec(insertionIndex + i)); } } else { Refresh(); } }
protected override void OnViewModelSet() { SetContentView(Resource.Layout.Page_Home); TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Initialize a TabSpec for each tab and add it to the TabHost spec = TabHost.NewTabSpec("welcome"); spec.SetIndicator(this.GetText("Welcome"), Resources.GetDrawable(Resource.Drawable.Tab_Welcome)); spec.SetContent(CreateIntentFor(ViewModel.Welcome)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("sessions"); spec.SetIndicator(this.GetText("Sessions"), Resources.GetDrawable(Resource.Drawable.Tab_Sessions)); spec.SetContent(CreateIntentFor(ViewModel.Sessions)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("favorites"); spec.SetIndicator(this.GetText("Favorites"), Resources.GetDrawable(Resource.Drawable.Tab_Favorites)); spec.SetContent(CreateIntentFor(ViewModel.Favorites)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("tweets"); spec.SetIndicator(this.GetText("Tweets"), Resources.GetDrawable(Resource.Drawable.Tab_Tweets)); spec.SetContent(CreateIntentFor(ViewModel.Twitter)); TabHost.AddTab(spec); //TabHost.TabChanged += (s, e) => UpdateTabColors(); //UpdateTabColors(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.JourneyExerciseView); // Create your application here TabHost.TabSpec spec; TabHost.SetBackgroundColor(Color.ParseColor("#FFFFFF")); TabHost.TabWidget.SetBackgroundColor(Color.ParseColor("#EF678D")); spec = TabHost.NewTabSpec("Running"); spec.SetIndicator("Running"); spec.SetContent(this.CreateIntentFor(JourneyExerciseViewModel.Running)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Workout"); spec.SetIndicator("Workout"); spec.SetContent(this.CreateIntentFor(JourneyExerciseViewModel.Workout)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Yoga"); spec.SetIndicator("Yoga"); spec.SetContent(this.CreateIntentFor(JourneyExerciseViewModel.Yoga)); TabHost.AddTab(spec); }
protected override void OnViewModelSet() { SetContentView(Resource.Layout.Home_Page_HomeView); TabHost.TabSpec spec; spec = TabHost.NewTabSpec("Overview"); spec.SetIndicator("Overview"); spec.SetContent(CreateIntentFor(ViewModel.Overview)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Topics"); spec.SetIndicator("Topics"); spec.SetContent(CreateIntentFor(ViewModel.Topics)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Tweets"); spec.SetIndicator("Tweets"); spec.SetContent(CreateIntentFor(ViewModel.Tweets)); TabHost.AddTab(spec); //spec = TabHost.NewTabSpec("Upcoming Sessions"); //spec.SetIndicator("Upcoming Sessions"); //spec.SetContent(CreateIntentFor(ViewModel.UpcomingSessions)); //TabHost.AddTab(spec); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.TimeTable); TimeColumns = new List <TextView>(16); foreach (string day in new string[] { "Today", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }) { TabHost.AddTab(NewTab(day)); } //magical tab jumping to actually create the content in the tabs #lolandroid TabHost.CurrentTab = 0; TabHost.CurrentTab = 1; TabHost.CurrentTab = 2; TabHost.CurrentTab = 3; TabHost.CurrentTab = 4; TabHost.CurrentTab = 5; TabHost.CurrentTab = 6; TabHost.CurrentTab = 7; TabHost.CurrentTab = 8; TabHost.CurrentTab = 0; loadingBar = FindViewById <ProgressBar>(Resource.Id.progressBar1); loadingBar.Indeterminate = true; TodayDepartStringEventFirer = DataGetter.StringEventHandler; if (DataGetter.StringEventHandler != null) { DataGetter.StringEventHandler.Changed += new StringEventFirer.ChangedEventHandler(TimetableStringChanged); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create your application here //Used Slodge's Code, n=25 Tabbed, from https://github.com/MvvmCross/NPlus1DaysOfMvvmCross/tree/master/N-25-Tabbed, retrieved in 21/9/16 TabHost.TabSpec spec; TabHost.SetBackgroundColor(Color.ParseColor("#FFFFFF")); TabHost.TabWidget.SetBackgroundColor(Color.ParseColor("#EF678D")); spec = TabHost.NewTabSpec("Journey"); spec.SetIndicator("Journey"); spec.SetContent(this.CreateIntentFor(HomeViewModel.Journey)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Goal"); spec.SetIndicator("Goal"); spec.SetContent(this.CreateIntentFor(HomeViewModel.Goal)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Statistic"); spec.SetIndicator("Stats"); spec.SetContent(this.CreateIntentFor(HomeViewModel.Statistic)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("Social"); spec.SetIndicator("Social"); spec.SetContent(this.CreateIntentFor(HomeViewModel.Community)); TabHost.AddTab(spec); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Create an Intent to launch an Activity for the tab (to be reused) //var intent = new Intent(this, typeof(MyActivityGroup)); var intent = new Intent(this, typeof(MonthActivity)); intent.AddFlags(ActivityFlags.ClearTop); var spec = TabHost.NewTabSpec("Maand"); spec.SetIndicator("Maand", null); spec.SetContent(intent); TabHost.AddTab(spec); intent = new Intent(this, typeof(DagActivity)); intent.AddFlags(ActivityFlags.ClearTop); spec = TabHost.NewTabSpec("Dag"); spec.SetIndicator("Dag", null); spec.SetContent(intent); TabHost.AddTab(spec); TabHost.CurrentTab = 0; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); TabHost.TabSpec spec; Intent intent; intent = new Intent(this, typeof(Activity1)); intent.AddFlags(ActivityFlags.NewTask); intent = new Intent(this, typeof(Activity2)); intent.AddFlags(ActivityFlags.NewTask); spec = TabHost.NewTabSpec("tab1"); spec.SetIndicator("Tab 1", Resources.GetDrawable(Resource.Drawable.ic_tab)); spec.SetContent(intent); TabHost.AddTab(spec); intent = new Intent(this, typeof(Activity3)); intent.AddFlags(ActivityFlags.NewTask); spec = TabHost.NewTabSpec("tab2"); spec.SetIndicator("Tab 2", Resources.GetDrawable(Resource.Drawable.ic_tab)); spec.SetContent(intent); TabHost.AddTab(spec); TabHost.CurrentTab = 0; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.FirstView); // Make sure the device support for google play services GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); // Register the app for push notifications. GcmClient.Register(this, Receiver.senderIDs); TabHost.TabSpec spec; spec = TabHost.NewTabSpec("search"); spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.indicator_search)); spec.SetContent(this.CreateIntentFor(FirstViewModel.Search)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("recent"); spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.indicator_history)); spec.SetContent(this.CreateIntentFor(FirstViewModel.Recent)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("favourite"); spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.indicator_favorite)); spec.SetContent(this.CreateIntentFor(FirstViewModel.Favourite)); TabHost.AddTab(spec); }
/// <summary> /// Activitie's create event handeler. /// </summary> protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Create managers and register references MgrAccessor.RegisterReference <IFileEntryManager>(new FileEntryManager()); MgrAccessor.RegisterReference <ICommonUtils>(new CommonUtils()); MgrAccessor.RegisterReference <IDiskUtils>(new DiskUtils()); #if DEBUG // Create test data MgrAccessor.DiskUtils.CreateTestData(); #endif SetContentView(Resource.Layout.Home); // Create FileEntryList tab var intent = new Intent(this, typeof(FileEntryListActivity)); intent.AddFlags(ActivityFlags.NewTask); var spec = TabHost.NewTabSpec("Explorer"); spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.ic_tab_explorer)); spec.SetContent(intent); TabHost.AddTab(spec); // Create About tab intent = new Intent(this, typeof(AboutActivity)); intent.AddFlags(ActivityFlags.NewTask); spec = TabHost.NewTabSpec("About"); spec.SetIndicator("", Resources.GetDrawable(Resource.Drawable.ic_tab_about)); spec.SetContent(intent); TabHost.AddTab(spec); TabHost.CurrentTab = 0; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab intent = new Intent(this, typeof(LunchDayActivity)); intent.AddFlags(ActivityFlags.NewTask); // Initialize a TabSpec for each tab and add it to the TabHost spec = TabHost.NewTabSpec("lunchtable"); spec.SetIndicator(Resources.GetString(Resource.String.lunchtable), Resources.GetDrawable(Resource.Drawable.menu)); spec.SetContent(intent); TabHost.AddTab(spec); intent = new Intent(this, typeof(TimetableActivity)); intent.AddFlags(ActivityFlags.NewTask); spec = TabHost.NewTabSpec("timetables"); spec.SetIndicator(Resources.GetString(Resource.String.timetable), Resources.GetDrawable(Resource.Drawable.timetable)); spec.SetContent(intent); TabHost.AddTab(spec); intent = new Intent(this, typeof(ShowSettings)); intent.AddFlags(ActivityFlags.NewTask); spec = TabHost.NewTabSpec("settings"); spec.SetIndicator(Resources.GetString(Resource.String.settings), Resources.GetDrawable(Resource.Drawable.settings)); spec.SetContent(intent); TabHost.AddTab(spec); TabHost.CurrentTab = 0; }
protected override void OnViewModelSet() { SetContentView(Resource.Layout.Page_SpheroView); TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Initialize a TabSpec for each tab and add it to the TabHost spec = TabHost.NewTabSpec("move"); spec.SetIndicator("Move", Resources.GetDrawable(Resource.Drawable.Tab_Move)); spec.SetContent(CreateIntentFor(ViewModel.Movement)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("turn"); spec.SetIndicator("Turn", Resources.GetDrawable(Resource.Drawable.Tab_Turn)); spec.SetContent(CreateIntentFor(ViewModel.Heading)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("color"); spec.SetIndicator("Color", Resources.GetDrawable(Resource.Drawable.Tab_Color)); spec.SetContent(CreateIntentFor(ViewModel.Color)); TabHost.AddTab(spec); spec = TabHost.NewTabSpec("accel"); spec.SetIndicator("Tilt", Resources.GetDrawable(Resource.Drawable.Tab_MoveAccel)); spec.SetContent(CreateIntentFor(ViewModel.AccelMovement)); TabHost.AddTab(spec); TabHost.TabChanged += (sender, args) => { var isAccelTab = (args.TabId == "accel"); ViewModel.AccelMovement.EnsureAccelerometerIsOnCommand.Execute(isAccelTab); }; }
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 void InitializeUI() { if (DeviceDisplay.MainDisplayInfo.Orientation == DisplayOrientation.Portrait) { SetContentView(Resource.Layout.DownloadActivityPortrait); _countryAdapter = new DownloadCountryAdapter(this, false); _downloadCountrySpinner = FindViewById <Spinner>(Resource.Id.DownloadCountrySpinner); _downloadCountrySpinner.Adapter = _countryAdapter; _downloadCountrySpinner.ItemSelected += OnCountrySpinnerItemSelected; } else { SetContentView(Resource.Layout.DownloadActivityLandscape); _countryAdapter = new DownloadCountryAdapter(this, true); _downloadCountryListView = FindViewById <ListView>(Resource.Id.DownloadCountryListView); _downloadCountryListView.Adapter = _countryAdapter; _downloadCountryListView.ItemClick += OnCountryListItemClicked; } var page1 = TabHost.NewTabSpec("tab_test1"); page1.SetIndicator(Resources.GetText(Resource.String.Common_POIs)); page1.SetContent(Resource.Id.downloadTabPois); TabHost.AddTab(page1); var page2 = TabHost.NewTabSpec("tab_test2"); page2.SetIndicator(Resources.GetText(Resource.String.Common_ElevationData)); page2.SetContent(Resource.Id.downloadTabEleData); TabHost.AddTab(page2); TabHost.CurrentTab = 0; var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.SetDisplayShowHomeEnabled(true); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetTitle(Resource.String.DownloadActivity); _downloadItemListView = FindViewById <ListView>(Resource.Id.DownloadItemListView); _downloadItemAdapter = new DownloadItemAdapter(this, this); _downloadItemListView.Adapter = _downloadItemAdapter; _downloadedElevationDataListView = FindViewById <ListView>(Resource.Id.listViewDownloadedElevationData); _downloadedElevationDataAdapter = new DownloadedElevationDataAdapter(this, this); _downloadedElevationDataListView.Adapter = _downloadedElevationDataAdapter; var _downloadedElevationDataAddButton = FindViewById <Button>(Resource.Id.buttonAddNew); _downloadedElevationDataAddButton.SetOnClickListener(this); }
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); }
public void AddTab(TabHost.TabSpec tabSpec, Class clss, Bundle args) { tabSpec.SetContent(new DummyTabFactory(_context)); var tag = tabSpec.Tag; var info = new TabInfo(tag, clss, args); _tabs.Add(info); _tabHost.AddTab(tabSpec); NotifyDataSetChanged(); }
void AddTabSimplest() { Intent intentSimplest = new Intent().SetClass(this, typeof(SimplestActivity)); Android.Widget.TabHost.TabSpec tabSpecSimplest = TabHost.NewTabSpec("Simplest") .SetIndicator("Simplest", null) .SetContent(intentSimplest); TabHost.AddTab(tabSpecSimplest); }
void AddTabNormal() { Intent intentNormal = new Intent().SetClass(this, typeof(NormalActivity)); Android.Widget.TabHost.TabSpec tabSpecNormal = TabHost.NewTabSpec("Normal") .SetIndicator("Normal", null) .SetContent(intentNormal); TabHost.AddTab(tabSpecNormal); }