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

Commit 8f9db033 authored by LuK1337's avatar LuK1337 Committed by Łukasz Patron
Browse files

SystemUI: Fix navigation bar arrows visibility handling

* Fixes issue where input events would be sent
  while dpad_group view was set to be invisible.

Change-Id: Ie802e9c8157505a2ad706332f0b2fe715caf428c
parent ec2ce5b6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@
    android:id="@+id/dpad_group"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clipChildren="false"
    android:visibility="gone">
    android:clipChildren="false">

        <com.android.systemui.statusbar.policy.KeyButtonView
            android:id="@+id/dpad_left"
@@ -30,6 +29,7 @@
            android:src="@drawable/ic_sysbar_ime_left"
            systemui:keyCode="21"
            systemui:keyRepeat="true"
            android:visibility="gone"
            android:scaleType="center"
            android:contentDescription="@string/accessibility_dpad_left" />

@@ -41,6 +41,7 @@
            android:src="@drawable/ic_sysbar_ime_right"
            systemui:keyCode="22"
            systemui:keyRepeat="true"
            android:visibility="gone"
            android:scaleType="center"
            android:contentDescription="@string/accessibility_dpad_right" />

+3 −2
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@
    android:id="@+id/dpad_group"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clipChildren="false"
    android:visibility="gone">
    android:clipChildren="false">

        <com.android.systemui.statusbar.policy.KeyButtonView
            android:id="@+id/dpad_left"
@@ -30,6 +29,7 @@
            android:src="@drawable/ic_sysbar_ime_left"
            systemui:keyCode="21"
            systemui:keyRepeat="true"
            android:visibility="gone"
            android:scaleType="center"
            android:contentDescription="@string/accessibility_dpad_left" />

@@ -41,6 +41,7 @@
            android:src="@drawable/ic_sysbar_ime_right"
            systemui:keyCode="22"
            systemui:keyRepeat="true"
            android:visibility="gone"
            android:scaleType="center"
            android:contentDescription="@string/accessibility_dpad_right" />

+3 −2
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@
    android:id="@+id/dpad_group"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clipChildren="false"
    android:visibility="gone">
    android:clipChildren="false">

        <com.android.systemui.statusbar.policy.KeyButtonView
            android:id="@+id/dpad_left"
@@ -30,6 +29,7 @@
            android:src="@drawable/ic_sysbar_ime_left"
            systemui:keyCode="21"
            systemui:keyRepeat="true"
            android:visibility="gone"
            android:scaleType="center"
            android:contentDescription="@string/accessibility_dpad_left" />

@@ -41,6 +41,7 @@
            android:src="@drawable/ic_sysbar_ime_right"
            systemui:keyCode="22"
            systemui:keyRepeat="true"
            android:visibility="gone"
            android:scaleType="center"
            android:contentDescription="@string/accessibility_dpad_right" />

+4 −5
Original line number Diff line number Diff line
@@ -854,12 +854,11 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
    }

    public void updateDpadKeys() {
        if (mShowDpadArrowKeys) { // overrides IME button
            final boolean showingIme = ((mNavigationIconHints
                    & StatusBarManager.NAVIGATION_HINT_BACK_ALT) != 0);
        final int visibility = mShowDpadArrowKeys && (mNavigationIconHints
                & StatusBarManager.NAVIGATION_HINT_BACK_ALT) != 0 ? View.VISIBLE : View.GONE;

            getDpadView().setVisibility(showingIme ? View.VISIBLE : View.INVISIBLE);
        }
        getDpadView().findViewById(R.id.dpad_left).setVisibility(visibility);
        getDpadView().findViewById(R.id.dpad_right).setVisibility(visibility);
    }

    private final Consumer<Boolean> mDockedListener = exists -> mHandler.post(() -> {