public class ActionBarImpl extends ActionBar
| Modifier and Type | Class and Description | 
|---|---|
class  | 
ActionBarImpl.ActionModeImpl  | 
class  | 
ActionBarImpl.TabImpl  | 
ActionBar.LayoutParams, ActionBar.OnMenuVisibilityListener, ActionBar.OnNavigationListener, ActionBar.Tab, ActionBar.TabListenerDISPLAY_HOME_AS_UP, DISPLAY_SHOW_CUSTOM, DISPLAY_SHOW_HOME, DISPLAY_SHOW_TITLE, DISPLAY_USE_LOGO, NAVIGATION_MODE_LIST, NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_TABS| Constructor and Description | 
|---|
ActionBarImpl(android.app.Activity activity,
             int features)  | 
ActionBarImpl(android.app.Dialog dialog)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
Add a listener that will respond to menu visibility change events. 
 | 
void | 
addTab(ActionBar.Tab tab)
Add a tab for use in tabbed navigation mode. 
 | 
void | 
addTab(ActionBar.Tab tab,
      boolean setSelected)
Add a tab for use in tabbed navigation mode. 
 | 
void | 
addTab(ActionBar.Tab tab,
      int position)
Add a tab for use in tabbed navigation mode. 
 | 
void | 
addTab(ActionBar.Tab tab,
      int position,
      boolean setSelected)
Add a tab for use in tabbed navigation mode. 
 | 
void | 
dispatchMenuVisibilityChanged(boolean isVisible)  | 
android.view.View | 
getCustomView()  | 
int | 
getDisplayOptions()  | 
int | 
getHeight()
Retrieve the current height of the ActionBar. 
 | 
int | 
getNavigationItemCount()
Get the number of navigation items present in the current navigation mode. 
 | 
int | 
getNavigationMode()
Returns the current navigation mode. 
 | 
int | 
getSelectedNavigationIndex()
Get the position of the selected navigation item in list or tabbed navigation modes. 
 | 
ActionBar.Tab | 
getSelectedTab()
Returns the currently selected tab if in tabbed navigation mode and there is at least
 one tab present. 
 | 
CharSequence | 
getSubtitle()
Returns the current ActionBar subtitle in standard mode. 
 | 
ActionBar.Tab | 
getTabAt(int index)
Returns the tab at the specified index. 
 | 
int | 
getTabCount()
Returns the number of tabs currently registered with the action bar. 
 | 
android.content.Context | 
getThemedContext()
Returns a  
Context with an appropriate theme for creating views that
 will appear in the action bar. | 
CharSequence | 
getTitle()
Returns the current ActionBar title in standard mode. 
 | 
void | 
hide()
Hide the ActionBar if it is currently showing. 
 | 
boolean | 
isShowing()  | 
ActionBar.Tab | 
newTab()
Create and return a new  
ActionBar.Tab. | 
void | 
onConfigurationChanged(android.content.res.Configuration newConfig)  | 
void | 
removeAllTabs()
Remove all tabs from the action bar and deselect the current tab. 
 | 
void | 
removeOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
Remove a menu visibility listener. 
 | 
void | 
removeTab(ActionBar.Tab tab)
Remove a tab from the action bar. 
 | 
void | 
removeTabAt(int position)
Remove a tab from the action bar. 
 | 
void | 
selectTab(ActionBar.Tab tab)
Select the specified tab. 
 | 
void | 
setBackgroundDrawable(android.graphics.drawable.Drawable d)
Set the ActionBar's background. 
 | 
void | 
setCustomView(int resId)
Set the action bar into custom navigation mode, supplying a view
 for custom navigation. 
 | 
void | 
setCustomView(android.view.View view)
Set the action bar into custom navigation mode, supplying a view
 for custom navigation. 
 | 
void | 
setCustomView(android.view.View view,
             ActionBar.LayoutParams layoutParams)
Set the action bar into custom navigation mode, supplying a view
 for custom navigation. 
 | 
void | 
setDisplayHomeAsUpEnabled(boolean showHomeAsUp)
Set whether home should be displayed as an "up" affordance. 
 | 
void | 
setDisplayOptions(int options)
Set display options. 
 | 
void | 
setDisplayOptions(int options,
                 int mask)
Set selected display options. 
 | 
void | 
setDisplayShowCustomEnabled(boolean showCustom)
Set whether a custom view should be displayed, if set. 
 | 
void | 
setDisplayShowHomeEnabled(boolean showHome)
Set whether to include the application home affordance in the action bar. 
 | 
void | 
setDisplayShowTitleEnabled(boolean showTitle)
Set whether an activity title/subtitle should be displayed. 
 | 
void | 
setDisplayUseLogoEnabled(boolean useLogo)
Set whether to display the activity logo rather than the activity icon. 
 | 
void | 
setHomeButtonEnabled(boolean enable)
Enable or disable the "home" button in the corner of the action bar. 
 | 
void | 
setIcon(android.graphics.drawable.Drawable icon)
Set the icon to display in the 'home' section of the action bar. 
 | 
void | 
setIcon(int resId)
Set the icon to display in the 'home' section of the action bar. 
 | 
void | 
setListNavigationCallbacks(android.widget.SpinnerAdapter adapter,
                          ActionBar.OnNavigationListener callback)
Set the adapter and navigation callback for list navigation mode. 
 | 
void | 
setLogo(android.graphics.drawable.Drawable logo)
Set the logo to display in the 'home' section of the action bar. 
 | 
void | 
setLogo(int resId)
Set the logo to display in the 'home' section of the action bar. 
 | 
void | 
setNavigationMode(int mode)
Set the current navigation mode. 
 | 
void | 
setSelectedNavigationItem(int position)
Set the selected navigation item in list or tabbed navigation modes. 
 | 
void | 
setShowHideAnimationEnabled(boolean enabled)
Enables or disables animation between show/hide states. 
 | 
void | 
setSplitBackgroundDrawable(android.graphics.drawable.Drawable d)
Set the ActionBar's split background. 
 | 
void | 
setStackedBackgroundDrawable(android.graphics.drawable.Drawable d)
Set the ActionBar's stacked background. 
 | 
void | 
setSubtitle(CharSequence subtitle)
Set the action bar's subtitle. 
 | 
void | 
setSubtitle(int resId)
Set the action bar's subtitle. 
 | 
void | 
setTitle(CharSequence title)
Set the action bar's title. 
 | 
void | 
setTitle(int resId)
Set the action bar's title. 
 | 
void | 
show()
Show the ActionBar if it is not currently showing. 
 | 
ActionMode | 
startActionMode(ActionMode.Callback callback)  | 
public ActionBarImpl(android.app.Activity activity,
                     int features)
public ActionBarImpl(android.app.Dialog dialog)
public void onConfigurationChanged(android.content.res.Configuration newConfig)
public void setShowHideAnimationEnabled(boolean enabled)
enabled - true to animate, false to not animate.public void addOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
ActionBaraddOnMenuVisibilityListener in class ActionBarlistener - The new listener to addpublic void removeOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
ActionBarremoveOnMenuVisibilityListener in class ActionBarlistener - A listener to remove that was previously addedpublic void dispatchMenuVisibilityChanged(boolean isVisible)
public void setCustomView(int resId)
ActionBarCustom navigation views appear between the application icon and any action buttons and may use any space available there. Common use cases for custom navigation views might include an auto-suggesting address bar for a browser or other navigation mechanisms that do not translate well to provided navigation modes.
The display option ActionBar.DISPLAY_SHOW_CUSTOM must be set for
 the custom view to be displayed.
setCustomView in class ActionBarresId - Resource ID of a layout to inflate into the ActionBar.ActionBar.setDisplayOptions(int, int)public void setDisplayUseLogoEnabled(boolean useLogo)
ActionBarTo set several display options at once, see the setDisplayOptions methods.
setDisplayUseLogoEnabled in class ActionBaruseLogo - true to use the activity logo, false to use the activity icon.ActionBar.setDisplayOptions(int), 
ActionBar.setDisplayOptions(int, int)public void setDisplayShowHomeEnabled(boolean showHome)
ActionBarTo set several display options at once, see the setDisplayOptions methods.
setDisplayShowHomeEnabled in class ActionBarshowHome - true to show home, false otherwise.ActionBar.setDisplayOptions(int), 
ActionBar.setDisplayOptions(int, int)public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp)
ActionBarTo set several display options at once, see the setDisplayOptions methods.
setDisplayHomeAsUpEnabled in class ActionBarshowHomeAsUp - true to show the user that selecting home will return one
                     level up rather than to the top level of the app.ActionBar.setDisplayOptions(int), 
ActionBar.setDisplayOptions(int, int)public void setDisplayShowTitleEnabled(boolean showTitle)
ActionBarTo set several display options at once, see the setDisplayOptions methods.
setDisplayShowTitleEnabled in class ActionBarshowTitle - true to display a title/subtitle if present.ActionBar.setDisplayOptions(int), 
ActionBar.setDisplayOptions(int, int)public void setDisplayShowCustomEnabled(boolean showCustom)
ActionBarTo set several display options at once, see the setDisplayOptions methods.
setDisplayShowCustomEnabled in class ActionBarshowCustom - true if the currently set custom view should be displayed, false otherwise.ActionBar.setDisplayOptions(int), 
ActionBar.setDisplayOptions(int, int)public void setHomeButtonEnabled(boolean enable)
ActionBarThis defaults to true for packages targeting < API 14. For packages targeting API 14 or greater, the application should call this method to enable interaction with the home/up affordance.
Setting the ActionBar.DISPLAY_HOME_AS_UP display option will automatically enable
 the home button.
setHomeButtonEnabled in class ActionBarenable - true to enable the home button, false to disable the home button.public void setTitle(int resId)
ActionBarActionBar.DISPLAY_SHOW_TITLE is set.setTitle in class ActionBarresId - Resource ID of title string to setActionBar.setTitle(CharSequence), 
ActionBar.setDisplayOptions(int, int)public void setSubtitle(int resId)
ActionBarActionBar.DISPLAY_SHOW_TITLE is set.setSubtitle in class ActionBarresId - Resource ID of subtitle string to setActionBar.setSubtitle(CharSequence), 
ActionBar.setDisplayOptions(int, int)public void setSelectedNavigationItem(int position)
ActionBarsetSelectedNavigationItem in class ActionBarposition - Position of the item to select.public void removeAllTabs()
ActionBarremoveAllTabs in class ActionBarpublic void setTitle(CharSequence title)
ActionBarActionBar.DISPLAY_SHOW_TITLE is set.setTitle in class ActionBartitle - Title to setActionBar.setTitle(int), 
ActionBar.setDisplayOptions(int, int)public void setSubtitle(CharSequence subtitle)
ActionBarActionBar.DISPLAY_SHOW_TITLE is set. Set to null to disable the
 subtitle entirely.setSubtitle in class ActionBarsubtitle - Subtitle to setActionBar.setSubtitle(int), 
ActionBar.setDisplayOptions(int, int)public void setDisplayOptions(int options)
ActionBarActionBar.setDisplayOptions(int, int).setDisplayOptions in class ActionBaroptions - A combination of the bits defined by the DISPLAY_ constants
                defined in ActionBar.public void setDisplayOptions(int options,
                              int mask)
ActionBarActionBar.setDisplayOptions(int).
 Example: setDisplayOptions(0, DISPLAY_SHOW_HOME) will disable the
 ActionBar.DISPLAY_SHOW_HOME option.
 setDisplayOptions(DISPLAY_SHOW_HOME, DISPLAY_SHOW_HOME | DISPLAY_USE_LOGO)
 will enable ActionBar.DISPLAY_SHOW_HOME and disable ActionBar.DISPLAY_USE_LOGO.
setDisplayOptions in class ActionBaroptions - A combination of the bits defined by the DISPLAY_ constants
                defined in ActionBar.mask - A bit mask declaring which display options should be changed.public void setBackgroundDrawable(android.graphics.drawable.Drawable d)
ActionBarsetBackgroundDrawable in class ActionBard - Background drawableActionBar.setStackedBackgroundDrawable(Drawable), 
ActionBar.setSplitBackgroundDrawable(Drawable)public void setStackedBackgroundDrawable(android.graphics.drawable.Drawable d)
ActionBarsetStackedBackgroundDrawable in class ActionBard - Background drawable for the stacked rowpublic void setSplitBackgroundDrawable(android.graphics.drawable.Drawable d)
ActionBarYou can enable split action bar with R.attr.uiOptions
setSplitBackgroundDrawable in class ActionBard - Background drawable for the split barpublic android.view.View getCustomView()
getCustomView in class ActionBarpublic CharSequence getTitle()
ActionBarActionBar.getNavigationMode() would not return
 ActionBar.NAVIGATION_MODE_STANDARD.public CharSequence getSubtitle()
ActionBarActionBar.getNavigationMode() would not return
 ActionBar.NAVIGATION_MODE_STANDARD.getSubtitle in class ActionBarpublic int getNavigationMode()
ActionBargetNavigationMode in class ActionBarpublic int getDisplayOptions()
getDisplayOptions in class ActionBarpublic ActionMode startActionMode(ActionMode.Callback callback)
public void addTab(ActionBar.Tab tab)
ActionBarpublic void addTab(ActionBar.Tab tab, int position)
ActionBarposition. If this is the first tab to be added it will become
 the selected tab.public void addTab(ActionBar.Tab tab, boolean setSelected)
ActionBarpublic void addTab(ActionBar.Tab tab, int position, boolean setSelected)
ActionBarposition.public ActionBar.Tab newTab()
ActionBarActionBar.Tab.
 This tab will not be included in the action bar until it is added.
 Very often tabs will be used to switch between Fragment
 objects.  Here is a typical implementation of such tabs:
newTab in class ActionBarActionBar.addTab(Tab)public void removeTab(ActionBar.Tab tab)
ActionBarpublic void removeTabAt(int position)
ActionBarremoveTabAt in class ActionBarposition - Position of the tab to removepublic void selectTab(ActionBar.Tab tab)
ActionBarNote: If you want to select by index, use ActionBar.setSelectedNavigationItem(int).
public ActionBar.Tab getSelectedTab()
ActionBargetSelectedTab in class ActionBarpublic int getHeight()
ActionBarpublic void show()
ActionBarWindow#FEATURE_ACTION_BAR_OVERLAY it will resize application
 content to fit the new space available.public void hide()
ActionBarWindow#FEATURE_ACTION_BAR_OVERLAY it will resize application
 content to fit the new space available.public boolean isShowing()
public android.content.Context getThemedContext()
ActionBarContext with an appropriate theme for creating views that
 will appear in the action bar. If you are inflating or instantiating custom views
 that will appear in an action bar, you should use the Context returned by this method.
 (This includes adapters used for list navigation mode.)
 This will ensure that views contrast properly against the action bar.getThemedContext in class ActionBarpublic void setCustomView(android.view.View view)
ActionBarsetCustomView in class ActionBarview - Custom navigation view to place in the ActionBar.public void setCustomView(android.view.View view,
                          ActionBar.LayoutParams layoutParams)
ActionBarCustom navigation views appear between the application icon and any action buttons and may use any space available there. Common use cases for custom navigation views might include an auto-suggesting address bar for a browser or other navigation mechanisms that do not translate well to provided navigation modes.
The display option ActionBar.DISPLAY_SHOW_CUSTOM must be set for
 the custom view to be displayed.
setCustomView in class ActionBarview - Custom navigation view to place in the ActionBar.layoutParams - How this custom view should layout in the bar.ActionBar.setDisplayOptions(int, int)public void setListNavigationCallbacks(android.widget.SpinnerAdapter adapter,
                                       ActionBar.OnNavigationListener callback)
ActionBarsetListNavigationCallbacks in class ActionBaradapter - An adapter that will provide views both to display
                the current navigation selection and populate views
                within the dropdown navigation menu.callback - An OnNavigationListener that will receive events when the user
                 selects a navigation item.public int getSelectedNavigationIndex()
ActionBargetSelectedNavigationIndex in class ActionBarpublic int getNavigationItemCount()
ActionBargetNavigationItemCount in class ActionBarpublic int getTabCount()
ActionBargetTabCount in class ActionBarpublic void setNavigationMode(int mode)
ActionBarsetNavigationMode in class ActionBarmode - The new mode to set.ActionBar.NAVIGATION_MODE_STANDARD, 
ActionBar.NAVIGATION_MODE_LIST, 
ActionBar.NAVIGATION_MODE_TABSpublic ActionBar.Tab getTabAt(int index)
ActionBarpublic void setIcon(int resId)
ActionBarActionBar.DISPLAY_USE_LOGO.setIcon in class ActionBarresId - Resource ID of a drawable to show as an icon.ActionBar.setDisplayUseLogoEnabled(boolean), 
ActionBar.setDisplayShowHomeEnabled(boolean)public void setIcon(android.graphics.drawable.Drawable icon)
ActionBarActionBar.DISPLAY_USE_LOGO.setIcon in class ActionBaricon - Drawable to show as an icon.ActionBar.setDisplayUseLogoEnabled(boolean), 
ActionBar.setDisplayShowHomeEnabled(boolean)public void setLogo(int resId)
ActionBarActionBar.DISPLAY_USE_LOGO.setLogo in class ActionBarresId - Resource ID of a drawable to show as a logo.ActionBar.setDisplayUseLogoEnabled(boolean), 
ActionBar.setDisplayShowHomeEnabled(boolean)public void setLogo(android.graphics.drawable.Drawable logo)
ActionBarActionBar.DISPLAY_USE_LOGO.setLogo in class ActionBarlogo - Drawable to show as a logo.ActionBar.setDisplayUseLogoEnabled(boolean), 
ActionBar.setDisplayShowHomeEnabled(boolean)Copyright © 2011–2014. All rights reserved.