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

Commit 583de957 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Id83813b8,Iede60e03 into main

* changes:
  [flexiglass] Ensure shade header height matches the status bar height.
  [Dual Shade] Fix SystemIconChip hover behavior
parents 772d8969 e7056697
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ fun ContentScope.NotificationScrollingStack(
    DisposableEffect(Unit) { onDispose { viewModel.onScrimBoundsChanged(null) } }

    // Top position if the scrim, when it is fully expanded.
    val minScrimTop = ShadeHeader.Dimensions.CollapsedHeight
    val minScrimTop = ShadeHeader.Dimensions.StatusBarHeight

    // The minimum offset for the scrim. The scrim is considered fully expanded when it
    // is at this offset.
+3 −3
Original line number Diff line number Diff line
@@ -70,8 +70,8 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.scene.ContentScope
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
import com.android.compose.animation.scene.animateContentFloatAsState
import com.android.compose.animation.scene.animateSceneDpAsState
import com.android.compose.animation.scene.animateSceneFloatAsState
import com.android.compose.animation.scene.content.state.TransitionState
import com.android.compose.modifiers.thenIf
import com.android.compose.windowsizeclass.LocalWindowSizeClass
@@ -251,7 +251,7 @@ private fun ContentScope.QuickSettingsScene(
            remember(lifecycleOwner, viewModel) {
                viewModel.getFooterActionsViewModel(lifecycleOwner)
            }
        animateSceneFloatAsState(value = 1f, key = QuickSettings.SharedValues.TilesSquishiness)
        animateContentFloatAsState(value = 1f, key = QuickSettings.SharedValues.TilesSquishiness)

        // ############## SCROLLING ################

@@ -282,7 +282,7 @@ private fun ContentScope.QuickSettingsScene(
            )
        val topPadding by
            animateDpAsState(
                targetValue = if (isCustomizing) ShadeHeader.Dimensions.CollapsedHeight else 0.dp,
                targetValue = if (isCustomizing) ShadeHeader.Dimensions.StatusBarHeight else 0.dp,
                animationSpec = tween(customizingAnimationDuration),
                label = "animateQSSceneTopPaddingAsState",
            )
+1 −6
Original line number Diff line number Diff line
package com.android.systemui.scene.ui.composable.transitions

import com.android.compose.animation.scene.TransitionBuilder
import kotlin.time.Duration.Companion.milliseconds

fun TransitionBuilder.goneToQuickSettingsTransition(
    durationScale: Double = 1.0,
) {
fun TransitionBuilder.goneToQuickSettingsTransition(durationScale: Double = 1.0) {
    toQuickSettingsTransition(durationScale = durationScale)
}

private val DefaultDuration = 500.milliseconds
+5 −7
Original line number Diff line number Diff line
@@ -23,16 +23,14 @@ fun TransitionBuilder.shadeToQuickSettingsTransition(durationScale: Double = 1.0
    translate(Notifications.Elements.NotificationScrim, Edge.Bottom)
    timestampRange(endMillis = 83) { fade(QuickSettings.Elements.FooterActions) }

    translate(
        ShadeHeader.Elements.CollapsedContentStart,
        y = ShadeHeader.Dimensions.CollapsedHeight,
    )
    translate(ShadeHeader.Elements.CollapsedContentEnd, y = ShadeHeader.Dimensions.CollapsedHeight)
    val translationY = ShadeHeader.Dimensions.CollapsedHeightForTransitions
    translate(ShadeHeader.Elements.CollapsedContentStart, y = translationY)
    translate(ShadeHeader.Elements.CollapsedContentEnd, y = translationY)
    translate(
        ShadeHeader.Elements.ExpandedContent,
        y = -(ShadeHeader.Dimensions.ExpandedHeight - ShadeHeader.Dimensions.CollapsedHeight),
        y = -(ShadeHeader.Dimensions.ExpandedHeight - translationY),
    )
    translate(ShadeHeader.Elements.ShadeCarrierGroup, y = -ShadeHeader.Dimensions.CollapsedHeight)
    translate(ShadeHeader.Elements.ShadeCarrierGroup, y = -translationY)

    fractionRange(end = .14f) {
        fade(ShadeHeader.Elements.CollapsedContentStart)
+5 −6
Original line number Diff line number Diff line
@@ -24,17 +24,16 @@ import com.android.systemui.qs.ui.composable.QuickSettings
import com.android.systemui.shade.ui.composable.ShadeHeader
import kotlin.time.Duration.Companion.milliseconds

fun TransitionBuilder.toQuickSettingsTransition(
    durationScale: Double = 1.0,
) {
fun TransitionBuilder.toQuickSettingsTransition(durationScale: Double = 1.0) {
    spec = tween(durationMillis = (DefaultDuration * durationScale).inWholeMilliseconds.toInt())

    val translationY = ShadeHeader.Dimensions.CollapsedHeightForTransitions
    translate(
        ShadeHeader.Elements.ExpandedContent,
        y = -(ShadeHeader.Dimensions.ExpandedHeight - ShadeHeader.Dimensions.CollapsedHeight)
        y = -(ShadeHeader.Dimensions.ExpandedHeight - translationY),
    )
    translate(ShadeHeader.Elements.Clock, y = -ShadeHeader.Dimensions.CollapsedHeight)
    translate(ShadeHeader.Elements.ShadeCarrierGroup, y = -ShadeHeader.Dimensions.CollapsedHeight)
    translate(ShadeHeader.Elements.Clock, y = -translationY)
    translate(ShadeHeader.Elements.ShadeCarrierGroup, y = -translationY)

    fractionRange(start = .58f) {
        fade(ShadeHeader.Elements.ExpandedContent)
Loading