Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35b770f3 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge changes from topic "mpietal_shelf" into main

* changes:
  Keyguard translation - Emit value on start
  Allow shelf to overlap UDFPS/lock icon
parents 192cf8a6 506164fd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -160,6 +160,9 @@ interface KeyguardRepository {
    /** Last point that [KeyguardRootView] was tapped */
    val lastRootViewTapPosition: MutableStateFlow<Point?>

    /** Is the ambient indication area visible? */
    val ambientIndicationVisible: MutableStateFlow<Boolean>

    /** Observable for the [StatusBarState] */
    val statusBarState: StateFlow<StatusBarState>

@@ -423,6 +426,8 @@ constructor(

    override val lastRootViewTapPosition: MutableStateFlow<Point?> = MutableStateFlow(null)

    override val ambientIndicationVisible: MutableStateFlow<Boolean> = MutableStateFlow(false)

    override val isDreamingWithOverlay: Flow<Boolean> =
        conflatedCallbackFlow {
                val callback =
+7 −0
Original line number Diff line number Diff line
@@ -174,6 +174,9 @@ constructor(
    /** Last point that [KeyguardRootView] view was tapped */
    val lastRootViewTapPosition: Flow<Point?> = repository.lastRootViewTapPosition.asStateFlow()

    /** Is the ambient indication area visible? */
    val ambientIndicationVisible: Flow<Boolean> = repository.ambientIndicationVisible.asStateFlow()

    /** Whether the primary bouncer is showing or not. */
    val primaryBouncerShowing: Flow<Boolean> = bouncerRepository.primaryBouncerShow

@@ -311,6 +314,10 @@ constructor(
        repository.lastRootViewTapPosition.value = point
    }

    fun setAmbientIndicationVisible(isVisible: Boolean) {
        repository.ambientIndicationVisible.value = isVisible
    }

    companion object {
        private const val TAG = "KeyguardInteractor"
    }
+4 −1
Original line number Diff line number Diff line
@@ -180,7 +180,9 @@ constructor(
                    goneToAodTransitionViewModel
                        .enterFromTopTranslationY(enterFromTopAmount)
                        .onStart { emit(0f) },
                    occludedToLockscreenTransitionViewModel.lockscreenTranslationY,
                    occludedToLockscreenTransitionViewModel.lockscreenTranslationY.onStart {
                        emit(0f)
                    },
                ) {
                    keyguardTransitionY,
                    burnInTranslationY,
@@ -193,6 +195,7 @@ constructor(
                        occludedToLockscreenTransitionTranslationY
                }
            }
            .distinctUntilChanged()

    val translationX: Flow<Float> = burnIn().map { it.translationX.toFloat() }

+19 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ package com.android.systemui.statusbar.notification.stack.domain.interactor
import android.content.Context
import com.android.systemui.common.ui.data.repository.ConfigurationRepository
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryUdfpsInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.SplitShadeStateController
import javax.inject.Inject
@@ -28,6 +30,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
@@ -39,7 +42,9 @@ class SharedNotificationContainerInteractor
constructor(
    configurationRepository: ConfigurationRepository,
    private val context: Context,
    private val splitShadeStateController: SplitShadeStateController
    private val splitShadeStateController: SplitShadeStateController,
    keyguardInteractor: KeyguardInteractor,
    deviceEntryUdfpsInteractor: DeviceEntryUdfpsInteractor,
) {

    private val _topPosition = MutableStateFlow(0f)
@@ -75,6 +80,19 @@ constructor(
            }
            .distinctUntilChanged()

    /**
     * The notification shelf can extend over the lock icon area if:
     * * UDFPS supported. Ambient indication will always appear below
     * * UDFPS not supported and ambient indication not visible, which will appear above lock icon
     */
    val useExtraShelfSpace: Flow<Boolean> =
        combine(
            keyguardInteractor.ambientIndicationVisible,
            deviceEntryUdfpsInteractor.isUdfpsSupported,
        ) { ambientIndicationVisible, isUdfpsSupported ->
            isUdfpsSupported || !ambientIndicationVisible
        }

    val isSplitShadeEnabled: Flow<Boolean> =
        configurationBasedDimensions
            .map { dimens: ConfigurationBasedDimensions -> dimens.useSplitShade }
+4 −3
Original line number Diff line number Diff line
@@ -101,12 +101,13 @@ object SharedNotificationContainerBinder {

                    launch {
                        viewModel
                            .getMaxNotifications { space ->
                            .getMaxNotifications { space, extraShelfSpace ->
                                val shelfHeight = controller.getShelfHeight().toFloat()
                                notificationStackSizeCalculator.computeMaxKeyguardNotifications(
                                    controller.getView(),
                                    space,
                                    0f, // Vertical space for shelf is already accounted for
                                    controller.getShelfHeight().toFloat(),
                                    if (extraShelfSpace) shelfHeight else 0f,
                                    shelfHeight,
                                )
                            }
                            .collect { controller.setMaxDisplayedNotifications(it) }
Loading