Tab
abstract classTab
| kotlin.Any | |
| ↳ | android.app.ActionBar.Tab |
A tab in the action bar.
Tabs manage the hiding and showing of Fragments.
Summary
| Constants | |
|---|---|
| static Int |
An invalid position for a tab. |
| Public constructors | |
|---|---|
Tab() |
|
| Public methods | |
|---|---|
| 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! |
getIcon()Return the icon associated with this tab. |
| abstract Int |
Return the current position of this tab in the action bar. |
| abstract Any! |
getTag() |
| abstract CharSequence! |
getText()Return the text of this tab. |
| abstract Unit |
select()Select this tab. |
| abstract ActionBar.Tab! |
setContentDescription(resId: Int)Set a description of this tab's content for use in accessibility support. |
| abstract ActionBar.Tab! |
setContentDescription(contentDesc: CharSequence!)Set a description of this tab's content for use in accessibility support. |
| abstract ActionBar.Tab! |
setCustomView(view: View!)Set a custom view to be used for this tab. |
| abstract ActionBar.Tab! |
setCustomView(layoutResId: Int)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! |
setTabListener(listener: ActionBar.TabListener!)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! |
setText(text: CharSequence!)Set the text displayed on this tab. |
Constants
INVALID_POSITION
static valINVALID_POSITION: Int
Deprecated: Deprecated in Java.
An invalid position for a tab.
Value: -1See Also
Public constructors
Tab
Tab()
Public methods
getContentDescription
abstract fungetContentDescription(): CharSequence!
Deprecated: Deprecated in Java.
Gets a brief description of this tab's content for use in accessibility support.
| Return | |
|---|---|
CharSequence! |
Description of this tab's content |
getCustomView
abstract fungetCustomView(): View!
Deprecated: Deprecated in Java.
Retrieve a previously set custom view for this tab.
| Return | |
|---|---|
View! |
The custom view set by setCustomView(android.view.View). |
getIcon
abstract fungetIcon(): Drawable!
Deprecated: Deprecated in Java.
Return the icon associated with this tab.
| Return | |
|---|---|
Drawable! |
The tab's icon |
getPosition
abstract fungetPosition(): Int
Deprecated: Deprecated in Java.
Return the current position of this tab in the action bar.
| Return | |
|---|---|
Int |
Current position, or INVALID_POSITION if this tab is not currently in the action bar. |
getTag
abstract fungetTag(): Any!
Deprecated: Deprecated in Java.
| Return | |
|---|---|
Any! |
This Tab's tag object. |
getText
abstract fungetText(): CharSequence!
Deprecated: Deprecated in Java.
Return the text of this tab.
| Return | |
|---|---|
CharSequence! |
The tab's text |
select
abstract funselect(): Unit
Deprecated: Deprecated in Java.
Select this tab. Only valid if the tab has been added to the action bar.
setContentDescription
abstract funsetContentDescription(resId: Int): ActionBar.Tab!
Deprecated: Deprecated in Java.
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 | |
|---|---|
resId |
Int: A resource ID referring to the description text |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setContentDescription
abstract funsetContentDescription(contentDesc: CharSequence!): ActionBar.Tab!
Deprecated: Deprecated in Java.
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 |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setCustomView
abstract funsetCustomView(view: View!): ActionBar.Tab!
Deprecated: Deprecated in Java.
Set a custom view to be used for this tab. This overrides values set by setText(java.lang.CharSequence) and setIcon(android.graphics.drawable.Drawable).
| Parameters | |
|---|---|
view |
View!: Custom view to be used as a tab. |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setCustomView
abstract funsetCustomView(layoutResId: Int): ActionBar.Tab!
Deprecated: Deprecated in Java.
Set a custom view to be used for this tab. This overrides values set by setText(java.lang.CharSequence) and setIcon(android.graphics.drawable.Drawable).
| Parameters | |
|---|---|
layoutResId |
Int: A layout resource to inflate and use as a custom tab view |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setIcon
abstract funsetIcon(icon: Drawable!): ActionBar.Tab!
Deprecated: Deprecated in Java.
Set the icon displayed on this tab.
| Parameters | |
|---|---|
icon |
Drawable!: The drawable to use as an icon |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setIcon
abstract funsetIcon(resId: Int): ActionBar.Tab!
Deprecated: Deprecated in Java.
Set the icon displayed on this tab.
| Parameters | |
|---|---|
resId |
Int: Resource ID referring to the drawable to use as an icon |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setTabListener
abstract funsetTabListener(listener: ActionBar.TabListener!): ActionBar.Tab!
Deprecated: Deprecated in Java.
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 |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setTag
abstract funsetTag(obj: Any!): ActionBar.Tab!
Deprecated: Deprecated in Java.
Give this Tab an arbitrary object to hold for later use.
| Parameters | |
|---|---|
obj |
Any!: Object to store |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setText
abstract funsetText(resId: Int): ActionBar.Tab!
Deprecated: Deprecated in Java.
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 |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |
setText
abstract funsetText(text: CharSequence!): ActionBar.Tab!
Deprecated: Deprecated in Java.
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 |
| Return | |
|---|---|
ActionBar.Tab! |
The current instance for call chaining |