Process insets correctly

Bottom window insets were being processed but keyboard was being
ignored. Paddings should also only be applied on the correct
lifecycle event.

Fixes: 132615062
Test: swipe up to unlock with: pin/pattern/password
Test: swipe up to unlock with: 2 button navbar, gestural navbar
Change-Id: Ib573e20d9955e644f60333ad3d8e0f2d7e73fe54
This commit is contained in:
Lucas Dupin
2019-05-13 16:33:32 -07:00
parent 99a61d3b58
commit 3ac28ac86c
2 changed files with 7 additions and 12 deletions

View File

@@ -38,6 +38,7 @@
android:clipChildren="false"
android:clipToPadding="false"
android:padding="0dp"
android:fitsSystemWindows="true"
android:layout_gravity="center">
<com.android.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"

View File

@@ -20,6 +20,7 @@ import android.app.AlertDialog;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.metrics.LogMaker;
import android.os.UserHandle;
import android.util.AttributeSet;
@@ -139,7 +140,6 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
getSecurityView(mCurrentSecuritySelection).onResume(reason);
}
updateBiometricRetry();
updatePaddings();
}
@Override
@@ -319,17 +319,11 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
updatePaddings();
}
private void updatePaddings() {
int bottomPadding = getRootWindowInsets().getSystemWindowInsets().bottom;
if (getPaddingBottom() == bottomPadding) {
return;
}
setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), bottomPadding);
protected boolean fitSystemWindows(Rect insets) {
// Consume bottom insets because we're setting the padding locally (for IME and navbar.)
setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), insets.bottom);
insets.bottom = 0;
return false;
}
private void showDialog(String title, String message) {