Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b07f9432 authored by Adam Powell's avatar Adam Powell
Browse files

DO NOT MERGE Use action bar overflow menus on large configurations as

well as xlarge.

ICS will have a more intelligent way of determining this.

Change-Id: I1ba6460dec09b8259db858c78a9157bb7742c85d
parent 084d3490
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -88,9 +88,8 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
        mMaxItems = getMaxActionButtons();

        // 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;
        mReserveOverflow = (screen & Configuration.SCREENLAYOUT_SIZE_MASK) ==
                Configuration.SCREENLAYOUT_SIZE_XLARGE;
        final Configuration config = res.getConfiguration();
        mReserveOverflow = config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);
        mWidthLimit = res.getDisplayMetrics().widthPixels / 2;
        
        TypedArray a = context.obtainStyledAttributes(com.android.internal.R.styleable.Theme);
+2 −3
Original line number Diff line number Diff line
@@ -450,12 +450,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        if (st.featureId == FEATURE_OPTIONS_PANEL) {
            Context context = getContext();
            Configuration config = context.getResources().getConfiguration();
            boolean isXLarge = (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) ==
                    Configuration.SCREENLAYOUT_SIZE_XLARGE;
            boolean isHoneycombApp = context.getApplicationInfo().targetSdkVersion >=
                    android.os.Build.VERSION_CODES.HONEYCOMB;

            if (isXLarge && isHoneycombApp) {
            if (isHoneycombApp &&
                    config.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE)) {
                return;
            }
        }