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

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

Merge "Support shape effects layout in lockscreen when SceneContainerFlag is on" into main

parents 5d021f9a 807ca112
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ constructor(
                        SmallClock(
                            burnInParams = burnIn.parameters,
                            onTopChanged = burnIn.onSmallClockTopChanged,
                            onBottomChanged = { bottom -> viewModel.setSmallClockBottom(bottom) },
                        )
                    }
                },
@@ -107,13 +108,21 @@ constructor(
                        SmartSpace(
                            burnInParams = burnIn.parameters,
                            onTopChanged = burnIn.onSmartspaceTopChanged,
                            onBottomChanged = { bottom ->
                                viewModel.setSmartspaceCardBottom(bottom)
                            },
                            smartSpacePaddingTop = { 0 },
                        )
                    }
                },
                media = {
                    with(mediaCarouselElement) {
                        KeyguardMediaCarousel(isShadeLayoutWide = viewModel.isShadeLayoutWide)
                        KeyguardMediaCarousel(
                            isShadeLayoutWide = viewModel.isShadeLayoutWide,
                            onBottomChanged = { bottom ->
                                viewModel.setMediaPlayerBottom(bottom = bottom)
                            },
                        )
                    }
                },
                notifications = {
@@ -126,7 +135,13 @@ constructor(
                },
                lockIcon = { with(lockElement) { LockIcon() } },
                startShortcut = {
                    with(shortcutElement) { Shortcut(isStart = true, applyPadding = false) }
                    with(shortcutElement) {
                        Shortcut(
                            isStart = true,
                            applyPadding = false,
                            onTopChanged = { top -> viewModel.setShortcutTop(top) },
                        )
                    }
                },
                ambientIndication = {
                    if (ambientIndicationElementOptional.isPresent) {
@@ -141,7 +156,13 @@ constructor(
                    }
                },
                endShortcut = {
                    with(shortcutElement) { Shortcut(isStart = false, applyPadding = false) }
                    with(shortcutElement) {
                        Shortcut(
                            isStart = false,
                            applyPadding = false,
                            onTopChanged = { top -> viewModel.setShortcutTop(top) },
                        )
                    }
                },
                settingsMenu = {
                    with(settingsMenuElement) { SettingsMenu(onPlaced = onSettingsMenuPlaced) }
+11 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.res.dimensionResource
import com.android.compose.animation.scene.ContentScope
import com.android.systemui.media.controls.ui.composable.MediaCarousel
@@ -41,6 +43,7 @@ constructor(
    fun ContentScope.KeyguardMediaCarousel(
        isShadeLayoutWide: Boolean,
        modifier: Modifier = Modifier,
        onBottomChanged: ((Float) -> Unit)? = null,
    ) {
        val horizontalPadding =
            if (isShadeLayoutWide) {
@@ -52,8 +55,15 @@ constructor(
        MediaCarousel(
            isVisible = true,
            mediaHost = mediaHost,
            modifier = modifier.fillMaxWidth().padding(horizontal = horizontalPadding),
            modifier =
                modifier
                    .fillMaxWidth()
                    .padding(horizontal = horizontalPadding)
                    .onGloballyPositioned { coordinates ->
                        onBottomChanged?.invoke(coordinates.boundsInWindow().bottom)
                    },
            carouselController = mediaCarouselController,
            onReleaseCallback = { onBottomChanged?.invoke(0f) },
        )
    }
}
+11 −5
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.viewinterop.AndroidView
@@ -58,6 +60,7 @@ constructor(
    fun ContentScope.Shortcut(
        isStart: Boolean,
        applyPadding: Boolean,
        onTopChanged: ((Float) -> Unit)? = null,
        modifier: Modifier = Modifier,
    ) {
        Element(
@@ -71,10 +74,13 @@ constructor(
                indicationController = indicationController,
                binder = keyguardQuickAffordanceViewBinder,
                modifier =
                    if (applyPadding) {
                    (if (applyPadding) {
                            Modifier.shortcutPadding()
                        } else {
                            Modifier
                        })
                        .onGloballyPositioned { coordinates ->
                            onTopChanged?.invoke(coordinates.boundsInWindow().top)
                        },
            )
        }
+8 −2
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.res.dimensionResource
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.scene.ContentScope
@@ -44,9 +46,10 @@ constructor(

    @Composable
    fun ContentScope.SmallClock(
        modifier: Modifier = Modifier,
        burnInParams: BurnInParameters,
        onTopChanged: (top: Float?) -> Unit,
        modifier: Modifier = Modifier,
        onBottomChanged: ((Float) -> Unit)? = null,
    ) {
        val currentClock by viewModel.currentClock.collectAsStateWithLifecycle()
        val smallTopMargin by
@@ -66,7 +69,10 @@ constructor(
                    .padding(top = { smallTopMargin })
                    .onTopPlacementChanged(onTopChanged)
                    .burnInAware(viewModel = aodBurnInViewModel, params = burnInParams)
                    .element(smallClockElementKey),
                    .element(smallClockElementKey)
                    .onGloballyPositioned { coordinates ->
                        onBottomChanged?.invoke(coordinates.boundsInWindow().bottom)
                    },
        )
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalResources
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.dp
@@ -60,6 +62,7 @@ constructor(
    fun ContentScope.SmartSpace(
        burnInParams: BurnInParameters,
        onTopChanged: (top: Float?) -> Unit,
        onBottomChanged: ((Float) -> Unit)?,
        smartSpacePaddingTop: (Resources) -> Int,
        modifier: Modifier = Modifier,
    ) {
@@ -120,6 +123,9 @@ constructor(
                        Modifier.fillMaxWidth()
                            .padding(start = paddingCardHorizontal, end = paddingCardHorizontal)
                            .burnInAware(viewModel = aodBurnInViewModel, params = burnInParams)
                            .onGloballyPositioned { coordinates ->
                                onBottomChanged?.invoke(coordinates.boundsInWindow().bottom)
                            }
                )
            }
        }
Loading