ActionBar.Tab
abstract class ActionBar.Tab
A tab in the action bar.
Tabs manage the hiding and showing of Fragments.
Summary
Constants |
|
|---|---|
const Int |
INVALID_POSITION = -1An invalid position for a tab. |
Public constructors |
|---|
|
Public functions |
|
|---|---|
abstract CharSequence! |
Gets a brief description of this tab's content for use in accessibility support. |
abstract View! |
Retrieve a previously set custom view for this tab. |
abstract Drawable! |
Return the icon associated with this tab. |
abstract Int |
Return the current position of this tab in the action bar. |
abstract Any! |
|
abstract CharSequence! |
Return the text of this tab. |
abstract Unit |
Select this tab. |
abstract ActionBar.Tab! |
Set a description of this tab's content for use in accessibility support. |
abstract ActionBar.Tab! |
Set a description of this tab's content for use in accessibility support. |
abstract ActionBar.Tab! |
Set a custom view to be used for this tab. |
abstract ActionBar.Tab! |
Set a custom view to be used for this tab. |
abstract ActionBar.Tab! |
Set the icon displayed on this tab. |
abstract ActionBar.Tab! |
Set the icon displayed on this tab. |
abstract ActionBar.Tab! |
Set the |
abstract ActionBar.Tab! |
Give this Tab an arbitrary object to hold for later use. |
abstract ActionBar.Tab! |
Set the text displayed on this tab. |
abstract ActionBar.Tab! |
Set the text displayed on this tab. |
Constants
Public constructors
Public functions
abstract fungetContentDescription(): CharSequence!
Gets a brief description of this tab's content for use in accessibility support.
| Returns | |
|---|---|
CharSequence! |
Description of this tab's content |
abstract fungetCustomView(): View!
Retrieve a previously set custom view for this tab.
| Returns | |
|---|---|
View! |
The custom view set by |
abstract fungetIcon(): Drawable!
Return the icon associated with this tab.
| Returns | |
|---|---|
Drawable! |
The tab's icon |
abstract fungetPosition(): Int
Return the current position of this tab in the action bar.
| Returns | |
|---|---|
Int |
Current position, or |
abstract fungetText(): CharSequence!
Return the text of this tab.
| Returns | |
|---|---|
CharSequence! |
The tab's text |
abstract funselect(): Unit
Select this tab. Only valid if the tab has been added to the action bar.
abstract funsetContentDescription(contentDesc: CharSequence!): ActionBar.Tab!
Set a description of this tab's content for use in accessibility support. If no content description is provided the title will be used.
| Parameters | |
|---|---|
contentDesc: CharSequence! |
Description of this tab's content |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetContentDescription(resId: @StringRes Int): ActionBar.Tab!
Set a description of this tab's content for use in accessibility support. If no content description is provided the title will be used.
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetCustomView(layoutResId: Int): ActionBar.Tab!
Set a custom view to be used for this tab. This overrides values set by setText and setIcon.
| Parameters | |
|---|---|
layoutResId: Int |
A layout resource to inflate and use as a custom tab view |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetCustomView(view: View!): ActionBar.Tab!
Set a custom view to be used for this tab. This overrides values set by setText and setIcon.
| Parameters | |
|---|---|
view: View! |
Custom view to be used as a tab. |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetIcon(icon: Drawable!): ActionBar.Tab!
Set the icon displayed on this tab.
| Parameters | |
|---|---|
icon: Drawable! |
The drawable to use as an icon |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetIcon(resId: @DrawableRes Int): ActionBar.Tab!
Set the icon displayed on this tab.
| Parameters | |
|---|---|
resId: @DrawableRes Int |
Resource ID referring to the drawable to use as an icon |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetTabListener(listener: ActionBar.TabListener!): ActionBar.Tab!
Set the TabListener that will handle switching to and from this tab. All tabs must have a TabListener set before being added to the ActionBar.
| Parameters | |
|---|---|
listener: ActionBar.TabListener! |
Listener to handle tab selection events |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetTag(obj: Any!): ActionBar.Tab!
Give this Tab an arbitrary object to hold for later use.
| Parameters | |
|---|---|
obj: Any! |
Object to store |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetText(resId: Int): ActionBar.Tab!
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
| Parameters | |
|---|---|
resId: Int |
A resource ID referring to the text that should be displayed |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
abstract funsetText(text: CharSequence!): ActionBar.Tab!
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
| Parameters | |
|---|---|
text: CharSequence! |
The text to display |
| Returns | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |