Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +5 −1 Original line number Diff line number Diff line Loading @@ -614,7 +614,11 @@ public class AuthContainerView extends LinearLayout return ((AuthBiometricFingerprintView) view).isUdfps(); } if (view instanceof BiometricPromptLayout) { return ((BiometricPromptLayout) view).isUdfps(); // this will force the prompt to align itself on the edge of the screen // instead of centering (temporary workaround to prevent small implicit view // from breaking due to the way gravity / margins are set in the legacy // AuthPanelController return true; } return false; Loading packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt +25 −4 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ package com.android.systemui.biometrics.ui.binder import android.animation.Animator import android.animation.AnimatorSet import android.animation.ValueAnimator import android.view.Surface import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.view.WindowManager import android.view.accessibility.AccessibilityManager import android.widget.TextView import androidx.core.animation.addListener Loading Loading @@ -52,7 +55,9 @@ object BiometricViewSizeBinder { panelViewController: AuthPanelController, jankListener: BiometricJankListener, ) { val accessibilityManager = view.context.getSystemService(AccessibilityManager::class.java)!! val windowManager = requireNotNull(view.context.getSystemService(WindowManager::class.java)) val accessibilityManager = requireNotNull(view.context.getSystemService(AccessibilityManager::class.java)) fun notifyAccessibilityChanged() { Utils.notifyAccessibilityContentChanged(accessibilityManager, view) } Loading Loading @@ -102,15 +107,26 @@ object BiometricViewSizeBinder { when { size.isSmall -> { iconHolderView.alpha = 1f val bottomInset = windowManager.maximumWindowMetrics.windowInsets .getInsets(WindowInsets.Type.navigationBars()) .bottom iconHolderView.y = view.height - iconHolderView.height - iconPadding if (view.isLandscape()) { (view.height - iconHolderView.height - bottomInset) / 2f } else { view.height - iconHolderView.height - iconPadding - bottomInset } val newHeight = iconHolderView.height + 2 * iconPadding.toInt() - iconHolderView.height + (2 * iconPadding.toInt()) - iconHolderView.paddingTop - iconHolderView.paddingBottom panelViewController.updateForContentDimensions( width, newHeight, newHeight + bottomInset, 0, /* animateDurationMs */ ) } Loading Loading @@ -181,6 +197,11 @@ object BiometricViewSizeBinder { } } private fun View.isLandscape(): Boolean { val r = context.display.rotation return r == Surface.ROTATION_90 || r == Surface.ROTATION_270 } private fun TextView.showTextOrHide(forceHide: Boolean = false) { visibility = if (forceHide || text.isBlank()) View.GONE else View.VISIBLE } Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +5 −1 Original line number Diff line number Diff line Loading @@ -614,7 +614,11 @@ public class AuthContainerView extends LinearLayout return ((AuthBiometricFingerprintView) view).isUdfps(); } if (view instanceof BiometricPromptLayout) { return ((BiometricPromptLayout) view).isUdfps(); // this will force the prompt to align itself on the edge of the screen // instead of centering (temporary workaround to prevent small implicit view // from breaking due to the way gravity / margins are set in the legacy // AuthPanelController return true; } return false; Loading
packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt +25 −4 Original line number Diff line number Diff line Loading @@ -19,8 +19,11 @@ package com.android.systemui.biometrics.ui.binder import android.animation.Animator import android.animation.AnimatorSet import android.animation.ValueAnimator import android.view.Surface import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.view.WindowManager import android.view.accessibility.AccessibilityManager import android.widget.TextView import androidx.core.animation.addListener Loading Loading @@ -52,7 +55,9 @@ object BiometricViewSizeBinder { panelViewController: AuthPanelController, jankListener: BiometricJankListener, ) { val accessibilityManager = view.context.getSystemService(AccessibilityManager::class.java)!! val windowManager = requireNotNull(view.context.getSystemService(WindowManager::class.java)) val accessibilityManager = requireNotNull(view.context.getSystemService(AccessibilityManager::class.java)) fun notifyAccessibilityChanged() { Utils.notifyAccessibilityContentChanged(accessibilityManager, view) } Loading Loading @@ -102,15 +107,26 @@ object BiometricViewSizeBinder { when { size.isSmall -> { iconHolderView.alpha = 1f val bottomInset = windowManager.maximumWindowMetrics.windowInsets .getInsets(WindowInsets.Type.navigationBars()) .bottom iconHolderView.y = view.height - iconHolderView.height - iconPadding if (view.isLandscape()) { (view.height - iconHolderView.height - bottomInset) / 2f } else { view.height - iconHolderView.height - iconPadding - bottomInset } val newHeight = iconHolderView.height + 2 * iconPadding.toInt() - iconHolderView.height + (2 * iconPadding.toInt()) - iconHolderView.paddingTop - iconHolderView.paddingBottom panelViewController.updateForContentDimensions( width, newHeight, newHeight + bottomInset, 0, /* animateDurationMs */ ) } Loading Loading @@ -181,6 +197,11 @@ object BiometricViewSizeBinder { } } private fun View.isLandscape(): Boolean { val r = context.display.rotation return r == Surface.ROTATION_90 || r == Surface.ROTATION_270 } private fun TextView.showTextOrHide(forceHide: Boolean = false) { visibility = if (forceHide || text.isBlank()) View.GONE else View.VISIBLE } Loading