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

Commit 63601c4b authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge changes from topics "stl-content-picker", "stl-content-state",...

Merge changes from topics "stl-content-picker", "stl-content-state", "stl-static-picker", "stl-transition-state" into main

* changes:
  Allow to specify transitions between contents
  Introduce StaticElementContentPicker (1/2)
  Rename ElementScenePicker to ElementContentPicker (1/2)
  Use ContentState.Transition in Element.kt
  Extract ContentState out of TransitionState (1/2)
  Move TransitionState into its own file (1/2)
parents ee0fd4ee 41206691
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import com.android.compose.animation.scene.ContentKey
import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.ElementKey
import com.android.compose.animation.scene.ElementMatcher
import com.android.compose.animation.scene.LowestZIndexScenePicker
import com.android.compose.animation.scene.LowestZIndexContentPicker
import com.android.compose.animation.scene.MutableSceneTransitionLayoutState
import com.android.compose.animation.scene.SceneKey
import com.android.compose.animation.scene.SceneScope
@@ -62,7 +62,7 @@ import kotlin.time.DurationUnit

object Communal {
    object Elements {
        val Scrim = ElementKey("Scrim", scenePicker = LowestZIndexScenePicker)
        val Scrim = ElementKey("Scrim", contentPicker = LowestZIndexContentPicker)
        val Grid = ElementKey("CommunalContent")
        val LockIcon = ElementKey("CommunalLockIcon")
        val IndicationArea = ElementKey("CommunalIndicationArea")
+2 −2
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ constructor(
        applyPadding: Boolean,
        modifier: Modifier = Modifier,
    ) {
        MovableElement(
        Element(
            key = if (isStart) StartButtonElementKey else EndButtonElementKey,
            modifier = modifier,
        ) {
@@ -98,7 +98,7 @@ constructor(
    fun SceneScope.IndicationArea(
        modifier: Modifier = Modifier,
    ) {
        MovableElement(
        Element(
            key = IndicationAreaElementKey,
            modifier = modifier.indicationAreaPadding(),
        ) {
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ constructor(
            )
        }

        MovableElement(key = largeClockElementKey, modifier = modifier) {
        Element(key = largeClockElementKey, modifier = modifier) {
            content {
                AndroidView(
                    factory = { context ->
+58 −52
Original line number Diff line number Diff line
@@ -65,13 +65,16 @@ constructor(
    ) {
        val resources = LocalContext.current.resources

        MovableElement(key = ClockElementKeys.smartspaceElementKey, modifier = modifier) {
        Element(key = ClockElementKeys.smartspaceElementKey, modifier = modifier) {
            content {
                Column(
                    modifier =
                        modifier
                            .onTopPlacementChanged(onTopChanged)
                            .padding(
                            top = { lockscreenContentViewModel.getSmartSpacePaddingTop(resources) },
                                top = {
                                    lockscreenContentViewModel.getSmartSpacePaddingTop(resources)
                                },
                                bottom = {
                                    resources.getDimensionPixelSize(
                                        R.dimen.keyguard_status_view_bottom_margin
@@ -83,7 +86,8 @@ constructor(
                        return@Column
                    }

                val paddingBelowClockStart = dimensionResource(R.dimen.below_clock_padding_start)
                    val paddingBelowClockStart =
                        dimensionResource(R.dimen.below_clock_padding_start)
                    val paddingBelowClockEnd = dimensionResource(R.dimen.below_clock_padding_end)

                    if (keyguardSmartspaceViewModel.isDateWeatherDecoupled) {
@@ -91,7 +95,8 @@ constructor(
                            verticalAlignment = Alignment.CenterVertically,
                            modifier =
                                Modifier.fillMaxWidth()
                                // All items will be constrained to be as tall as the shortest item.
                                    // All items will be constrained to be as tall as the shortest
                                    // item.
                                    .height(IntrinsicSize.Min)
                                    .padding(
                                        start = paddingBelowClockStart,
@@ -130,6 +135,7 @@ constructor(
                }
            }
        }
    }

    @Composable
    private fun Card(
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ constructor(
        elementKey: ElementKey,
        modifier: Modifier = Modifier,
    ) {
        MovableElement(key = elementKey, modifier) {
        Element(key = elementKey, modifier) {
            content {
                AndroidView(
                    factory = {
Loading