protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; SetContentView(Resource.Layout.AddView); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Wydatek"); tab.TabSelected += (object sender, ActionBar.TabEventArgs e) => { e.FragmentTransaction.Replace(Resource.Id.addHost, new AddExpenseFragment()); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Przychód"); tab.TabSelected += (object sender, ActionBar.TabEventArgs e) => { e.FragmentTransaction.Replace(Resource.Id.addHost, new AddIncomeFragment()); }; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button btnpopupmenu = FindViewById <Button>(Resource.Id.btnpopupmenu); btnpopupmenu.Click += (s, arg) => { PopupMenu menu = new PopupMenu(this, btnpopupmenu); menu.Inflate(Resource.Menu.popup_menu); menu.Show(); }; ActionBar.Tab tab = ActionBar.NewTab(); //tab.SetText(Resources.GetString(Resource.String.tab1_text)); //tab.SetIcon(Resource.Drawable.tab1_icon); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); //tab.SetText(Resources.GetString(Resource.String.tab2_text)); //tab.SetIcon(Resource.Drawable.tab2_icon); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); }
void AddTabToActionBar(string label) { ActionBar.Tab tab = SupportActionBar.NewTab() .SetText(label) .SetTabListener(this); SupportActionBar.AddTab(tab); }
private void AddTab(string tabTexto) { ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(tabTexto); tab.TabSelected += OnTabSelected; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); activity = this; /*Creation of tabs.*/ ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); //Tab for list of parameters. tab.SetText(Resource.String.tab_List); tab.TabSelected += Tab_TabSelectedList; ActionBar.AddTab(tab); //Tab for weight plot. tab = ActionBar.NewTab(); tab.SetText(Resource.String.tab_GraphWeight); tab.TabSelected += Tab_TabSelectedWeight; ActionBar.AddTab(tab); //Tab for height plot. tab = ActionBar.NewTab(); tab.SetText(Resource.String.tab_GraphHeight); tab.TabSelected += Tab_TabSelectedHeight; ActionBar.AddTab(tab); //Going to selected tab. SetContentView(Resource.Layout.helpform_ParametersConnector); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { Log.Debug(Tag, "The tab {0} has been selected.", tab.Text); Fragment frag = _fragments[tab.Position]; ft.Replace(Resource.Id.frameLayout1, frag); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { if (_pager != null) { _pager.CurrentItem = tab.Position; } }
private void SetUpApp() { //below creates the tabs for the homepage and sets them up to do something when they switch ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Happy"); tab.TabSelected += (sender, args) => { // Do something when tab is selected selectedTab = 0; SwitchTabs(selectedTab); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Inspiration"); tab.TabSelected += (sender, args) => { // Do something when tab is selected selectedTab = 1; SwitchTabs(selectedTab); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Motivation"); tab.TabSelected += (sender, args) => { // Do something when tab is selected selectedTab = 2; SwitchTabs(selectedTab); }; ActionBar.AddTab(tab); }
public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { if (this.fragment != null) { ft.Detach(this.fragment); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Stolen Bike Brands"); tab.SetIcon(Resource.Drawable.Icon); tab.TabSelected += (sender, args) => { listofpieChart data = new listofpieChart(); List <string> test = data.listofpieChart1(); ListAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, test); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Favorite Stolen Bike Colors"); tab.SetIcon(Resource.Drawable.Icon); tab.TabSelected += (sender, args) => { listofpieChartColor data2 = new listofpieChartColor(); List <string> test2 = data2.listofpieChart1(); ListAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, test2); }; ActionBar.AddTab(tab); }
//protected override void OnElementChanged(VisualElement oldModel, VisualElement newModel) //protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e) protected override void OnDraw(Canvas canvas) { _activity = this.Context as Activity; ActionBar actionBar = _activity.ActionBar; if (actionBar.TabCount > 0) { ActionBar.Tab tabPrompting = actionBar.GetTabAt(0); ActionBar.Tab tabActivities = actionBar.GetTabAt(1); ActionBar.Tab tabReminders = actionBar.GetTabAt(2); ActionBar.Tab tabMapping = actionBar.GetTabAt(3); ActionBar.Tab tabSettings = actionBar.GetTabAt(4); //Set the tab icons tabPrompting.SetIcon(Resource.Drawable.ic_description_white_24dp); tabActivities.SetIcon(Resource.Drawable.ic_local_activity_white_24dp); tabReminders.SetIcon(Resource.Drawable.ic_schedule_white_24dp); tabMapping.SetIcon(Resource.Drawable.ic_map_white_24dp); tabSettings.SetIcon(Resource.Drawable.ic_settings_white_24dp); //Remove the page's title from the tab tabPrompting.SetText(""); tabActivities.SetText(""); tabReminders.SetText(""); tabMapping.SetText(""); tabSettings.SetText(""); base.OnDraw(canvas); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.MainView); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; // One-time initialization of application and helpers. // This can be done in the startup view, or in the android application object, or in the application loading screen. EnsureApplication(); AndroidHelpers.Initialize(typeof(Resource)); CloudAuctionApplication.Instance.ContinueToMain(skipNavigation: true); // Ensure that our viewmodel is initialized, in case we navigated to this view by some other means // than through a call to CloudAuctionApplication.Instance.ContinueToMain(). // E.g. when the OS creates this view at application startup, because it is marked as MainLauncher. ActionBar.Tab[] tabs = new ActionBar.Tab[] { ActionBar.NewTab().SetText("Auction").SetTag(new AuctionView()), ActionBar.NewTab().SetText("Products").SetTag(new ProductsView()), ActionBar.NewTab().SetText("Help").SetTag(new Fragment()) }; foreach (var tab in tabs) { tab.TabSelected += Tab_TabSelected; } Initialize(FindViewById(Resource.Id.MainView), CloudAuctionApplication.Instance.MainViewModel); // This call initializes data binding and updates the view with the current viewmodel values. for (int position = 0; position < tabs.Length; position++) { ActionBar.AddTab(tabs[position], setSelected: (MainViewModel.SubView)position == CurrentSubView); } }
void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs) { this.tab = sender as ActionBar.Tab; Fragment frag = _fragments[tab.Position]; tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag); }
private ActionBar.Tab CreateTabInternal(ActionBar bar, object context, bool useContext) { ActionBar.Tab newTab = bar.NewTab(); BindingExtensions.AttachedParentMember.SetValue(newTab, bar); var setter = new XmlPropertySetter <ActionBarTabTemplate, ActionBar.Tab>(newTab, bar.ThemedContext, new BindingSet()); if (useContext) { BindingServiceProvider.ContextManager.GetBindingContext(newTab).Value = context; } else { setter.SetProperty(template => template.DataContext, DataContext); } setter.SetBinding(template => template.ContentTemplateSelector, ContentTemplateSelector, false); setter.SetProperty(template => template.ContentTemplate, ContentTemplate); setter.SetProperty(template => template.Content, Content); setter.SetStringProperty(template => template.ContentDescription, ContentDescription); setter.SetProperty(template => template.CustomView, CustomView); setter.SetProperty(template => template.Icon, Icon); setter.SetProperty(template => template.Text, Text); setter.SetProperty(template => template.Tag, Tag); setter.Apply(); var tabListener = new TabListener(new DataTemplateProvider(bar, AttachedMemberConstants.ContentTemplate, AttachedMemberConstants.ContentTemplateSelector)); ServiceProvider.AttachedValueProvider.SetValue(newTab, ListenerKey, tabListener); newTab.SetTabListener(tabListener); return(newTab); }
void AddTabToActionBar(int labelResourceId) { ActionBar.Tab tab = ActionBar.NewTab().SetText(labelResourceId); tab.TabSelected += TabOnTabSelected; ActionBar.AddTab(tab); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { try { } catch (Exception ex) { LittleWatson.ReportException(ex); } }
void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs) { ActionBar.Tab tab = (ActionBar.Tab)sender; Fragment frag = _fragmentsArray[tab.Position]; tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag); }
private void TabSetup(ActionBar.Tab tab, int resourceID, bool isSelected) { ImageView iv = new ImageView(activity); iv.SetImageResource(resourceID); iv.SetPadding(0, 10, 0, 0); try { tab.TabSelected += Tab_TabSelected; } catch (System.Exception) { } tab.TabUnselected += Tab_TabUnselected; if (isSelected) { iv.SetColorFilter(selectionColor); } else { iv.SetColorFilter(unselectionColor); } tab.SetCustomView(iv); }
//private IList<RideModel> rides; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); IEnumerable <Account> accounts = AccountStore.Create(this).FindAccountsForService("google"); Account useraccount = accounts.FirstOrDefault(); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; SetContentView(Resource.Layout.Rides); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Rides"); tab.SetIcon(Resource.Drawable.bunchy); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Following"); tab.SetIcon(Resource.Drawable.bunchy); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); var ridesAdapter = new RidesAdapter(this, useraccount.Username); var ridesListView = FindViewById <ListView> (Resource.Id.rideListView); ridesListView.Adapter = ridesAdapter; ridesListView.ItemClick += OnRideItemClick; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_notification); SetTitle(Resource.String.title_lnotification_activity); // Use ViewPager in the support library where possible. // At this time, the support library for L is not ready so using the depreciated method // to create tabs. ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tabHeadsUpNotification = ActionBar.NewTab().SetText("Heads Up"); ActionBar.Tab tabVisibilityMetaData = ActionBar.NewTab().SetText("Visibility"); ActionBar.Tab tabOtherMetaData = ActionBar.NewTab().SetText("Others"); tabHeadsUpNotification.SetTabListener(new FragmentTabListener(HeadsUpNotificationFragment .NewInstance())); tabVisibilityMetaData.SetTabListener(new FragmentTabListener(VisibilityMetaDataFragment .NewInstance())); tabOtherMetaData.SetTabListener(new FragmentTabListener(OtherMetaDataFragment .NewInstance())); ActionBar.AddTab(tabHeadsUpNotification, 0); ActionBar.AddTab(tabVisibilityMetaData, 1); ActionBar.AddTab(tabOtherMetaData, 2); }
void AddTabToActionBar(string tabTitle) { ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(tabTitle); tab.TabSelected += TabOnTabSelected; //tab.SetIcon(Android.Resource.Drawable.IcInputAdd); ActionBar.AddTab(tab); }
void TabOnTabSelected(object sender, ActionBar.TabEventArgs args) { ActionBar.Tab tab = (ActionBar.Tab)sender; Log.Debug("[TABS]", "Tab selecionada: " + tab.Text + " | " + tab.Position); Fragment frag = fragments[tab.Position]; args.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { TitlesFragment titleFrag = (TitlesFragment)FragmentManager.FindFragmentById(Resource.Id.frag_title); titleFrag.PopulateTitles(tab.Position); titleFrag.SelectPosition(0); }
void AddTabToActionBar(int labelResourceId, int iconResourceId) { ActionBar.Tab tab = SupportActionBar.NewTab() .SetText(labelResourceId) .SetIcon(iconResourceId) .SetTabListener(this); SupportActionBar.AddTab(tab); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { switch (tab.Text) { case "Login": if (fragTab1 == null) { fragTab1 = new LoginTabFragment(xmppClient); ft.Add(Resource.Id.fragmentContainer, fragTab1); } else { ft.Show(fragTab1); } break; case "Contacts": if (fragTabContacts == null) { fragTabContacts = new ContactsTabFragment(xmppClient); ft.Add(Resource.Id.fragmentContainer, fragTabContacts); } else { ft.Show(fragTabContacts); } break; case "XML Log": if (fragTab2 == null) { fragTab2 = new LogTabFragment(xmppClient); ft.Add(Resource.Id.fragmentContainer, fragTab2); } else { ft.Show(fragTab2); } break; case "Events": if (fragTab3 == null) { fragTab3 = new EventsTabFragment(xmppClient); ft.Add(Resource.Id.fragmentContainer, fragTab3); } else { ft.Show(fragTab3); } break; } }
private void TabSetup(ActionBar.Tab tab, int resourceID) { ImageView iv = new ImageView(activity); iv.SetImageResource(resourceID); iv.SetPadding(0, 10, 0, 0); tab.SetCustomView(iv); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { PilotListCounterFragment fragment = tab.Tag as PilotListCounterFragment; if (fragment != null) { ft.Replace(R.Ids.pilotsOnlineFragmentContainer, fragment); } }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft) { Fragment fragment = tab.Tag as Fragment; if (fragment != null) { ft.Replace(R.Ids.itemDetailFragmentContainer, fragment); } }
void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs) { ActionBar.Tab tab = (ActionBar.Tab)sender; Log.Debug(Tag, "The tab {0} has been selected.", tab.Text); Fragment frag = _fragments[tab.Position]; tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag); }
public void OnTabSelected(ActionBar.Tab actionTab, FragmentTransaction ft) { if (_inFlight) { return; } var itemPosition = actionTab.Position; var masterStack = (FragmentHistoryStack)PaneManager.Instance.FromNavContext(Pane.Master, itemPosition); var tab = TabItems.ElementAt(itemPosition); var nativeTab = DroidFactory.GetNativeObject <TabItem>(tab, "tab"); if (itemPosition != SelectedIndex && !PaneManager.Instance.ShouldNavigate(tab.NavigationLink, Pane.Tabs, NavigationType.Tab)) { DroidFactory.MainActivity.ActionBar.GetTabAt(_selectedIndex).Select(); return; } var navTabs = _model as NavigationTabs; if (masterStack.CurrentView != null && (navTabs == null || !navTabs.TabItems[itemPosition].RefreshOnFocus)) { if (itemPosition != SelectedIndex) { _selectedIndex = itemPosition; this.OnPropertyChanged("SelectedIndex"); nativeTab.OnSelected(); } iApp.SetNavigationContext(new iLayer.NavigationContext { OutputOnPane = Pane.Tabs, NavigatedActiveTab = itemPosition, }); masterStack.Align(NavigationType.Tab); return; } iLayer.NavigationContext context; if (masterStack.CurrentLayer != null && (context = masterStack.CurrentLayer.NavContext) != null) { //Fix layer context if it was modified in a different tab context.ClearPaneHistoryOnOutput = false; context.NavigatedActivePane = Pane.Tabs; context.NavigatedActiveTab = itemPosition; context.OutputOnPane = Pane.Master; } if (itemPosition != iApp.CurrentNavContext.ActiveTab) { var masterView = (PaneManager.Instance.FromNavContext(Pane.Master, iApp.CurrentNavContext.ActiveTab) as FragmentHistoryStack)?.CurrentView as IView; iApp.SetNavigationContext(new iLayer.NavigationContext { OutputOnPane = Pane.Tabs, NavigatedActiveTab = itemPosition, }); masterView?.RaiseEvent("Deactivated", EventArgs.Empty); } _selectedIndex = itemPosition; this.OnPropertyChanged("SelectedIndex"); nativeTab.Activate(this); }