Merge "DO NOT MERGE Use action bar overflow menus on large configurations as well as xlarge." into honeycomb-mr2
This commit is contained in:
@@ -88,9 +88,8 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
|
|||||||
mMaxItems = getMaxActionButtons();
|
mMaxItems = getMaxActionButtons();
|
||||||
|
|
||||||
// TODO There has to be a better way to indicate that we don't have a hard menu key.
|
// TODO There has to be a better way to indicate that we don't have a hard menu key.
|
||||||
final int screen = res.getConfiguration().screenLayout;
|
final Configuration config = res.getConfiguration();
|
||||||
mReserveOverflow = (screen & Configuration.SCREENLAYOUT_SIZE_MASK) ==
|
mReserveOverflow = config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);
|
||||||
Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
|
||||||
mWidthLimit = res.getDisplayMetrics().widthPixels / 2;
|
mWidthLimit = res.getDisplayMetrics().widthPixels / 2;
|
||||||
|
|
||||||
TypedArray a = context.obtainStyledAttributes(com.android.internal.R.styleable.Theme);
|
TypedArray a = context.obtainStyledAttributes(com.android.internal.R.styleable.Theme);
|
||||||
|
|||||||
@@ -450,12 +450,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
|
|||||||
if (st.featureId == FEATURE_OPTIONS_PANEL) {
|
if (st.featureId == FEATURE_OPTIONS_PANEL) {
|
||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
Configuration config = context.getResources().getConfiguration();
|
Configuration config = context.getResources().getConfiguration();
|
||||||
boolean isXLarge = (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) ==
|
|
||||||
Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
|
||||||
boolean isHoneycombApp = context.getApplicationInfo().targetSdkVersion >=
|
boolean isHoneycombApp = context.getApplicationInfo().targetSdkVersion >=
|
||||||
android.os.Build.VERSION_CODES.HONEYCOMB;
|
android.os.Build.VERSION_CODES.HONEYCOMB;
|
||||||
|
|
||||||
if (isXLarge && isHoneycombApp) {
|
if (isHoneycombApp &&
|
||||||
|
config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user