public class WindowDecorActionBar extends ActionBar implements ActionBarOverlayLayout.ActionBarVisibilityCallback
Modifier and Type | Class and Description |
---|---|
class |
WindowDecorActionBar.ActionModeImpl |
class |
WindowDecorActionBar.TabImpl |
ActionBar.DisplayOptions, ActionBar.LayoutParams, ActionBar.NavigationMode, ActionBar.OnMenuVisibilityListener, ActionBar.OnNavigationListener, ActionBar.Tab, ActionBar.TabListener
DISPLAY_HOME_AS_UP, DISPLAY_SHOW_CUSTOM, DISPLAY_SHOW_HOME, DISPLAY_SHOW_TITLE, DISPLAY_TITLE_MULTIPLE_LINES, DISPLAY_USE_LOGO, NAVIGATION_MODE_LIST, NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_TABS
Constructor and Description |
---|
WindowDecorActionBar(Activity activity) |
WindowDecorActionBar(Dialog dialog) |
WindowDecorActionBar(View layout)
Only for edit mode.
|
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.
|
boolean |
collapseActionView() |
void |
dispatchMenuVisibilityChanged(boolean isVisible) |
void |
doHide(boolean fromSystem) |
void |
doShow(boolean fromSystem) |
void |
enableContentAnimations(boolean enabled) |
View |
getCustomView() |
int |
getDisplayOptions() |
float |
getElevation()
Get the Z-axis elevation of the action bar in pixels.
|
int |
getHeight()
Retrieve the current height of the ActionBar.
|
int |
getHideOffset()
Return the current vertical offset of the action bar.
|
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.
|
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.
|
boolean |
hasIcon() |
boolean |
hasLogo() |
void |
hide()
Hide the ActionBar if it is currently showing.
|
void |
hideForSystem() |
boolean |
isHideOnContentScrollEnabled()
Return whether the action bar is configured to scroll out of sight along with
a
nested scrolling child . |
boolean |
isShowing() |
boolean |
isTitleTruncated()
Returns true if the Title field has been truncated during layout for lack
of available space.
|
ActionBar.Tab |
newTab()
Create and return a new
ActionBar.Tab . |
void |
onConfigurationChanged(Configuration newConfig) |
void |
onContentScrollStarted() |
void |
onContentScrollStopped() |
void |
onWindowVisibilityChanged(int visibility) |
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.
|
boolean |
requestFocus()
Attempts to move focus to the ActionBar if it does not already contain the focus.
|
void |
selectTab(ActionBar.Tab tab)
Select the specified tab.
|
void |
setBackgroundDrawable(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(View view)
Set the action bar into custom navigation mode, supplying a view
for custom navigation.
|
void |
setCustomView(View view,
ActionBar.LayoutParams layoutParams)
Set the action bar into custom navigation mode, supplying a view
for custom navigation.
|
void |
setDefaultDisplayHomeAsUpEnabled(boolean enable) |
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 |
setElevation(float elevation)
Set the Z-axis elevation of the action bar in pixels.
|
void |
setHideOffset(int offset)
Set the current hide offset of the action bar.
|
void |
setHideOnContentScrollEnabled(boolean hideOnContentScroll)
Enable hiding the action bar on content scroll.
|
void |
setHomeActionContentDescription(CharSequence description)
Set an alternate description for the Home/Up action, when enabled.
|
void |
setHomeActionContentDescription(int resId)
Set an alternate description for the Home/Up action, when enabled.
|
void |
setHomeAsUpIndicator(Drawable indicator)
Set an alternate drawable to display next to the icon/logo/title
when
ActionBar.DISPLAY_HOME_AS_UP is enabled. |
void |
setHomeAsUpIndicator(int resId)
Set an alternate drawable to display next to the icon/logo/title
when
ActionBar.DISPLAY_HOME_AS_UP is enabled. |
void |
setHomeButtonEnabled(boolean enable)
Enable or disable the "home" button in the corner of the action bar.
|
void |
setIcon(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(SpinnerAdapter adapter,
ActionBar.OnNavigationListener callback)
Set the adapter and navigation callback for list navigation mode.
|
void |
setLogo(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(Drawable d)
Set the ActionBar's split background.
|
void |
setStackedBackgroundDrawable(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 |
setWindowTitle(CharSequence title) |
void |
show()
Show the ActionBar if it is not currently showing.
|
void |
showForSystem() |
ActionMode |
startActionMode(ActionMode.Callback callback) |
invalidateOptionsMenu, onDestroy, onKeyShortcut, onMenuKeyEvent, openOptionsMenu, requestFocus
public WindowDecorActionBar(Activity activity)
public WindowDecorActionBar(Dialog dialog)
public WindowDecorActionBar(View layout)
public void setElevation(float elevation)
ActionBar
The action bar's elevation is the distance it is placed from its parent surface. Higher values are closer to the user.
setElevation
in class ActionBar
elevation
- Elevation value in pixelspublic float getElevation()
ActionBar
The action bar's elevation is the distance it is placed from its parent surface. Higher values are closer to the user.
getElevation
in class ActionBar
public void onConfigurationChanged(Configuration newConfig)
onConfigurationChanged
in class ActionBar
public void onWindowVisibilityChanged(int visibility)
onWindowVisibilityChanged
in interface ActionBarOverlayLayout.ActionBarVisibilityCallback
public void setShowHideAnimationEnabled(boolean enabled)
setShowHideAnimationEnabled
in class ActionBar
enabled
- true to animate, false to not animate.public void addOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
ActionBar
addOnMenuVisibilityListener
in class ActionBar
listener
- The new listener to addpublic void removeOnMenuVisibilityListener(ActionBar.OnMenuVisibilityListener listener)
ActionBar
removeOnMenuVisibilityListener
in class ActionBar
listener
- A listener to remove that was previously addedpublic void dispatchMenuVisibilityChanged(boolean isVisible)
dispatchMenuVisibilityChanged
in class ActionBar
public void setCustomView(int resId)
ActionBar
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.
setCustomView
in class ActionBar
resId
- Resource ID of a layout to inflate into the ActionBar.ActionBar.setDisplayOptions(int, int)
public void setDisplayUseLogoEnabled(boolean useLogo)
ActionBar
To set several display options at once, see the setDisplayOptions methods.
setDisplayUseLogoEnabled
in class ActionBar
useLogo
- true to use the activity logo, false to use the activity icon.ActionBar.setDisplayOptions(int)
,
ActionBar.setDisplayOptions(int, int)
public void setDisplayShowHomeEnabled(boolean showHome)
ActionBar
To set several display options at once, see the setDisplayOptions methods.
setDisplayShowHomeEnabled
in class ActionBar
showHome
- true to show home, false otherwise.ActionBar.setDisplayOptions(int)
,
ActionBar.setDisplayOptions(int, int)
public void setDisplayHomeAsUpEnabled(boolean showHomeAsUp)
ActionBar
To set several display options at once, see the setDisplayOptions methods.
setDisplayHomeAsUpEnabled
in class ActionBar
showHomeAsUp
- 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)
ActionBar
To set several display options at once, see the setDisplayOptions methods.
setDisplayShowTitleEnabled
in class ActionBar
showTitle
- true to display a title/subtitle if present.ActionBar.setDisplayOptions(int)
,
ActionBar.setDisplayOptions(int, int)
public void setDisplayShowCustomEnabled(boolean showCustom)
ActionBar
To set several display options at once, see the setDisplayOptions methods.
setDisplayShowCustomEnabled
in class ActionBar
showCustom
- true if the currently set custom view should be displayed, false otherwise.ActionBar.setDisplayOptions(int)
,
ActionBar.setDisplayOptions(int, int)
public void setHomeButtonEnabled(boolean enable)
ActionBar
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.
setHomeButtonEnabled
in class ActionBar
enable
- true to enable the home button, false to disable the home button.public void setTitle(int resId)
ActionBar
ActionBar.DISPLAY_SHOW_TITLE
is set.setTitle
in class ActionBar
resId
- Resource ID of title string to setActionBar.setTitle(CharSequence)
,
ActionBar.setDisplayOptions(int, int)
public void setSubtitle(int resId)
ActionBar
ActionBar.DISPLAY_SHOW_TITLE
is set.setSubtitle
in class ActionBar
resId
- Resource ID of subtitle string to setActionBar.setSubtitle(CharSequence)
,
ActionBar.setDisplayOptions(int, int)
public void setSelectedNavigationItem(int position)
ActionBar
setSelectedNavigationItem
in class ActionBar
position
- Position of the item to select.public void removeAllTabs()
ActionBar
removeAllTabs
in class ActionBar
public void setTitle(CharSequence title)
ActionBar
ActionBar.DISPLAY_SHOW_TITLE
is set.setTitle
in class ActionBar
title
- Title to setActionBar.setTitle(int)
,
ActionBar.setDisplayOptions(int, int)
public void setWindowTitle(CharSequence title)
setWindowTitle
in class ActionBar
public void setSubtitle(CharSequence subtitle)
ActionBar
ActionBar.DISPLAY_SHOW_TITLE
is set. Set to null to disable the
subtitle entirely.setSubtitle
in class ActionBar
subtitle
- Subtitle to setActionBar.setSubtitle(int)
,
ActionBar.setDisplayOptions(int, int)
public void setDisplayOptions(int options)
ActionBar
ActionBar.setDisplayOptions(int, int)
.setDisplayOptions
in class ActionBar
options
- A combination of the bits defined by the DISPLAY_ constants
defined in ActionBar.public void setDisplayOptions(int options, int mask)
ActionBar
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
.
setDisplayOptions
in class ActionBar
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.public void setBackgroundDrawable(Drawable d)
ActionBar
setBackgroundDrawable
in class ActionBar
d
- Background drawableActionBar.setStackedBackgroundDrawable(Drawable)
,
ActionBar.setSplitBackgroundDrawable(Drawable)
public void setStackedBackgroundDrawable(Drawable d)
ActionBar
setStackedBackgroundDrawable
in class ActionBar
d
- Background drawable for the stacked rowpublic void setSplitBackgroundDrawable(Drawable d)
ActionBar
You can enable split action bar with android.R.attr#uiOptions
setSplitBackgroundDrawable
in class ActionBar
d
- Background drawable for the split barpublic View getCustomView()
getCustomView
in class ActionBar
public CharSequence getTitle()
ActionBar
ActionBar.getNavigationMode()
would not return
ActionBar.NAVIGATION_MODE_STANDARD
.public CharSequence getSubtitle()
ActionBar
ActionBar.getNavigationMode()
would not return
ActionBar.NAVIGATION_MODE_STANDARD
.getSubtitle
in class ActionBar
public int getNavigationMode()
ActionBar
getNavigationMode
in class ActionBar
public int getDisplayOptions()
getDisplayOptions
in class ActionBar
public ActionMode startActionMode(ActionMode.Callback callback)
startActionMode
in class ActionBar
public void addTab(ActionBar.Tab tab)
ActionBar
public void addTab(ActionBar.Tab tab, int position)
ActionBar
position
. If this is the first tab to be added it will become
the selected tab.public void addTab(ActionBar.Tab tab, boolean setSelected)
ActionBar
public void addTab(ActionBar.Tab tab, int position, boolean setSelected)
ActionBar
position
.public ActionBar.Tab newTab()
ActionBar
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:
newTab
in class ActionBar
ActionBar.addTab(Tab)
public void removeTab(ActionBar.Tab tab)
ActionBar
public void removeTabAt(int position)
ActionBar
removeTabAt
in class ActionBar
position
- Position of the tab to removepublic void selectTab(ActionBar.Tab tab)
ActionBar
Note: If you want to select by index, use ActionBar.setSelectedNavigationItem(int)
.
public ActionBar.Tab getSelectedTab()
ActionBar
getSelectedTab
in class ActionBar
public int getHeight()
ActionBar
public void enableContentAnimations(boolean enabled)
enableContentAnimations
in interface ActionBarOverlayLayout.ActionBarVisibilityCallback
public void show()
ActionBar
Window.FEATURE_ACTION_BAR_OVERLAY
it will resize application
content to fit the new space available.
If you are hiding the ActionBar through
View.SYSTEM_UI_FLAG_FULLSCREEN
,
you should not call this function directly.
public void showForSystem()
showForSystem
in interface ActionBarOverlayLayout.ActionBarVisibilityCallback
public void hide()
ActionBar
Window.FEATURE_ACTION_BAR_OVERLAY
it will resize application
content to fit the new space available.
Instead of calling this function directly, you can also cause an
ActionBar using the overlay feature to hide through
View.SYSTEM_UI_FLAG_FULLSCREEN
.
Hiding the ActionBar through this system UI flag allows you to more
seamlessly hide it in conjunction with other screen decorations.
public void hideForSystem()
hideForSystem
in interface ActionBarOverlayLayout.ActionBarVisibilityCallback
public void setHideOnContentScrollEnabled(boolean hideOnContentScroll)
ActionBar
If enabled, the action bar will scroll out of sight along with a
nested scrolling child
view's content.
The action bar must be in overlay mode
to enable hiding on content scroll.
When partially scrolled off screen the action bar is considered
hidden
. A call to show
will cause it to return to full view.
setHideOnContentScrollEnabled
in class ActionBar
hideOnContentScroll
- true to enable hiding on content scroll.public boolean isHideOnContentScrollEnabled()
ActionBar
nested scrolling child
.isHideOnContentScrollEnabled
in class ActionBar
ActionBar.setHideOnContentScrollEnabled(boolean)
public int getHideOffset()
ActionBar
The action bar's current hide offset is the distance that the action bar is currently
scrolled offscreen in pixels. The valid range is 0 (fully visible) to the action bar's
current measured height
(fully invisible).
getHideOffset
in class ActionBar
public void setHideOffset(int offset)
ActionBar
The action bar's current hide offset is the distance that the action bar is currently
scrolled offscreen in pixels. The valid range is 0 (fully visible) to the action bar's
current measured height
(fully invisible).
setHideOffset
in class ActionBar
offset
- The action bar's offset toward its fully hidden state in pixels.public void doShow(boolean fromSystem)
public void doHide(boolean fromSystem)
public boolean isShowing()
public Context getThemedContext()
ActionBar
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.getThemedContext
in class ActionBar
public boolean isTitleTruncated()
ActionBar
isTitleTruncated
in class ActionBar
public void setHomeAsUpIndicator(Drawable indicator)
ActionBar
ActionBar.DISPLAY_HOME_AS_UP
is enabled. This can be useful if you are using
this mode to display an alternate selection for up navigation, such as a sliding drawer.
If you pass null
to this method, the default drawable from the theme
will be used.
If you implement alternate or intermediate behavior around Up, you should also
call setHomeActionContentDescription()
to provide a correct description of the action for accessibility support.
setHomeAsUpIndicator
in class ActionBar
indicator
- A drawable to use for the up indicator, or null to use the theme's defaultActionBar.setDisplayOptions(int, int)
,
ActionBar.setDisplayHomeAsUpEnabled(boolean)
,
ActionBar.setHomeActionContentDescription(int)
public void setHomeAsUpIndicator(int resId)
ActionBar
ActionBar.DISPLAY_HOME_AS_UP
is enabled. This can be useful if you are using
this mode to display an alternate selection for up navigation, such as a sliding drawer.
If you pass 0
to this method, the default drawable from the theme
will be used.
If you implement alternate or intermediate behavior around Up, you should also
call setHomeActionContentDescription()
to provide a correct description of the action for accessibility support.
setHomeAsUpIndicator
in class ActionBar
resId
- Resource ID of a drawable to use for the up indicator, or null
to use the theme's defaultActionBar.setDisplayOptions(int, int)
,
ActionBar.setDisplayHomeAsUpEnabled(boolean)
,
ActionBar.setHomeActionContentDescription(int)
public void setHomeActionContentDescription(CharSequence description)
ActionBar
This description is commonly used for accessibility/screen readers when
the Home action is enabled. (See ActionBar.setDisplayHomeAsUpEnabled(boolean)
.)
Examples of this are, "Navigate Home" or "Navigate Up" depending on the
ActionBar.DISPLAY_HOME_AS_UP
display option. If you have changed the home-as-up
indicator using ActionBar.setHomeAsUpIndicator(int)
to indicate more specific
functionality such as a sliding drawer, you should also set this to accurately
describe the action.
Setting this to null
will use the system default description.
setHomeActionContentDescription
in class ActionBar
description
- New description for the Home action when enabledActionBar.setHomeAsUpIndicator(int)
,
ActionBar.setHomeAsUpIndicator(android.graphics.drawable.Drawable)
public void setHomeActionContentDescription(int resId)
ActionBar
This description is commonly used for accessibility/screen readers when
the Home action is enabled. (See ActionBar.setDisplayHomeAsUpEnabled(boolean)
.)
Examples of this are, "Navigate Home" or "Navigate Up" depending on the
ActionBar.DISPLAY_HOME_AS_UP
display option. If you have changed the home-as-up
indicator using ActionBar.setHomeAsUpIndicator(int)
to indicate more specific
functionality such as a sliding drawer, you should also set this to accurately
describe the action.
Setting this to 0
will use the system default description.
setHomeActionContentDescription
in class ActionBar
resId
- Resource ID of a string to use as the new description
for the Home action when enabledActionBar.setHomeAsUpIndicator(int)
,
ActionBar.setHomeAsUpIndicator(android.graphics.drawable.Drawable)
public void onContentScrollStarted()
onContentScrollStarted
in interface ActionBarOverlayLayout.ActionBarVisibilityCallback
public void onContentScrollStopped()
onContentScrollStopped
in interface ActionBarOverlayLayout.ActionBarVisibilityCallback
public boolean collapseActionView()
collapseActionView
in class ActionBar
public boolean requestFocus()
ActionBar
requestFocus
in class ActionBar
true
if focus changes or false
if focus doesn't change.public void setCustomView(View view)
ActionBar
setCustomView
in class ActionBar
view
- Custom navigation view to place in the ActionBar.public void setCustomView(View view, ActionBar.LayoutParams layoutParams)
ActionBar
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.
setCustomView
in class ActionBar
view
- 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(SpinnerAdapter adapter, ActionBar.OnNavigationListener callback)
ActionBar
setListNavigationCallbacks
in class ActionBar
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.public int getSelectedNavigationIndex()
ActionBar
getSelectedNavigationIndex
in class ActionBar
public int getNavigationItemCount()
ActionBar
getNavigationItemCount
in class ActionBar
public int getTabCount()
ActionBar
getTabCount
in class ActionBar
public void setNavigationMode(int mode)
ActionBar
setNavigationMode
in class ActionBar
mode
- The new mode to set.ActionBar.NAVIGATION_MODE_STANDARD
,
ActionBar.NAVIGATION_MODE_LIST
,
ActionBar.NAVIGATION_MODE_TABS
public ActionBar.Tab getTabAt(int index)
ActionBar
public void setIcon(int resId)
ActionBar
ActionBar.DISPLAY_USE_LOGO
.setIcon
in class ActionBar
resId
- Resource ID of a drawable to show as an icon.ActionBar.setDisplayUseLogoEnabled(boolean)
,
ActionBar.setDisplayShowHomeEnabled(boolean)
public void setIcon(Drawable icon)
ActionBar
ActionBar.DISPLAY_USE_LOGO
.setIcon
in class ActionBar
icon
- Drawable to show as an icon.ActionBar.setDisplayUseLogoEnabled(boolean)
,
ActionBar.setDisplayShowHomeEnabled(boolean)
public boolean hasIcon()
public void setLogo(int resId)
ActionBar
ActionBar.DISPLAY_USE_LOGO
.setLogo
in class ActionBar
resId
- Resource ID of a drawable to show as a logo.ActionBar.setDisplayUseLogoEnabled(boolean)
,
ActionBar.setDisplayShowHomeEnabled(boolean)
public void setLogo(Drawable logo)
ActionBar
ActionBar.DISPLAY_USE_LOGO
.setLogo
in class ActionBar
logo
- Drawable to show as a logo.ActionBar.setDisplayUseLogoEnabled(boolean)
,
ActionBar.setDisplayShowHomeEnabled(boolean)
public boolean hasLogo()
public void setDefaultDisplayHomeAsUpEnabled(boolean enable)
setDefaultDisplayHomeAsUpEnabled
in class ActionBar