diff options
author | 2024-05-29 14:14:13 +0000 | |
---|---|---|
committer | 2024-05-29 14:14:13 +0000 | |
commit | 3f7579cdf0880bc166e7426a9dac54ce326c836a (patch) | |
tree | 62b8272970ad229323b1201b94f082c09b4622df | |
parent | 2bfdc2876823c20d8083eed4809a5b6f925b2135 (diff) | |
parent | a0bbc8495ed9e28b388903b73985fee7237d084f (diff) |
Merge "Force Now Playing to re-layout after lock icon moves when folding" into main
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt index 0b8376af811c..c5fab8f57822 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt @@ -219,5 +219,37 @@ constructor( sensorRect.left ) } + + // This is only intended to be here until the KeyguardBottomAreaRefactor flag is enabled + // Without this logic, the lock icon location changes but the KeyguardBottomAreaView is not + // updated and visible ui layout jank occurs. This is due to AmbientIndicationContainer + // being in NPVC and laying out prior to the KeyguardRootView. + // Remove when both DeviceEntryUdfpsRefactor and KeyguardBottomAreaRefactor are enabled. + if (DeviceEntryUdfpsRefactor.isEnabled && !KeyguardBottomAreaRefactor.isEnabled) { + with(notificationPanelView) { + val isUdfpsSupported = deviceEntryIconViewModel.get().isUdfpsSupported.value + val bottomAreaViewRight = findViewById<View>(R.id.keyguard_bottom_area)?.right ?: 0 + findViewById<View>(R.id.ambient_indication_container)?.let { + val (ambientLeft, ambientTop) = it.locationOnScreen + if (isUdfpsSupported) { + // make top of ambient indication view the bottom of the lock icon + it.layout( + ambientLeft, + sensorRect.bottom, + bottomAreaViewRight - ambientLeft, + ambientTop + it.measuredHeight + ) + } else { + // make bottom of ambient indication view the top of the lock icon + it.layout( + ambientLeft, + sensorRect.top - it.measuredHeight, + bottomAreaViewRight - ambientLeft, + sensorRect.top + ) + } + } + } + } } } |