diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt index 310ec95a22df..ad6a36c71e39 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryForegroundViewModel.kt @@ -27,6 +27,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.ui.view.DeviceEntryIconView import com.android.systemui.res.R import javax.inject.Inject +import kotlin.math.roundToInt import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine @@ -74,7 +75,18 @@ constructor( isTransitionToAod && isUdfps } .distinctUntilChanged() - private val padding: Flow<Int> = udfpsOverlayInteractor.iconPadding + + private val padding: Flow<Int> = + deviceEntryUdfpsInteractor.isUdfpsSupported.flatMapLatest { udfpsSupported -> + if (udfpsSupported) { + udfpsOverlayInteractor.iconPadding + } else { + configurationInteractor.scaleForResolution.map { scale -> + (context.resources.getDimensionPixelSize(R.dimen.lock_icon_padding) * scale) + .roundToInt() + } + } + } val viewModel: Flow<ForegroundIconViewModel> = combine( |