public class ActionBarImpl.TabImpl extends ActionBar.Tab
INVALID_POSITION
Constructor and Description |
---|
TabImpl() |
Modifier and Type | Method and Description |
---|---|
ActionBar.TabListener |
getCallback() |
CharSequence |
getContentDescription()
Gets a brief description of this tab's content for use in accessibility support.
|
android.view.View |
getCustomView()
Retrieve a previously set custom view for this tab.
|
android.graphics.drawable.Drawable |
getIcon()
Return the icon associated with this tab.
|
int |
getPosition()
Return the current position of this tab in the action bar.
|
Object |
getTag() |
CharSequence |
getText()
Return the text of this tab.
|
void |
select()
Select this tab.
|
ActionBar.Tab |
setContentDescription(CharSequence contentDesc)
Set a description of this tab's content for use in accessibility support.
|
ActionBar.Tab |
setContentDescription(int resId)
Set a description of this tab's content for use in accessibility support.
|
ActionBar.Tab |
setCustomView(int layoutResId)
Set a custom view to be used for this tab.
|
ActionBar.Tab |
setCustomView(android.view.View view)
Set a custom view to be used for this tab.
|
ActionBar.Tab |
setIcon(android.graphics.drawable.Drawable icon)
Set the icon displayed on this tab.
|
ActionBar.Tab |
setIcon(int resId)
Set the icon displayed on this tab.
|
void |
setPosition(int position) |
ActionBar.Tab |
setTabListener(ActionBar.TabListener callback)
Set the
ActionBar.TabListener that will handle switching to and from this tab. |
ActionBar.Tab |
setTag(Object tag)
Give this Tab an arbitrary object to hold for later use.
|
ActionBar.Tab |
setText(CharSequence text)
Set the text displayed on this tab.
|
ActionBar.Tab |
setText(int resId)
Set the text displayed on this tab.
|
public Object getTag()
getTag
in class ActionBar.Tab
public ActionBar.Tab setTag(Object tag)
ActionBar.Tab
setTag
in class ActionBar.Tab
tag
- Object to storepublic ActionBar.TabListener getCallback()
public ActionBar.Tab setTabListener(ActionBar.TabListener callback)
ActionBar.Tab
ActionBar.TabListener
that will handle switching to and from this tab.
All tabs must have a TabListener set before being added to the ActionBar.setTabListener
in class ActionBar.Tab
callback
- Listener to handle tab selection eventspublic android.view.View getCustomView()
ActionBar.Tab
getCustomView
in class ActionBar.Tab
ActionBar.Tab.setCustomView(View)
.public ActionBar.Tab setCustomView(android.view.View view)
ActionBar.Tab
ActionBar.Tab.setText(CharSequence)
and ActionBar.Tab.setIcon(Drawable)
.setCustomView
in class ActionBar.Tab
view
- Custom view to be used as a tab.public ActionBar.Tab setCustomView(int layoutResId)
ActionBar.Tab
ActionBar.Tab.setText(CharSequence)
and ActionBar.Tab.setIcon(Drawable)
.setCustomView
in class ActionBar.Tab
layoutResId
- A layout resource to inflate and use as a custom tab viewpublic android.graphics.drawable.Drawable getIcon()
ActionBar.Tab
getIcon
in class ActionBar.Tab
public int getPosition()
ActionBar.Tab
getPosition
in class ActionBar.Tab
ActionBar.Tab.INVALID_POSITION
if this tab is not currently in
the action bar.public void setPosition(int position)
public CharSequence getText()
ActionBar.Tab
getText
in class ActionBar.Tab
public ActionBar.Tab setIcon(android.graphics.drawable.Drawable icon)
ActionBar.Tab
setIcon
in class ActionBar.Tab
icon
- The drawable to use as an iconpublic ActionBar.Tab setIcon(int resId)
ActionBar.Tab
setIcon
in class ActionBar.Tab
resId
- Resource ID referring to the drawable to use as an iconpublic ActionBar.Tab setText(CharSequence text)
ActionBar.Tab
setText
in class ActionBar.Tab
text
- The text to displaypublic ActionBar.Tab setText(int resId)
ActionBar.Tab
setText
in class ActionBar.Tab
resId
- A resource ID referring to the text that should be displayedpublic void select()
ActionBar.Tab
select
in class ActionBar.Tab
public ActionBar.Tab setContentDescription(int resId)
ActionBar.Tab
setContentDescription
in class ActionBar.Tab
resId
- A resource ID referring to the description textActionBar.Tab.setContentDescription(CharSequence)
,
ActionBar.Tab.getContentDescription()
public ActionBar.Tab setContentDescription(CharSequence contentDesc)
ActionBar.Tab
setContentDescription
in class ActionBar.Tab
contentDesc
- Description of this tab's contentActionBar.Tab.setContentDescription(int)
,
ActionBar.Tab.getContentDescription()
public CharSequence getContentDescription()
ActionBar.Tab
getContentDescription
in class ActionBar.Tab
ActionBar.Tab.setContentDescription(CharSequence)
,
ActionBar.Tab.setContentDescription(int)
Copyright © 2011–2014. All rights reserved.