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

Commit 6037800f authored by Jamie Garside's avatar Jamie Garside
Browse files

Ensure that the keyguard container is always below message area.

In the current layout, the keyguard container is simply added to the
top-level NotificationShadeWindowView (descendant of FrameLayout) as a
sibling of the message area, so there's no way to align anything
underneath the message area (i.e. the "wrong PIN" bit). This is needed
for future devices, as new UX specs have the PIN entry field (the four
dots) immediately under the message area, rather than directly above the
bouncer.

Instead, this CL changes the keyguard inflation to inflate into a
FrameLayout directly underneath the message area. LinearLayout weights
are used to ensure it consumes all the remaining space.

An alternative would be, of course, to move the message area into the
keyguard views instead. This doesn't work, as the keyguard views are
lazily inflated (even keyguard_bouncer.xml), and the message area is
injected into some classes (via keyguard/dagger/KeyguardBouncerModule),
and thus needs to be available before it has been added to the layout.
It's probably fixable, but I really don't fancy rewriting half of the
Dagger injection right now.

Bug: 195012201
Test: Manually tested
Change-Id: I5d909d8548c3ae31ade92935b143a6cdcab46700
parent a44fcb0d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@

            androidprv:layout_constraintTop_toTopOf="parent"
            androidprv:layout_constraintBottom_toTopOf="@id/key1"
            androidprv:layout_constraintVertical_bias="1.0">
            androidprv:layout_constraintVertical_bias="0.0">

            <com.android.keyguard.PasswordTextView
                android:id="@+id/pinEntry"
+9 −4
Original line number Diff line number Diff line
@@ -81,9 +81,10 @@
    />

    <!-- Keyguard messages -->
    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_marginTop="@dimen/status_bar_height"
        android:layout_gravity="top|center_horizontal"
        android:gravity="center_horizontal">
@@ -97,7 +98,11 @@
            android:singleLine="true"
            android:ellipsize="marquee"
            android:focusable="true" />
    </FrameLayout>
        <FrameLayout android:id="@+id/keyboard_bouncer_container"
                     android:layout_height="0dp"
                     android:layout_width="match_parent"
                     android:layout_weight="1" />
    </LinearLayout>

    <com.android.systemui.biometrics.AuthRippleView
        android:id="@+id/auth_ripple"
+1 −1
Original line number Diff line number Diff line
@@ -1731,7 +1731,7 @@ public class StatusBar extends SystemUI implements
    }

    protected ViewGroup getBouncerContainer() {
        return mNotificationShadeWindowView;
        return mNotificationShadeWindowView.findViewById(R.id.keyboard_bouncer_container);
    }

    public int getStatusBarHeight() {