Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +0 −5 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.combineTransform import kotlinx.coroutines.flow.distinctUntilChanged Loading Loading @@ -183,10 +182,6 @@ constructor( /** Last point that the root view was tapped */ val lastRootViewTapPosition: Flow<Point?> = keyguardInteractor.lastRootViewTapPosition /** the shared notification container bounds *on the lockscreen* */ val notificationBounds: StateFlow<NotificationContainerBounds> = keyguardInteractor.notificationContainerBounds /** * The keyguard root view can be clipped as the shade is pulled down, typically only for * non-split shade cases. Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +9 −3 Original line number Diff line number Diff line Loading @@ -506,6 +506,12 @@ constructor( ) .dumpWhileCollecting("translationX") private val availableHeight: Flow<Float> = bounds .map { it.bottom - it.top } .distinctUntilChanged() .dumpWhileCollecting("availableHeight") /** * When on keyguard, there is limited space to display notifications so calculate how many could * be shown. Otherwise, there is no limit since the vertical space will be scrollable. Loading @@ -527,19 +533,19 @@ constructor( showLimitedNotifications, showUnlimitedNotifications, shadeInteractor.isUserInteracting, bounds, availableHeight, interactor.notificationStackChanged.onStart { emit(Unit) }, interactor.useExtraShelfSpace, ) { flows -> val showLimitedNotifications = flows[0] as Boolean val showUnlimitedNotifications = flows[1] as Boolean val isUserInteracting = flows[2] as Boolean val bounds = flows[3] as NotificationContainerBounds val availableHeight = flows[3] as Float val useExtraShelfSpace = flows[5] as Boolean if (!isUserInteracting) { if (showLimitedNotifications) { emit(calculateSpace(bounds.bottom - bounds.top, useExtraShelfSpace)) emit(calculateSpace(availableHeight, useExtraShelfSpace)) } else if (showUnlimitedNotifications) { emit(-1) } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +0 −5 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.combineTransform import kotlinx.coroutines.flow.distinctUntilChanged Loading Loading @@ -183,10 +182,6 @@ constructor( /** Last point that the root view was tapped */ val lastRootViewTapPosition: Flow<Point?> = keyguardInteractor.lastRootViewTapPosition /** the shared notification container bounds *on the lockscreen* */ val notificationBounds: StateFlow<NotificationContainerBounds> = keyguardInteractor.notificationContainerBounds /** * The keyguard root view can be clipped as the shade is pulled down, typically only for * non-split shade cases. Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +9 −3 Original line number Diff line number Diff line Loading @@ -506,6 +506,12 @@ constructor( ) .dumpWhileCollecting("translationX") private val availableHeight: Flow<Float> = bounds .map { it.bottom - it.top } .distinctUntilChanged() .dumpWhileCollecting("availableHeight") /** * When on keyguard, there is limited space to display notifications so calculate how many could * be shown. Otherwise, there is no limit since the vertical space will be scrollable. Loading @@ -527,19 +533,19 @@ constructor( showLimitedNotifications, showUnlimitedNotifications, shadeInteractor.isUserInteracting, bounds, availableHeight, interactor.notificationStackChanged.onStart { emit(Unit) }, interactor.useExtraShelfSpace, ) { flows -> val showLimitedNotifications = flows[0] as Boolean val showUnlimitedNotifications = flows[1] as Boolean val isUserInteracting = flows[2] as Boolean val bounds = flows[3] as NotificationContainerBounds val availableHeight = flows[3] as Float val useExtraShelfSpace = flows[5] as Boolean if (!isUserInteracting) { if (showLimitedNotifications) { emit(calculateSpace(bounds.bottom - bounds.top, useExtraShelfSpace)) emit(calculateSpace(availableHeight, useExtraShelfSpace)) } else if (showUnlimitedNotifications) { emit(-1) } Loading