public final class

TabSpec

extends Object
java.lang.Object
   ↳ com.neomades.app.TabSpec

Class Overview

A TabScreen's tab specification. This enables to define separately for each tab its screen , default TabBar item text, default TabBar item image and parameters to pass to the screen. Note that it is equal as using addTab(int, int, Class, ScreenParams) if the characteristic of the tab are only these parameters.
TabSpec can be used to customize the selected aspect of the TabBar item associated to the tab. Thus, the image of the tab can change when selected if setSelectedImage(Image) is defined. In the same way, the selected background image of the tab can be modified using setSelectedBackgroundImage(Image).

Cross Platform Considerations

In iOS, the selected image and selected background image are ignored by default. To make it visible, a CustomTabBar must be linked with the TabScreen.

Summary

Constants
int SYSTEM_TAB_BOOKMARKS The iOS bookmarks system item.
int SYSTEM_TAB_CONTACTS The iOS contacts system item.
int SYSTEM_TAB_DOWNLOADS The iOS downloads system item.
int SYSTEM_TAB_FAVORITES The iOS favorites system item.
int SYSTEM_TAB_FEATURED The iOS featured system item.
int SYSTEM_TAB_HISTORY The iOS history system item.
int SYSTEM_TAB_MORE The iOS more system item.
int SYSTEM_TAB_MOSTRECENT The iOS most recent system item.
int SYSTEM_TAB_MOSTVIEWED The iOS most viewed system item.
int SYSTEM_TAB_RECENTS The iOS recents system item.
int SYSTEM_TAB_SEARCH The iOS search system item.
int SYSTEM_TAB_TOPRATED The iOS top rated system item.
Public Methods
static TabSpec newTabSpec(Class screen)
Create a new TabSpec instance with the screen linked to the tab.
TabSpec setImage(Image image)
Sets the image of the tab that will be displayed in the TabBar.
TabSpec setImage(int imageResId)
Sets the image of the tab that will be displayed in the TabBar.
TabSpec setParams(ScreenParams params)
Sets the additional information given to the pushed screen.
TabSpec setSelectedBackgroundImage(int imageResId)
Sets the selected background image of the tab that will be displayed when the tab is selected.
TabSpec setSelectedBackgroundImage(Image image)
Sets the selected background image of the tab that will be displayed when the tab is selected.
TabSpec setSelectedImage(int imageResId)
Sets the image of the tab that will be displayed in the TabBar when the tab is selected.
TabSpec setSelectedImage(Image image)
Sets the image of the tab that will be displayed in the TabBar when the tab is selected.
TabSpec setSelectedView(Layout view)
Set the view of the tab that will be displayed in the tab is selected.
TabSpec setSystemTab(int systemTab)
TabSpec setText(String text)
Set the string for the title of the tab.
TabSpec setText(int textResId)
Set the string for the title of the tab.
TabSpec setView(Layout view)
Set the view of the tab that will be displayed in the TabBar.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int SYSTEM_TAB_BOOKMARKS

The iOS bookmarks system item.

Constant Value: -8 (0xfffffff8)

public static final int SYSTEM_TAB_CONTACTS

The iOS contacts system item.

Constant Value: -6 (0xfffffffa)

public static final int SYSTEM_TAB_DOWNLOADS

The iOS downloads system item.

Constant Value: -10 (0xfffffff6)

public static final int SYSTEM_TAB_FAVORITES

The iOS favorites system item.

Constant Value: -2 (0xfffffffe)

public static final int SYSTEM_TAB_FEATURED

The iOS featured system item.

Constant Value: -3 (0xfffffffd)

public static final int SYSTEM_TAB_HISTORY

The iOS history system item.

Constant Value: -7 (0xfffffff9)

public static final int SYSTEM_TAB_MORE

The iOS more system item.

Constant Value: -1 (0xffffffff)

public static final int SYSTEM_TAB_MOSTRECENT

The iOS most recent system item.

Constant Value: -11 (0xfffffff5)

public static final int SYSTEM_TAB_MOSTVIEWED

The iOS most viewed system item.

Constant Value: -12 (0xfffffff4)

public static final int SYSTEM_TAB_RECENTS

The iOS recents system item.

Constant Value: -5 (0xfffffffb)

public static final int SYSTEM_TAB_SEARCH

The iOS search system item.

Constant Value: -9 (0xfffffff7)

public static final int SYSTEM_TAB_TOPRATED

The iOS top rated system item.

Constant Value: -4 (0xfffffffc)

Public Methods

public static TabSpec newTabSpec (Class screen)

Create a new TabSpec instance with the screen linked to the tab.

Parameters
screen the content screen of the tab.
Returns
  • the created TabSpec instance

public TabSpec setImage (Image image)

Sets the image of the tab that will be displayed in the TabBar.

Parameters
image the image of the tab that will be displayed in the TabBar.
Returns
  • this the current TabSpec

public TabSpec setImage (int imageResId)

Sets the image of the tab that will be displayed in the TabBar.

Parameters
imageResId the image id of the tab that will be displayed in the TabBar.
Returns
  • this the current TabSpec.

public TabSpec setParams (ScreenParams params)

Sets the additional information given to the pushed screen.

Parameters
params additional information
Returns
  • this the current TabSpec.

public TabSpec setSelectedBackgroundImage (int imageResId)

Sets the selected background image of the tab that will be displayed when the tab is selected. This image will be displayed behind the title and the image of the tab but above the TabBar. This property can be defined for all the items of the TabBar using setSelectedItemBackgroundImage(Image). Note that the background image defined using setSelectedItemBackgroundImage(Image) will be ignored if a selected background image was declared in the TabSpec.

Cross-Platform consideration

In iOS, this method is ignored if the TabScreen does not use a CustomTabBar.

Parameters
imageResId the selected background image id of the tab that will be displayed when the tab is selected.
Returns
  • this the current TabSpec.

public TabSpec setSelectedBackgroundImage (Image image)

Sets the selected background image of the tab that will be displayed when the tab is selected. This image will be displayed behind the title and the image of the tab but above the TabBar. This property can be defined for all the items of the TabBar using setSelectedItemBackgroundImage(Image). Note that the background image defined using setSelectedItemBackgroundImage(Image) will be ignore if a selected background image was declared in the TabSpec.

Cross-Platform consideration

In iOS, this method is ignored if the TabScreen does not use a CustomTabBar.

Parameters
image the selected background image of the tab that will be displayed when the tab is selected.
Returns
  • this the current TabSpec.

public TabSpec setSelectedImage (int imageResId)

Sets the image of the tab that will be displayed in the TabBar when the tab is selected. This image will replace the image set using setImage(Image) when the tab is selected.

Cross-Platform consideration

In iOS, this method is ignored if the TabScreen does not use a CustomTabBar.

Parameters
imageResId the selected image id of the tab that will be displayed when the tab is selected
Returns
  • this the current TabSpec.

public TabSpec setSelectedImage (Image image)

Sets the image of the tab that will be displayed in the TabBar when the tab is selected. This image will replace the image set using setImage(Image) when the tab is selected.

Cross-Platform consideration

In iOS, this method is ignored if the TabScreen does not use a CustomTabBar.

Parameters
image the selected image of the tab that will be displayed when the tab is selected
Returns
  • this the current TabSpec.

public TabSpec setSelectedView (Layout view)

Set the view of the tab that will be displayed in the tab is selected. This method must be used with setSelectedView(Layout).

Using this method will cancel configuration with setImage(Image), setSelectedImage(Image), setSelectedBackgroundImage(Image) or setText(String) methods for this tab.

Be sure that your layout can enter in the tab area.

Parameters
view the view of the tab of the tab that will be displayed when the tab is selected
Returns
  • this the current TabSpec.

public TabSpec setSystemTab (int systemTab)

Returns
  • this the current TabSpec.

public TabSpec setText (String text)

Set the string for the title of the tab. It will be displayed in the TabBar.

Parameters
text the string for the title of the tab.
Returns
  • this the current TabSpec.

public TabSpec setText (int textResId)

Set the string for the title of the tab. It will be displayed in the TabBar.

Parameters
textResId the string id of the title of the tab.
Returns
  • this the current TabSpec.

public TabSpec setView (Layout view)

Set the view of the tab that will be displayed in the TabBar. Using this method will cancel configuration with setImage(Image), setSelectedImage(Image), setSelectedBackgroundImage(Image) or setText(String) methods for this tab.

Be sure that your layout can enter in the tab area.

Use setSelectedView(Layout) to configure the tab in the selected state.

Parameters
view the view of the tab that will be displayed in the TabBar.
Returns
  • this the current TabSpec.