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

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

Merge changes from topics "stl-movable-refactor", "stl-picker-rename",...

Merge changes from topics "stl-movable-refactor", "stl-picker-rename", "stl-remove-isbackground", "stl-ucs" into main

* changes:
  Introduce MovableElementScenePicker
  Remove ElementKey.isBackground (1/2)
  Rename SharedElementScenePicker to ElementScenePicker (1/2)
  Make (Movable)ElementScope extend ElementBoxScope
  Work around b/317972419
  Make the Element map a normal Map
  Extract movable contents outside of the Element class
  Rename Element.TargetValues to Element.SceneState
  Extract shared values outside of the Element class
  Replace AnimatedState.valueOrNull by unsafeCompositionState (1/2)
  Refactor animate(Scene|Element)FooAsState (1/2)
  Make animated values normal State objects
  Compose movable elements in the scene picked by the ScenePicker (1/2)
  Split SceneScope.MovableElement with SceneSope.Element (1/2)
  Move scene picker definition inside ElementKey (1/2)
parents 1315a699 aa4ecae1
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class AmbientIndicationSection @Inject constructor() {
            key = AmbientIndicationElementKey,
            modifier = modifier,
        ) {
            content {
                Box(
                    modifier = Modifier.fillMaxWidth().background(Color.Green),
                ) {
@@ -47,5 +48,6 @@ class AmbientIndicationSection @Inject constructor() {
            }
        }
    }
}

private val AmbientIndicationElementKey = ElementKey("AmbientIndication")
+23 −19
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ constructor(
            key = if (isStart) StartButtonElementKey else EndButtonElementKey,
            modifier = modifier,
        ) {
            content {
                Shortcut(
                    viewId = if (isStart) R.id.start_button else R.id.end_button,
                    viewModel = if (isStart) viewModel.startButton else viewModel.endButton,
@@ -90,6 +91,7 @@ constructor(
                )
            }
        }
    }

    @Composable
    fun SceneScope.IndicationArea(
@@ -99,6 +101,7 @@ constructor(
            key = IndicationAreaElementKey,
            modifier = modifier.shortcutPadding(),
        ) {
            content {
                IndicationArea(
                    indicationAreaViewModel = indicationAreaViewModel,
                    alphaViewModel = alphaViewModel,
@@ -106,6 +109,7 @@ constructor(
                )
            }
        }
    }

    @Composable
    fun shortcutSizeDp(): DpSize {
+23 −19
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ constructor(
            key = ClockElementKey,
            modifier = modifier,
        ) {
            content {
                Box(
                    modifier =
                        Modifier.fillMaxWidth()
@@ -63,6 +64,7 @@ constructor(
                }
            }
        }
    }

    @Composable
    fun SceneScope.LargeClock(modifier: Modifier = Modifier) {
@@ -74,6 +76,7 @@ constructor(
            key = ClockElementKey,
            modifier = modifier,
        ) {
            content {
                Box(
                    modifier = Modifier.fillMaxWidth().background(Color.Blue),
                ) {
@@ -86,5 +89,6 @@ constructor(
            }
        }
    }
}

private val ClockElementKey = ElementKey("Clock")
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import com.android.compose.animation.scene.SceneScope
import com.android.systemui.notifications.ui.composable.NotificationStack
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher

class NotificationSection
@Inject
+33 −27
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ constructor(
            key = StatusBarElementKey,
            modifier = modifier,
        ) {
            content {
                AndroidView(
                    factory = {
                        notificationPanelView.get().findViewById<View>(R.id.keyguard_header)?.let {
@@ -63,6 +64,7 @@ constructor(
                            object : ShadeViewStateProvider {
                                override val lockscreenShadeDragProgress: Float = 0f
                                override val panelViewExpandedHeight: Float = 0f

                                override fun shouldHeadsUpBeVisible(): Boolean {
                                    return false
                                }
@@ -76,7 +78,10 @@ constructor(
                                    null,
                                    false,
                                ) as KeyguardStatusBarView
                    componentFactory.build(view, provider).keyguardStatusBarViewController.init()
                        componentFactory
                            .build(view, provider)
                            .keyguardStatusBarViewController
                            .init()
                        view
                    },
                    modifier =
@@ -87,5 +92,6 @@ constructor(
            }
        }
    }
}

private val StatusBarElementKey = ElementKey("StatusBar")
Loading