com.actionbarsherlock.internal.app
Class ActionBarImpl

java.lang.Object
  extended by com.actionbarsherlock.app.ActionBar
      extended by com.actionbarsherlock.internal.app.ActionBarImpl

public class ActionBarImpl
extends ActionBar

ActionBarImpl is the ActionBar implementation used by devices of all screen sizes. If it detects a compatible decor, it will split contextual modes across both the ActionBarView at the top of the screen and a horizontal LinearLayout at the bottom which is normally hidden.


Nested Class Summary
 class ActionBarImpl.ActionModeImpl
           
 class ActionBarImpl.TabImpl
           
 
Nested classes/interfaces inherited from class com.actionbarsherlock.app.ActionBar
ActionBar.LayoutParams, ActionBar.OnMenuVisibilityListener, ActionBar.OnNavigationListener, ActionBar.Tab, ActionBar.TabListener
 
Field Summary
 
Fields inherited from class com.actionbarsherlock.app.ActionBar
DISPLAY_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 Summary
ActionBarImpl(android.app.Activity activity, int features)
           
ActionBarImpl(android.app.Dialog dialog)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionBarImpl

public ActionBarImpl(android.app.Activity activity,
                     int features)

ActionBarImpl

public ActionBarImpl(android.app.Dialog dialog)
Method Detail

onConfigurationChanged

public void onConfigurationChanged(android.content.res.Configuration newConfig)

setShowHideAnimationEnabled

public void setShowHideAnimationEnabled(boolean enabled)
Enables or disables animation between show/hide states. If animation is disabled using this method, animations in progress will be finished.

Parameters:
enabled - true to animate, false to not animate.

addOnMenuVisibilityListener

public void addOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
Description copied from class: ActionBar
Add a listener that will respond to menu visibility change events.

Specified by:
addOnMenuVisibilityListener in class ActionBar
Parameters:
listener - The new listener to add

removeOnMenuVisibilityListener

public void removeOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
Description copied from class: ActionBar
Remove a menu visibility listener. This listener will no longer receive menu visibility change events.

Specified by:
removeOnMenuVisibilityListener in class ActionBar
Parameters:
listener - A listener to remove that was previously added

dispatchMenuVisibilityChanged

public void dispatchMenuVisibilityChanged(boolean isVisible)

setCustomView

public void setCustomView(int resId)
Description copied from class: ActionBar
Set the action bar into custom navigation mode, supplying a view for custom navigation.

Custom 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.

Specified by:
setCustomView in class ActionBar
Parameters:
resId - Resource ID of a layout to inflate into the ActionBar.
See Also:
ActionBar.setDisplayOptions(int, int)

setDisplayUseLogoEnabled

public void setDisplayUseLogoEnabled(boolean useLogo)
Description copied from class: ActionBar
Set whether to display the activity logo rather than the activity icon. A logo is often a wider, more detailed image.

To set several display options at once, see the setDisplayOptions methods.

Specified by:
setDisplayUseLogoEnabled in class ActionBar
Parameters:
useLogo - true to use the activity logo, false to use the activity icon.
See Also:
ActionBar.setDisplayOptions(int), ActionBar.setDisplayOptions(int, int)

setDisplayShowHomeEnabled

public void setDisplayShowHomeEnabled(boolean showHome)
Description copied from class: ActionBar
Set whether to include the application home affordance in the action bar. Home is presented as either an activity icon or logo.

To set several display options at once, see the setDisplayOptions methods.

Specified by:
setDisplayShowHomeEnabled in class ActionBar
Parameters:
showHome - true to show home, false otherwise.
See Also:
ActionBar.setDisplayOptions(int), ActionBar.setDisplayOptions(int, int)

setDisplayHomeAsUpEnabled

public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp)
Description copied from class: ActionBar
Set whether home should be displayed as an "up" affordance. Set this to true if selecting "home" returns up by a single level in your UI rather than back to the top level or front page.

To set several display options at once, see the setDisplayOptions methods.

Specified by:
setDisplayHomeAsUpEnabled in class ActionBar
Parameters:
showHomeAsUp - true to show the user that selecting home will return one level up rather than to the top level of the app.
See Also:
ActionBar.setDisplayOptions(int), ActionBar.setDisplayOptions(int, int)

setDisplayShowTitleEnabled

public void setDisplayShowTitleEnabled(boolean showTitle)
Description copied from class: ActionBar
Set whether an activity title/subtitle should be displayed.

To set several display options at once, see the setDisplayOptions methods.

Specified by:
setDisplayShowTitleEnabled in class ActionBar
Parameters:
showTitle - true to display a title/subtitle if present.
See Also:
ActionBar.setDisplayOptions(int), ActionBar.setDisplayOptions(int, int)

setDisplayShowCustomEnabled

public void setDisplayShowCustomEnabled(boolean showCustom)
Description copied from class: ActionBar
Set whether a custom view should be displayed, if set.

To set several display options at once, see the setDisplayOptions methods.

Specified by:
setDisplayShowCustomEnabled in class ActionBar
Parameters:
showCustom - true if the currently set custom view should be displayed, false otherwise.
See Also:
ActionBar.setDisplayOptions(int), ActionBar.setDisplayOptions(int, int)

setHomeButtonEnabled

public void setHomeButtonEnabled(boolean enable)
Description copied from class: ActionBar
Enable or disable the "home" button in the corner of the action bar. (Note that this is the application home/up affordance on the action bar, not the systemwide home button.)

This 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.

Overrides:
setHomeButtonEnabled in class ActionBar
Parameters:
enable - true to enable the home button, false to disable the home button.

setTitle

public void setTitle(int resId)
Description copied from class: ActionBar
Set the action bar's title. This will only be displayed if ActionBar.DISPLAY_SHOW_TITLE is set.

Specified by:
setTitle in class ActionBar
Parameters:
resId - Resource ID of title string to set
See Also:
ActionBar.setTitle(CharSequence), ActionBar.setDisplayOptions(int, int)

setSubtitle

public void setSubtitle(int resId)
Description copied from class: ActionBar
Set the action bar's subtitle. This will only be displayed if ActionBar.DISPLAY_SHOW_TITLE is set.

Specified by:
setSubtitle in class ActionBar
Parameters:
resId - Resource ID of subtitle string to set
See Also:
ActionBar.setSubtitle(CharSequence), ActionBar.setDisplayOptions(int, int)

setSelectedNavigationItem

public void setSelectedNavigationItem(int position)
Description copied from class: ActionBar
Set the selected navigation item in list or tabbed navigation modes.

Specified by:
setSelectedNavigationItem in class ActionBar
Parameters:
position - Position of the item to select.

removeAllTabs

public void removeAllTabs()
Description copied from class: ActionBar
Remove all tabs from the action bar and deselect the current tab.

Specified by:
removeAllTabs in class ActionBar

setTitle

public void setTitle(CharSequence title)
Description copied from class: ActionBar
Set the action bar's title. This will only be displayed if ActionBar.DISPLAY_SHOW_TITLE is set.

Specified by:
setTitle in class ActionBar
Parameters:
title - Title to set
See Also:
ActionBar.setTitle(int), ActionBar.setDisplayOptions(int, int)

setSubtitle

public void setSubtitle(CharSequence subtitle)
Description copied from class: ActionBar
Set the action bar's subtitle. This will only be displayed if ActionBar.DISPLAY_SHOW_TITLE is set. Set to null to disable the subtitle entirely.

Specified by:
setSubtitle in class ActionBar
Parameters:
subtitle - Subtitle to set
See Also:
ActionBar.setSubtitle(int), ActionBar.setDisplayOptions(int, int)

setDisplayOptions

public void setDisplayOptions(int options)
Description copied from class: ActionBar
Set display options. This changes all display option bits at once. To change a limited subset of display options, see ActionBar.setDisplayOptions(int, int).

Specified by:
setDisplayOptions in class ActionBar
Parameters:
options - A combination of the bits defined by the DISPLAY_ constants defined in ActionBar.

setDisplayOptions

public void setDisplayOptions(int options,
                              int mask)
Description copied from class: ActionBar
Set selected display options. Only the options specified by mask will be changed. To change all display option bits at once, see ActionBar.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.

Specified by:
setDisplayOptions in class ActionBar
Parameters:
options - A combination of the bits defined by the DISPLAY_ constants defined in ActionBar.
mask - A bit mask declaring which display options should be changed.

setBackgroundDrawable

public void setBackgroundDrawable(android.graphics.drawable.Drawable d)
Description copied from class: ActionBar
Set the ActionBar's background. This will be used for the primary action bar.

Specified by:
setBackgroundDrawable in class ActionBar
Parameters:
d - Background drawable
See Also:
ActionBar.setStackedBackgroundDrawable(Drawable), ActionBar.setSplitBackgroundDrawable(Drawable)

setStackedBackgroundDrawable

public void setStackedBackgroundDrawable(android.graphics.drawable.Drawable d)
Description copied from class: ActionBar
Set the ActionBar's stacked background. This will appear in the second row/stacked bar on some devices and configurations.

Overrides:
setStackedBackgroundDrawable in class ActionBar
Parameters:
d - Background drawable for the stacked row

setSplitBackgroundDrawable

public void setSplitBackgroundDrawable(android.graphics.drawable.Drawable d)
Description copied from class: ActionBar
Set the ActionBar's split background. This will appear in the split action bar containing menu-provided action buttons on some devices and configurations.

You can enable split action bar with R.attr.uiOptions

Overrides:
setSplitBackgroundDrawable in class ActionBar
Parameters:
d - Background drawable for the split bar

getCustomView

public android.view.View getCustomView()
Specified by:
getCustomView in class ActionBar
Returns:
The current custom view.

getTitle

public CharSequence getTitle()
Description copied from class: ActionBar
Returns the current ActionBar title in standard mode. Returns null if ActionBar.getNavigationMode() would not return ActionBar.NAVIGATION_MODE_STANDARD.

Specified by:
getTitle in class ActionBar
Returns:
The current ActionBar title or null.

getSubtitle

public CharSequence getSubtitle()
Description copied from class: ActionBar
Returns the current ActionBar subtitle in standard mode. Returns null if ActionBar.getNavigationMode() would not return ActionBar.NAVIGATION_MODE_STANDARD.

Specified by:
getSubtitle in class ActionBar
Returns:
The current ActionBar subtitle or null.

getNavigationMode

public int getNavigationMode()
Description copied from class: ActionBar
Returns the current navigation mode. The result will be one of:

Specified by:
getNavigationMode in class ActionBar
Returns:
The current navigation mode.

getDisplayOptions

public int getDisplayOptions()
Specified by:
getDisplayOptions in class ActionBar
Returns:
The current set of display options.

startActionMode

public ActionMode startActionMode(ActionMode.Callback callback)

addTab

public void addTab(ActionBar.Tab tab)
Description copied from class: ActionBar
Add a tab for use in tabbed navigation mode. The tab will be added at the end of the list. If this is the first tab to be added it will become the selected tab.

Specified by:
addTab in class ActionBar
Parameters:
tab - Tab to add

addTab

public void addTab(ActionBar.Tab tab,
                   int position)
Description copied from class: ActionBar
Add a tab for use in tabbed navigation mode. The tab will be inserted at position. If this is the first tab to be added it will become the selected tab.

Specified by:
addTab in class ActionBar
Parameters:
tab - The tab to add
position - The new position of the tab

addTab

public void addTab(ActionBar.Tab tab,
                   boolean setSelected)
Description copied from class: ActionBar
Add a tab for use in tabbed navigation mode. The tab will be added at the end of the list.

Specified by:
addTab in class ActionBar
Parameters:
tab - Tab to add
setSelected - True if the added tab should become the selected tab.

addTab

public void addTab(ActionBar.Tab tab,
                   int position,
                   boolean setSelected)
Description copied from class: ActionBar
Add a tab for use in tabbed navigation mode. The tab will be insterted at position.

Specified by:
addTab in class ActionBar
Parameters:
tab - The tab to add
position - The new position of the tab
setSelected - True if the added tab should become the selected tab.

newTab

public ActionBar.Tab newTab()
Description copied from class: ActionBar
Create and return a new ActionBar.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:

Specified by:
newTab in class ActionBar
Returns:
A new Tab
See Also:
ActionBar.addTab(Tab)

removeTab

public void removeTab(ActionBar.Tab tab)
Description copied from class: ActionBar
Remove a tab from the action bar. If the removed tab was selected it will be deselected and another tab will be selected if present.

Specified by:
removeTab in class ActionBar
Parameters:
tab - The tab to remove

removeTabAt

public void removeTabAt(int position)
Description copied from class: ActionBar
Remove a tab from the action bar. If the removed tab was selected it will be deselected and another tab will be selected if present.

Specified by:
removeTabAt in class ActionBar
Parameters:
position - Position of the tab to remove

selectTab

public void selectTab(ActionBar.Tab tab)
Description copied from class: ActionBar
Select the specified tab. If it is not a child of this action bar it will be added.

Note: If you want to select by index, use ActionBar.setSelectedNavigationItem(int).

Specified by:
selectTab in class ActionBar
Parameters:
tab - Tab to select

getSelectedTab

public ActionBar.Tab getSelectedTab()
Description copied from class: ActionBar
Returns the currently selected tab if in tabbed navigation mode and there is at least one tab present.

Specified by:
getSelectedTab in class ActionBar
Returns:
The currently selected tab or null

getHeight

public int getHeight()
Description copied from class: ActionBar
Retrieve the current height of the ActionBar.

Specified by:
getHeight in class ActionBar
Returns:
The ActionBar's height

show

public void show()
Description copied from class: ActionBar
Show the ActionBar if it is not currently showing. If the window hosting the ActionBar does not have the feature Window#FEATURE_ACTION_BAR_OVERLAY it will resize application content to fit the new space available.

Specified by:
show in class ActionBar

hide

public void hide()
Description copied from class: ActionBar
Hide the ActionBar if it is currently showing. If the window hosting the ActionBar does not have the feature Window#FEATURE_ACTION_BAR_OVERLAY it will resize application content to fit the new space available.

Specified by:
hide in class ActionBar

isShowing

public boolean isShowing()
Specified by:
isShowing in class ActionBar
Returns:
true if the ActionBar is showing, false otherwise.

getThemedContext

public android.content.Context getThemedContext()
Description copied from class: ActionBar
Returns a Context 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.

Overrides:
getThemedContext in class ActionBar
Returns:
A themed Context for creating views

setCustomView

public void setCustomView(android.view.View view)
Description copied from class: ActionBar
Set the action bar into custom navigation mode, supplying a view for custom navigation. Custom 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.

Specified by:
setCustomView in class ActionBar
Parameters:
view - Custom navigation view to place in the ActionBar.

setCustomView

public void setCustomView(android.view.View view,
                          ActionBar.LayoutParams layoutParams)
Description copied from class: ActionBar
Set the action bar into custom navigation mode, supplying a view for custom navigation.

Custom 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.

Specified by:
setCustomView in class ActionBar
Parameters:
view - Custom navigation view to place in the ActionBar.
layoutParams - How this custom view should layout in the bar.
See Also:
ActionBar.setDisplayOptions(int, int)

setListNavigationCallbacks

public void setListNavigationCallbacks(android.widget.SpinnerAdapter adapter,
                                       ActionBar.OnNavigationListener callback)
Description copied from class: ActionBar
Set the adapter and navigation callback for list navigation mode. The supplied adapter will provide views for the expanded list as well as the currently selected item. (These may be displayed differently.) The supplied OnNavigationListener will alert the application when the user changes the current list selection.

Specified by:
setListNavigationCallbacks in class ActionBar
Parameters:
adapter - 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.

getSelectedNavigationIndex

public int getSelectedNavigationIndex()
Description copied from class: ActionBar
Get the position of the selected navigation item in list or tabbed navigation modes.

Specified by:
getSelectedNavigationIndex in class ActionBar
Returns:
Position of the selected item.

getNavigationItemCount

public int getNavigationItemCount()
Description copied from class: ActionBar
Get the number of navigation items present in the current navigation mode.

Specified by:
getNavigationItemCount in class ActionBar
Returns:
Number of navigation items.

getTabCount

public int getTabCount()
Description copied from class: ActionBar
Returns the number of tabs currently registered with the action bar.

Specified by:
getTabCount in class ActionBar
Returns:
Tab count

setNavigationMode

public void setNavigationMode(int mode)
Description copied from class: ActionBar
Set the current navigation mode.

Specified by:
setNavigationMode in class ActionBar
Parameters:
mode - The new mode to set.
See Also:
ActionBar.NAVIGATION_MODE_STANDARD, ActionBar.NAVIGATION_MODE_LIST, ActionBar.NAVIGATION_MODE_TABS

getTabAt

public ActionBar.Tab getTabAt(int index)
Description copied from class: ActionBar
Returns the tab at the specified index.

Specified by:
getTabAt in class ActionBar
Parameters:
index - Index value in the range 0-get
Returns:

setIcon

public void setIcon(int resId)
Description copied from class: ActionBar
Set the icon to display in the 'home' section of the action bar. The action bar will use an icon specified by its style or the activity icon by default. Whether the home section shows an icon or logo is controlled by the display option ActionBar.DISPLAY_USE_LOGO.

Specified by:
setIcon in class ActionBar
Parameters:
resId - Resource ID of a drawable to show as an icon.
See Also:
ActionBar.setDisplayUseLogoEnabled(boolean), ActionBar.setDisplayShowHomeEnabled(boolean)

setIcon

public void setIcon(android.graphics.drawable.Drawable icon)
Description copied from class: ActionBar
Set the icon to display in the 'home' section of the action bar. The action bar will use an icon specified by its style or the activity icon by default. Whether the home section shows an icon or logo is controlled by the display option ActionBar.DISPLAY_USE_LOGO.

Specified by:
setIcon in class ActionBar
Parameters:
icon - Drawable to show as an icon.
See Also:
ActionBar.setDisplayUseLogoEnabled(boolean), ActionBar.setDisplayShowHomeEnabled(boolean)

setLogo

public void setLogo(int resId)
Description copied from class: ActionBar
Set the logo to display in the 'home' section of the action bar. The action bar will use a logo specified by its style or the activity logo by default. Whether the home section shows an icon or logo is controlled by the display option ActionBar.DISPLAY_USE_LOGO.

Specified by:
setLogo in class ActionBar
Parameters:
resId - Resource ID of a drawable to show as a logo.
See Also:
ActionBar.setDisplayUseLogoEnabled(boolean), ActionBar.setDisplayShowHomeEnabled(boolean)

setLogo

public void setLogo(android.graphics.drawable.Drawable logo)
Description copied from class: ActionBar
Set the logo to display in the 'home' section of the action bar. The action bar will use a logo specified by its style or the activity logo by default. Whether the home section shows an icon or logo is controlled by the display option ActionBar.DISPLAY_USE_LOGO.

Specified by:
setLogo in class ActionBar
Parameters:
logo - Drawable to show as a logo.
See Also:
ActionBar.setDisplayUseLogoEnabled(boolean), ActionBar.setDisplayShowHomeEnabled(boolean)


Copyright © 2012-2013. All Rights Reserved.