public abstract class

TabScreen

extends Screen
java.lang.Object
   ↳ com.neomades.app.Screen
     ↳ com.neomades.app.TabScreen

Class Overview

The TabScreen class implements a specialized screen that manages a tab-style selection interface.

Cross Platform Considerations

In iOS, this screen interface displays tabs at the bottom of the window for selecting between the different modes and for displaying the views for that mode. If there is more than 5 tab item, then iOS will show a "More" tab item in order to show additional tab items into a separate list.

In Android, this screen interface displays tabs at the top of the window for selecting between the different modes and for displaying the views for that mode.

Navigation controller behaviors

In iOS and Android, each tab keeps a sub-navigation stack. To access to the stack of the TabScreen and replace or pop the TabScreen, use getRootController() on a controller instance.
For other platforms, if a tab content will push a screen, then the TabScreen will be saved into the stack, and the new screen will be displayed. To go back to the TabScreen, the user will click over Back button.

Image sizes

  • iOS: 30 x 30 pixels (low resolutions) and 60 x 60 pixels (high resolutions)
  • Android: 24 x 24 pixels (ldpi), 32 x 32 pixels (mdpi), 48 x 48 pixels (hdpi), 64 x 64 pixels (xhdpi)

Summary

[Expand]
Inherited Constants
From class com.neomades.app.Screen
From interface com.neomades.app.Keys
From interface com.neomades.app.Orientation
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
[Expand]
Inherited Fields
From class com.neomades.app.Screen
Public Constructors
TabScreen()
Protected Methods
void addTab(int txtId, int imgId, Class screen)
Add a tab to this TabScreen.
void addTab(int txtId, int imgId, Class screen, ScreenParams parameters)
Adds a tab to this TabScreen.
void addTab(TabSpec tabSpec)
Add a tab to this TabScreen.
int getCurrentTab()
Get the current selected tab.
void setCurrentTab(int number)
Changes the current selected tab.
void setCustomTabBar(CustomTabBar customTabBar)
Sets a customized TabBar.
void setPagerEnabled(boolean enabled)
Enables or disables the pager mode in order to allow the user to flip left and right through tabs.
void setTabBarPosition(int anchor)
Sets the TabBar position into the screen : TOP or BOTTOM.
[Expand]
Inherited Methods
From class com.neomades.app.Screen
From class java.lang.Object

Public Constructors

public TabScreen ()

Protected Methods

protected void addTab (int txtId, int imgId, Class screen)

Add a tab to this TabScreen. The text and the image will be used to complete the TabBar item associated with the tab.

For further customization of Tab, see addTab(TabSpec) and TabSpec.

Parameters
txtId the string id of the tab's title
imgId the image id of the tab
screen the content screen of the tab
See Also

protected void addTab (int txtId, int imgId, Class screen, ScreenParams parameters)

Adds a tab to this TabScreen. The text and the image will be used to complete the TabBar item associated with the tab. Additional information can be passed to the screen using ScreenParams.

For further customization of Tab, see addTab(TabSpec) and TabSpec.

Parameters
txtId the string id of the tab's title
imgId the image id of the tab
screen the content screen of the tab
parameters additional information given to the pushed screen
See Also

protected void addTab (TabSpec tabSpec)

Add a tab to this TabScreen.

Parameters
tabSpec Specifies how to create the tab.
See Also

protected int getCurrentTab ()

Get the current selected tab.

Returns
  • the current selected tab.

protected void setCurrentTab (int number)

Changes the current selected tab.

Parameters
number current tab index

protected void setCustomTabBar (CustomTabBar customTabBar)

Sets a customized TabBar.

Parameters
customTabBar the customized TabBar or null to set the native TabBar
See Also

protected void setPagerEnabled (boolean enabled)

Enables or disables the pager mode in order to allow the user to flip left and right through tabs.

Only for Android. By default disabled.

Parameters
enabled true to enable

protected void setTabBarPosition (int anchor)

Sets the TabBar position into the screen : TOP or BOTTOM.

Parameters
anchor TOP or BOTTOM
See Also