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

Commit 3b6692ac authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Android (Google) Code Review
Browse files

Merge "Revert "Refresh Notification Shelf layout when it becomes visible"" into main

parents 32955076 0a9a1b9c
Loading
Loading
Loading
Loading
+21 −18
Original line number Diff line number Diff line
@@ -261,7 +261,10 @@ object KeyguardRootViewBinder {
                            ->
                            if (biometricMessage?.message != null) {
                                chipbarCoordinator!!.displayView(
                                    createChipbarInfo(biometricMessage.message, R.drawable.ic_lock)
                                    createChipbarInfo(
                                        biometricMessage.message,
                                        R.drawable.ic_lock,
                                    )
                                )
                            } else {
                                chipbarCoordinator!!.removeView(ID, "occludingAppMsgNull")
@@ -324,9 +327,6 @@ object KeyguardRootViewBinder {
                                    .getDimensionPixelSize(R.dimen.shelf_appear_translation)
                                    .stateIn(this)
                            viewModel.isNotifIconContainerVisible.collect { isVisible ->
                                if (isVisible.value) {
                                    blueprintViewModel.refreshBlueprint()
                                } else {
                                childViews[aodNotificationIconContainerId]
                                    ?.setAodNotifIconContainerIsVisible(
                                        isVisible,
@@ -335,7 +335,6 @@ object KeyguardRootViewBinder {
                                    )
                            }
                        }
                        }

                        interactionJankMonitor?.let { jankMonitor ->
                            launch {
@@ -383,7 +382,7 @@ object KeyguardRootViewBinder {
                                if (msdlFeedback()) {
                                    msdlPlayer?.playToken(
                                        MSDLToken.UNLOCK,
                                        authInteractionProperties,
                                        authInteractionProperties
                                    )
                                } else {
                                    vibratorHelper.performHapticFeedback(
@@ -399,7 +398,7 @@ object KeyguardRootViewBinder {
                                if (msdlFeedback()) {
                                    msdlPlayer?.playToken(
                                        MSDLToken.FAILURE,
                                        authInteractionProperties,
                                        authInteractionProperties
                                    )
                                } else {
                                    vibratorHelper.performHapticFeedback(
@@ -426,7 +425,7 @@ object KeyguardRootViewBinder {
                    blueprintViewModel,
                    clockViewModel,
                    childViews,
                    burnInParams,
                    burnInParams
                )
            )

@@ -465,7 +464,11 @@ object KeyguardRootViewBinder {
     */
    private fun createChipbarInfo(message: String, @DrawableRes icon: Int): ChipbarInfo {
        return ChipbarInfo(
            startIcon = TintedIcon(Icon.Resource(icon, null), ChipbarInfo.DEFAULT_ICON_TINT),
            startIcon =
                TintedIcon(
                    Icon.Resource(icon, null),
                    ChipbarInfo.DEFAULT_ICON_TINT,
                ),
            text = Text.Loaded(message),
            endItem = null,
            vibrationEffect = null,
@@ -496,7 +499,7 @@ object KeyguardRootViewBinder {
            oldLeft: Int,
            oldTop: Int,
            oldRight: Int,
            oldBottom: Int,
            oldBottom: Int
        ) {
            // After layout, ensure the notifications are positioned correctly
            childViews[nsslPlaceholderId]?.let { notificationListPlaceholder ->
@@ -512,7 +515,7 @@ object KeyguardRootViewBinder {
                viewModel.onNotificationContainerBoundsChanged(
                    notificationListPlaceholder.top.toFloat(),
                    notificationListPlaceholder.bottom.toFloat(),
                    animate = shouldAnimate,
                    animate = shouldAnimate
                )
            }

@@ -528,7 +531,7 @@ object KeyguardRootViewBinder {
                                        Int.MAX_VALUE
                                    } else {
                                        view.getTop()
                                    },
                                    }
                                )
                            }
                        } else {
+7 −8
Original line number Diff line number Diff line
@@ -25,18 +25,20 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.keyguard.domain.interactor.KeyguardBlueprintInteractor
import com.android.systemui.keyguard.ui.view.layout.blueprints.transitions.IntraBlueprintTransition.Config
import com.android.systemui.keyguard.ui.view.layout.blueprints.transitions.IntraBlueprintTransition.Type
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow

data class TransitionData(val config: Config, val start: Long = System.currentTimeMillis())
data class TransitionData(
    val config: Config,
    val start: Long = System.currentTimeMillis(),
)

class KeyguardBlueprintViewModel
@Inject
constructor(
    @Main private val handler: Handler,
    private val keyguardBlueprintInteractor: KeyguardBlueprintInteractor,
    keyguardBlueprintInteractor: KeyguardBlueprintInteractor,
) {
    val blueprint = keyguardBlueprintInteractor.blueprint
    val blueprintId = keyguardBlueprintInteractor.blueprintId
@@ -74,9 +76,6 @@ constructor(
            }
        }

    fun refreshBlueprint(type: Type = Type.NoTransition) =
        keyguardBlueprintInteractor.refreshBlueprint(type)

    fun updateTransitions(data: TransitionData?, mutate: MutableSet<Transition>.() -> Unit) {
        runningTransitions.mutate()

@@ -96,7 +95,7 @@ constructor(
                Log.w(
                    TAG,
                    "runTransition: skipping ${transition::class.simpleName}: " +
                        "currentPriority=$currentPriority; config=$config",
                        "currentPriority=$currentPriority; config=$config"
                )
            }
            apply()
@@ -107,7 +106,7 @@ constructor(
            Log.i(
                TAG,
                "runTransition: running ${transition::class.simpleName}: " +
                    "currentPriority=$currentPriority; config=$config",
                    "currentPriority=$currentPriority; config=$config"
            )
        }