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

Commit e77f3834 authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: fix nav bar layout while toggling cursor keys with an IME up



Previously there was no option to have the IME up on that settings
screen so this was not a concern before; however, with the addition of
searchable settings, it seems users are now trying to toggle it with the
IME active, putting the nav bar in a strange state becuase it did not
restore the previous states properly.

Change-Id: Ib03ff3d9ee9679819eaa42644796e8f9eae6e694
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent d853e817
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -941,8 +941,25 @@ public class NavigationBarView extends LinearLayout {
                    Settings.System.LOCKSCREEN_MODLOCK_ENABLED, 1) == 0;
            mShowDpadArrowKeys = Settings.System.getInt(mContext.getContentResolver(),
                    Settings.System.NAVIGATION_BAR_MENU_ARROW_KEYS, 1) != 0;

            // hide dpad keys
            setVisibleOrGone(getCurrentView().findViewById(R.id.dpad_left), false);
            setVisibleOrGone(getCurrentView().findViewById(R.id.dpad_right), false);

            // restore previous views in case the cursor keys WERE showing and
            // are should now be hidden while the IME is up.
            View one = getCurrentView().findViewById(mVertical ? R.id.six : R.id.one);
            View capricaSix = getCurrentView().findViewById(mVertical ? R.id.one : R.id.six);
            if (mSlotOneVisibility != -1 && one != null) {
                one.setVisibility(mSlotOneVisibility);
            }
            if (mSlotSixVisibility != -1 && capricaSix != null) {
                capricaSix.setVisibility(mSlotSixVisibility);
            }
            mSlotOneVisibility = -1;
            mSlotSixVisibility = -1;

            // propogate settings
            setNavigationIconHints(mNavigationIconHints, true);
        }
    }