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

Commit d2656a9c authored by Bryce Lee's avatar Bryce Lee Committed by Android (Google) Code Review
Browse files

Merge "Allow swiping to Glanceable Hub by config." into main

parents 6747443b 37d24564
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -200,8 +200,9 @@ fun CommunalContainer(
        scene(
            CommunalScenes.Blank,
            userActions =
                if (viewModel.v2FlagEnabled()) emptyMap()
                else mapOf(Swipe.Start(fromSource = Edge.End) to CommunalScenes.Communal),
                if (viewModel.swipeToHubEnabled())
                    mapOf(Swipe.Start(fromSource = Edge.End) to CommunalScenes.Communal)
                else emptyMap(),
        ) {
            // This scene shows nothing only allowing for transitions to the communal scene.
            Box(modifier = Modifier.fillMaxSize())
+1 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
            metricsLogger,
            kosmos.mediaCarouselController,
            kosmos.blurConfig,
            false,
        )
    }

+3 −0
Original line number Diff line number Diff line
@@ -1110,4 +1110,7 @@
    <!-- Configuration for wallpaper focal area -->
    <bool name="center_align_focal_area_shape">false</bool>
    <string name="focal_area_target" translatable="false" />

    <!-- Configuration to swipe to open glanceable hub -->
    <bool name="config_swipeToOpenGlanceableHub">false</bool>
</resources>
+7 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ interface CommunalModule {
    companion object {
        const val LOGGABLE_PREFIXES = "loggable_prefixes"
        const val LAUNCHER_PACKAGE = "launcher_package"
        const val SWIPE_TO_HUB = "swipe_to_hub"

        @Provides
        @Communal
@@ -143,5 +144,11 @@ interface CommunalModule {
        fun provideLauncherPackage(@Main resources: Resources): String {
            return resources.getString(R.string.launcher_overlayable_package)
        }

        @Provides
        @Named(SWIPE_TO_HUB)
        fun provideSwipeToHub(@Main resources: Resources): Boolean {
            return resources.getBoolean(R.bool.config_swipeToOpenGlanceableHub)
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.communal.ui.viewmodel
import android.content.ComponentName
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.systemui.Flags
import com.android.systemui.communal.dagger.CommunalModule.Companion.SWIPE_TO_HUB
import com.android.systemui.communal.domain.interactor.CommunalInteractor
import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
@@ -92,6 +93,7 @@ constructor(
    private val metricsLogger: CommunalMetricsLogger,
    mediaCarouselController: MediaCarouselController,
    blurConfig: BlurConfig,
    @Named(SWIPE_TO_HUB) private val swipeToHub: Boolean,
) :
    BaseCommunalViewModel(
        communalSceneInteractor,
@@ -357,6 +359,8 @@ constructor(
    /** See [CommunalSettingsInteractor.isV2FlagEnabled] */
    fun v2FlagEnabled(): Boolean = communalSettingsInteractor.isV2FlagEnabled()

    fun swipeToHubEnabled(): Boolean = swipeToHub

    companion object {
        const val POPUP_AUTO_HIDE_TIMEOUT_MS = 12000L
    }
Loading