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

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

Merge "Increase swipe gesture areas for hub" into main

parents 9215d239 5e12ed6c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.res.dimensionResource
import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.ElementKey
import com.android.compose.animation.scene.FixedSizeEdgeDetector
@@ -29,6 +29,7 @@ import com.android.systemui.communal.shared.model.ObservableCommunalTransitionSt
import com.android.systemui.communal.ui.compose.extensions.allowGestures
import com.android.systemui.communal.ui.viewmodel.BaseCommunalViewModel
import com.android.systemui.communal.ui.viewmodel.CommunalViewModel
import com.android.systemui.res.R
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.transform

@@ -91,7 +92,10 @@ fun CommunalContainer(
    SceneTransitionLayout(
        state = sceneTransitionLayoutState,
        modifier = modifier.fillMaxSize().allowGestures(allowed = touchesAllowed),
        swipeSourceDetector = FixedSizeEdgeDetector(ContainerDimensions.EdgeSwipeSize),
        swipeSourceDetector =
            FixedSizeEdgeDetector(
                dimensionResource(id = R.dimen.communal_gesture_initiation_width)
            ),
    ) {
        scene(
            TransitionSceneKey.Blank,
@@ -167,7 +171,3 @@ fun ObservableTransitionState.toModel(): ObservableCommunalTransitionState {
            )
    }
}

object ContainerDimensions {
    val EdgeSwipeSize = 40.dp
}
+10 −7
Original line number Diff line number Diff line
@@ -1742,12 +1742,18 @@
    <dimen name="communal_grid_height">630dp</dimen>
    <!-- Number of columns for each communal card -->
    <integer name="communal_grid_columns_per_card">6</integer>
    <!-- Width of area on right edge of screen in which swipes will open the communal hub -->
    <dimen name="communal_right_edge_swipe_region_width">16dp</dimen>

    <!-- The width of the swipe target to initiate opening or closing communal hub. -->
    <dimen name="communal_gesture_initiation_width">68dp</dimen>

    <!-- TODO(b/322549765): unify with communal_gesture_initiation_width -->
    <!-- Width of area on right edge of screen in which swipes will open the communal hub when on
    the lockscreen -->
    <dimen name="communal_right_edge_swipe_region_width">40dp</dimen>
    <!-- Height of area at top of communal hub where swipes should open the notification shade -->
    <dimen name="communal_top_edge_swipe_region_height">32dp</dimen>
    <dimen name="communal_top_edge_swipe_region_height">68dp</dimen>
    <!-- Height of area at bottom of communal hub where swipes should open the bouncer -->
    <dimen name="communal_bottom_edge_swipe_region_height">32dp</dimen>
    <dimen name="communal_bottom_edge_swipe_region_height">68dp</dimen>

    <dimen name="drag_and_drop_icon_size">70dp</dimen>

@@ -1819,9 +1825,6 @@
    <dimen name="dream_overlay_complication_smartspace_padding">24dp</dimen>
    <dimen name="dream_overlay_complication_smartspace_max_width">408dp</dimen>

    <!-- The width of the swipe target to initiate opening communal hub over dreams. -->
    <dimen name="communal_gesture_initiation_width">48dp</dimen>

    <!-- The position of the end guide, which dream overlay complications can align their start with
         if their end is aligned with the parent end. Represented as the percentage over from the
         start of the parent container. -->