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

Commit 526b9313 authored by Adam Powell's avatar Adam Powell
Browse files

Fix a bug when showing the menu panel with an action bar/menu items

present.

Change-Id: I38cc257661f5a10ccca6ec7625e43e70287129d2
parent b035072d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            }

            // This will populate st.shownPanelView
            if (!initializePanelContent(st) || (st.shownPanelView == null)) {
            if (!initializePanelContent(st) || !st.hasPanelItems()) {
                return;
            }

@@ -2976,6 +2976,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            refreshDecorView = false;
        }

        public boolean hasPanelItems() {
            if (shownPanelView == null) return false;

            if (isInExpandedMode) {
                return expandedMenuPresenter.getAdapter().getCount() > 0;
            } else {
                return ((ViewGroup) shownPanelView).getChildCount() > 0;
            }
        }

        /**
         * Unregister and free attached MenuPresenters. They will be recreated as needed.
         */