Methods Summary |
---|
public void | addOnMenuVisibilityListener(OnMenuVisibilityListener listener)
mMenuVisibilityListeners.add(listener);
|
public void | addTab(Tab tab)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | addTab(Tab tab, boolean setSelected)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | addTab(Tab tab, int position)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | addTab(Tab tab, int position, boolean setSelected)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public boolean | collapseActionView()
if (mDecorToolbar.hasExpandedActionView()) {
mDecorToolbar.collapseActionView();
return true;
}
return false;
|
public void | dispatchMenuVisibilityChanged(boolean isVisible)
if (isVisible == mLastMenuVisibility) {
return;
}
mLastMenuVisibility = isVisible;
final int count = mMenuVisibilityListeners.size();
for (int i = 0; i < count; i++) {
mMenuVisibilityListeners.get(i).onMenuVisibilityChanged(isVisible);
}
|
public android.view.View | getCustomView()
return mDecorToolbar.getCustomView();
|
public int | getDisplayOptions()
return mDecorToolbar.getDisplayOptions();
|
public float | getElevation()
return mDecorToolbar.getViewGroup().getElevation();
|
public int | getHeight()
return mDecorToolbar.getHeight();
|
public int | getNavigationItemCount()
return 0;
|
public int | getNavigationMode()
return NAVIGATION_MODE_STANDARD;
|
public int | getSelectedNavigationIndex()
return -1;
|
public Tab | getSelectedTab()
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public java.lang.CharSequence | getSubtitle()
return mDecorToolbar.getSubtitle();
|
public Tab | getTabAt(int index)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public int | getTabCount()
return 0;
|
public android.content.Context | getThemedContext()
return mDecorToolbar.getContext();
|
public java.lang.CharSequence | getTitle()
return mDecorToolbar.getTitle();
|
public Window.Callback | getWrappedWindowCallback()
return mWindowCallback;
|
public void | hide()
// TODO: Consider a better transition for this.
// Right now use no automatic transition so that the app can supply one if desired.
mDecorToolbar.setVisibility(View.GONE);
|
public boolean | invalidateOptionsMenu()
mDecorToolbar.getViewGroup().removeCallbacks(mMenuInvalidator);
mDecorToolbar.getViewGroup().postOnAnimation(mMenuInvalidator);
return true;
|
public boolean | isShowing()
return mDecorToolbar.getVisibility() == View.VISIBLE;
|
public boolean | isTitleTruncated()
return super.isTitleTruncated();
|
public Tab | newTab()
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | onConfigurationChanged(android.content.res.Configuration config)
super.onConfigurationChanged(config);
|
public boolean | onMenuKeyEvent(android.view.KeyEvent event)
if (event.getAction() == KeyEvent.ACTION_UP) {
openOptionsMenu();
}
return true;
|
public boolean | openOptionsMenu()
return mDecorToolbar.showOverflowMenu();
|
void | populateOptionsMenu()
if (!mMenuCallbackSet) {
mDecorToolbar.setMenuCallbacks(new ActionMenuPresenterCallback(), new MenuBuilderCallback());
mMenuCallbackSet = true;
}
final Menu menu = mDecorToolbar.getMenu();
final MenuBuilder mb = menu instanceof MenuBuilder ? (MenuBuilder) menu : null;
if (mb != null) {
mb.stopDispatchingItemsChanged();
}
try {
menu.clear();
if (!mWindowCallback.onCreatePanelMenu(Window.FEATURE_OPTIONS_PANEL, menu) ||
!mWindowCallback.onPreparePanel(Window.FEATURE_OPTIONS_PANEL, null, menu)) {
menu.clear();
}
} finally {
if (mb != null) {
mb.startDispatchingItemsChanged();
}
}
|
public void | removeAllTabs()
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | removeOnMenuVisibilityListener(OnMenuVisibilityListener listener)
mMenuVisibilityListeners.remove(listener);
|
public void | removeTab(Tab tab)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | removeTabAt(int position)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | selectTab(Tab tab)
throw new UnsupportedOperationException(
"Tabs are not supported in toolbar action bars");
|
public void | setBackgroundDrawable(android.graphics.drawable.Drawable d)
mDecorToolbar.setBackgroundDrawable(d);
|
public void | setCustomView(android.view.View view)
setCustomView(view, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
public void | setCustomView(android.view.View view, LayoutParams layoutParams)
view.setLayoutParams(layoutParams);
mDecorToolbar.setCustomView(view);
|
public void | setCustomView(int resId)
final LayoutInflater inflater = LayoutInflater.from(mDecorToolbar.getContext());
setCustomView(inflater.inflate(resId, mDecorToolbar.getViewGroup(), false));
|
public void | setDefaultDisplayHomeAsUpEnabled(boolean enabled)
// Do nothing
|
public void | setDisplayHomeAsUpEnabled(boolean showHomeAsUp)
setDisplayOptions(showHomeAsUp ? DISPLAY_HOME_AS_UP : 0, DISPLAY_HOME_AS_UP);
|
public void | setDisplayOptions(int options)
setDisplayOptions(options, 0xffffffff);
|
public void | setDisplayOptions(int options, int mask)
final int currentOptions = mDecorToolbar.getDisplayOptions();
mDecorToolbar.setDisplayOptions(options & mask | currentOptions & ~mask);
|
public void | setDisplayShowCustomEnabled(boolean showCustom)
setDisplayOptions(showCustom ? DISPLAY_SHOW_CUSTOM : 0, DISPLAY_SHOW_CUSTOM);
|
public void | setDisplayShowHomeEnabled(boolean showHome)
setDisplayOptions(showHome ? DISPLAY_SHOW_HOME : 0, DISPLAY_SHOW_HOME);
|
public void | setDisplayShowTitleEnabled(boolean showTitle)
setDisplayOptions(showTitle ? DISPLAY_SHOW_TITLE : 0, DISPLAY_SHOW_TITLE);
|
public void | setDisplayUseLogoEnabled(boolean useLogo)
setDisplayOptions(useLogo ? DISPLAY_USE_LOGO : 0, DISPLAY_USE_LOGO);
|
public void | setElevation(float elevation)
mDecorToolbar.getViewGroup().setElevation(elevation);
|
public void | setHomeActionContentDescription(java.lang.CharSequence description)
mDecorToolbar.setNavigationContentDescription(description);
|
public void | setHomeActionContentDescription(int resId)
mDecorToolbar.setNavigationContentDescription(resId);
|
public void | setHomeAsUpIndicator(android.graphics.drawable.Drawable indicator)
mDecorToolbar.setNavigationIcon(indicator);
|
public void | setHomeAsUpIndicator(int resId)
mDecorToolbar.setNavigationIcon(resId);
|
public void | setHomeButtonEnabled(boolean enabled)
// If the nav button on a Toolbar is present, it's enabled. No-op.
|
public void | setIcon(int resId)
mDecorToolbar.setIcon(resId);
|
public void | setIcon(android.graphics.drawable.Drawable icon)
mDecorToolbar.setIcon(icon);
|
public void | setListNavigationCallbacks(android.widget.SpinnerAdapter adapter, OnNavigationListener callback)
mDecorToolbar.setDropdownParams(adapter, new NavItemSelectedListener(callback));
|
public void | setLogo(int resId)
mDecorToolbar.setLogo(resId);
|
public void | setLogo(android.graphics.drawable.Drawable logo)
mDecorToolbar.setLogo(logo);
|
public void | setNavigationMode(int mode)
if (mode == ActionBar.NAVIGATION_MODE_TABS) {
throw new IllegalArgumentException("Tabs not supported in this configuration");
}
mDecorToolbar.setNavigationMode(mode);
|
public void | setSelectedNavigationItem(int position)
switch (mDecorToolbar.getNavigationMode()) {
case NAVIGATION_MODE_LIST:
mDecorToolbar.setDropdownSelectedPosition(position);
break;
default:
throw new IllegalStateException(
"setSelectedNavigationIndex not valid for current navigation mode");
}
|
public void | setShowHideAnimationEnabled(boolean enabled)
// This space for rent; no-op.
|
public void | setSplitBackgroundDrawable(android.graphics.drawable.Drawable d)
// This space for rent (do nothing)
|
public void | setStackedBackgroundDrawable(android.graphics.drawable.Drawable d)
// This space for rent (do nothing)
|
public void | setSubtitle(java.lang.CharSequence subtitle)
mDecorToolbar.setSubtitle(subtitle);
|
public void | setSubtitle(int resId)
mDecorToolbar.setSubtitle(resId != 0 ? mDecorToolbar.getContext().getText(resId) : null);
|
public void | setTitle(java.lang.CharSequence title)
mDecorToolbar.setTitle(title);
|
public void | setTitle(int resId)
mDecorToolbar.setTitle(resId != 0 ? mDecorToolbar.getContext().getText(resId) : null);
|
public void | setWindowTitle(java.lang.CharSequence title)
mDecorToolbar.setWindowTitle(title);
|
public void | show()
// TODO: Consider a better transition for this.
// Right now use no automatic transition so that the app can supply one if desired.
mDecorToolbar.setVisibility(View.VISIBLE);
|
public android.view.ActionMode | startActionMode(ActionMode.Callback callback)
return null;
|