public class ActionBarWrapper.TabWrapper extends ActionBar.Tab implements android.app.ActionBar.TabListener
INVALID_POSITION
Constructor and Description |
---|
TabWrapper(android.app.ActionBar.Tab nativeTab) |
Modifier and Type | Method and Description |
---|---|
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 |
onTabReselected(android.app.ActionBar.Tab tab,
android.app.FragmentTransaction ft) |
void |
onTabSelected(android.app.ActionBar.Tab tab,
android.app.FragmentTransaction ft) |
void |
onTabUnselected(android.app.ActionBar.Tab tab,
android.app.FragmentTransaction ft) |
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.
|
ActionBar.Tab |
setTabListener(ActionBar.TabListener listener)
Set the
ActionBar.TabListener that will handle switching to and from this tab. |
ActionBar.Tab |
setTag(Object obj)
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 int getPosition()
ActionBar.Tab
getPosition
in class ActionBar.Tab
ActionBar.Tab.INVALID_POSITION
if this tab is not currently in
the action bar.public android.graphics.drawable.Drawable getIcon()
ActionBar.Tab
getIcon
in class ActionBar.Tab
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 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.view.View getCustomView()
ActionBar.Tab
getCustomView
in class ActionBar.Tab
ActionBar.Tab.setCustomView(View)
.public ActionBar.Tab setTag(Object obj)
ActionBar.Tab
setTag
in class ActionBar.Tab
obj
- Object to storepublic Object getTag()
getTag
in class ActionBar.Tab
public ActionBar.Tab setTabListener(ActionBar.TabListener listener)
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
listener
- Listener to handle tab selection eventspublic 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)
public void onTabReselected(android.app.ActionBar.Tab tab, android.app.FragmentTransaction ft)
onTabReselected
in interface android.app.ActionBar.TabListener
public void onTabSelected(android.app.ActionBar.Tab tab, android.app.FragmentTransaction ft)
onTabSelected
in interface android.app.ActionBar.TabListener
public void onTabUnselected(android.app.ActionBar.Tab tab, android.app.FragmentTransaction ft)
onTabUnselected
in interface android.app.ActionBar.TabListener
Copyright © 2011–2014. All rights reserved.