TtTabBar
This control is used for a list of tabs and reacts to clicks on each tab. To know when the selected tab changes, register an OnSelectedTabIndexChangedListener.
Tabs can be configured to have a fixed or a flexible width.
All theme attributes used by this control are declared in com.tomtom.tools.android.core.theme
. To use this control, it is mandatory to define these attribute values.
Parameters
The display context.
The attribute set provided in the layout XML file.
The default style attribute set. Use 0 to not look for defaults.
Types
An interface for listeners that wish to receive a callback when ttSelectedTabIndex changes.
The mode decides how much space a tab occupies in a tab bar.
Properties
The tab indicator. It highlights the selected tab.
Decides should the icon within a tab be on top of the text, or in front of the text. When set to false
, the icon is placed on top of the text. When set to true
, the icon is placed in front of the text.
The index of the current selected tab. Set to NO_SELECTION_INDEX to have no tab selected. If the index is invalid the tab indicator will be removed and no tab selected.
The color used to tint the content of a tab when selected.
The color used to tint the content of a tab when unselected.
The dimension of the icon within a tab.
Decides how ttIndicator would be stretched. When set to true
, the indicator is stretched to the full tab width. When set to false
, the indicator is stretched to meet the content width of the tab.
A list of TtTabItems representing the individual tabs.
The TabMode of this tab bar.
The bottom padding of a tab.
The end padding of a tab.
The start padding of a tab.
The top padding of a tab.
The text appearance for a tab.
The desired tab width. Applies only when ttTabMode is set to TabMode.FIXED_WIDTH.
Functions
Registers a listener that will be called whenever ttSelectedTabIndex changes. If the listener is already registered, nothing happens.
Sets ttIndicator with the given DrawableResolver.
Unregisters a listener. If the listener was not registered, nothing is unregistered.
Inherited functions
An inverse binding adapter that adds support for two-way data binding for TtTabBar.ttSelectedTabIndex.
A binding adapter that adds support for two-way data binding for TtTabBar.ttSelectedTabIndex.