ActionBar.Tab
public abstract class ActionBar.Tab
A tab in the action bar.
Tabs manage the hiding and showing of Fragments.
Summary
Constants |
|
|---|---|
static final int |
INVALID_POSITION = -1An invalid position for a tab. |
Public constructors |
|---|
|
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 |
Return the icon associated with this tab. |
abstract int |
Return the current position of this tab in the action bar. |
abstract Object |
|
abstract CharSequence |
Return the text of this tab. |
abstract void |
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 methods
public abstract CharSequencegetContentDescription()
Gets a brief description of this tab's content for use in accessibility support.
| Returns | |
|---|---|
CharSequence |
Description of this tab's content |
public abstract ViewgetCustomView()
Retrieve a previously set custom view for this tab.
| Returns | |
|---|---|
View |
The custom view set by |
public abstract DrawablegetIcon()
Return the icon associated with this tab.
| Returns | |
|---|---|
Drawable |
The tab's icon |
public abstract int getPosition()Return the current position of this tab in the action bar.
| Returns | |
|---|---|
int |
Current position, or |
public abstract CharSequencegetText()
Return the text of this tab.
| Returns | |
|---|---|
CharSequence |
The tab's text |
public abstract void select()Select this tab. Only valid if the tab has been added to the action bar.
public abstract ActionBar.TabsetContentDescription(CharSequence contentDesc)
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 | |
|---|---|
CharSequence contentDesc |
Description of this tab's content |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetContentDescription(@StringRes int resId)
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 | |
|---|---|
@StringRes int resId |
A resource ID referring to the description text |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetCustomView(int layoutResId)
Set a custom view to be used for this tab. This overrides values set by setText and setIcon.
| Parameters | |
|---|---|
int layoutResId |
A layout resource to inflate and use as a custom tab view |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetCustomView(View view)
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 |
public abstract ActionBar.TabsetIcon(Drawable icon)
Set the icon displayed on this tab.
| Parameters | |
|---|---|
Drawable icon |
The drawable to use as an icon |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetIcon(@DrawableRes int resId)
Set the icon displayed on this tab.
| Parameters | |
|---|---|
@DrawableRes int resId |
Resource ID referring to the drawable to use as an icon |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetTabListener(ActionBar.TabListener listener)
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 | |
|---|---|
ActionBar.TabListener listener |
Listener to handle tab selection events |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetTag(Object obj)
Give this Tab an arbitrary object to hold for later use.
| Parameters | |
|---|---|
Object obj |
Object to store |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetText(int resId)
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
| Parameters | |
|---|---|
int resId |
A resource ID referring to the text that should be displayed |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |
public abstract ActionBar.TabsetText(CharSequence text)
Set the text displayed on this tab. Text may be truncated if there is not room to display the entire string.
| Parameters | |
|---|---|
CharSequence text |
The text to display |
| Returns | |
|---|---|
ActionBar.Tab |
The current instance for call chaining |