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

Commit 73d5e7b8 authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Update communal background to be animated by default" into main

parents 0db977b6 524018b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ fun CommunalContainer(
        viewModel.showGestureIndicator.collectAsStateWithLifecycle(initialValue = false)
    val backgroundType by
        viewModel.communalBackground.collectAsStateWithLifecycle(
            initialValue = CommunalBackgroundType.DEFAULT
            initialValue = CommunalBackgroundType.ANIMATED
        )
    val state: MutableSceneTransitionLayoutState = remember {
        MutableSceneTransitionLayoutState(
@@ -243,7 +243,7 @@ private fun SceneScope.CommunalScene(
) {
    Box(modifier = Modifier.element(Communal.Elements.Scrim).fillMaxSize()) {
        when (backgroundType) {
            CommunalBackgroundType.DEFAULT -> DefaultBackground(colors = colors)
            CommunalBackgroundType.STATIC -> DefaultBackground(colors = colors)
            CommunalBackgroundType.STATIC_GRADIENT -> StaticLinearGradient()
            CommunalBackgroundType.ANIMATED -> AnimatedLinearGradient()
            CommunalBackgroundType.NONE -> BackgroundTopScrim()
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ class CommunalSettingsRepositoryImplTest : SysuiTestCase() {
    fun backgroundType_defaultValue() =
        testScope.runTest {
            val backgroundType by collectLastValue(underTest.getBackground(PRIMARY_USER))
            assertThat(backgroundType).isEqualTo(CommunalBackgroundType.DEFAULT)
            assertThat(backgroundType).isEqualTo(CommunalBackgroundType.ANIMATED)
        }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -115,11 +115,11 @@ constructor(
                val intType =
                    secureSettings.getIntForUser(
                        GLANCEABLE_HUB_BACKGROUND_SETTING,
                        CommunalBackgroundType.DEFAULT.value,
                        CommunalBackgroundType.ANIMATED.value,
                        user.id
                    )
                CommunalBackgroundType.entries.find { type -> type.value == intType }
                    ?: CommunalBackgroundType.DEFAULT
                    ?: CommunalBackgroundType.ANIMATED
            }

    private fun getEnabledByUser(user: UserInfo): Flow<Boolean> =
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.systemui.communal.shared.model

/** Models the types of background that can be shown on the hub. */
enum class CommunalBackgroundType(val value: Int) {
    DEFAULT(0),
    STATIC(0),
    STATIC_GRADIENT(1),
    ANIMATED(2),
    NONE(3),
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ constructor(
        Color.valueOf(
            Utils.getColorAttrDefaultColor(
                context,
                com.android.internal.R.attr.materialColorOutlineVariant
                com.android.internal.R.attr.materialColorPrimary
            )
        )
}