Methods Summary |
---|
public boolean | enableHomeButtonByDefault()
// Older apps get the home button interaction enabled by default.
// Newer apps need to enable it explicitly.
return mContext.getApplicationInfo().targetSdkVersion <
Build.VERSION_CODES.ICE_CREAM_SANDWICH;
|
public static android.support.v7.internal.view.ActionBarPolicy | get(android.content.Context context)
return new ActionBarPolicy(context);
|
public int | getEmbeddedMenuWidthLimit()
return mContext.getResources().getDisplayMetrics().widthPixels / 2;
|
public int | getMaxActionButtons()
return mContext.getResources().getInteger(R.integer.abc_max_action_buttons);
|
public int | getStackedTabMaxWidth()
return mContext.getResources().getDimensionPixelSize(
R.dimen.abc_action_bar_stacked_tab_max_width);
|
public int | getTabContainerHeight()
TypedArray a = mContext.obtainStyledAttributes(null, R.styleable.ActionBar,
R.attr.actionBarStyle, 0);
int height = a.getLayoutDimension(R.styleable.ActionBar_height, 0);
Resources r = mContext.getResources();
if (!hasEmbeddedTabs()) {
// Stacked tabs; limit the height
height = Math.min(height,
r.getDimensionPixelSize(R.dimen.abc_action_bar_stacked_max_height));
}
a.recycle();
return height;
|
public boolean | hasEmbeddedTabs()
final int targetSdk = mContext.getApplicationInfo().targetSdkVersion;
if (targetSdk >= Build.VERSION_CODES.JELLY_BEAN) {
return mContext.getResources().getBoolean(R.bool.abc_action_bar_embed_tabs);
}
// The embedded tabs policy changed in Jellybean; give older apps the old policy
// so they get what they expect.
return mContext.getResources().getBoolean(R.bool.abc_action_bar_embed_tabs_pre_jb);
|
public boolean | showsOverflowMenuButton()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
return true;
} else {
return !ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(mContext));
}
|