Loading packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/ActionList.kt +0 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier Loading @@ -50,7 +49,6 @@ fun ActionList( actions.forEachIndexed { index, action -> AnimatedVisibility( visible = visible, modifier = Modifier.padding(horizontal = 32.dp), enter = slideInVertically( spring( Loading packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/AmbientCueContainer.kt +13 −5 Original line number Diff line number Diff line Loading @@ -118,10 +118,12 @@ private fun TaskBarAnd3ButtonAmbientCue( ) { val configuration = LocalConfiguration.current val density = LocalDensity.current val actionsPaddingPx = with(density) { SHORT_PILL_ACTIONS_PADDING.dp.toPx() } val actionsVerticalPaddingPx = with(density) { SHORT_PILL_ACTIONS_VERTICAL_PADDING.dp.toPx() } val actionsHorizontalPaddingPx = with(density) { ACTIONS_HORIZONTAL_PADDING.dp.toPx() } val portrait = configuration.orientation == Configuration.ORIENTATION_PORTRAIT var pillCenter by remember { mutableStateOf(Offset.Zero) } val screenHeightPx = with(density) { configuration.screenHeightDp.dp.toPx() } val screenWidthPx = with(density) { configuration.screenWidthDp.dp.toPx() } var touchableRegion by remember { mutableStateOf<Rect?>(null) } LaunchedEffect(expanded, touchableRegion) { onShouldInterceptTouches(true, if (expanded) null else touchableRegion) Loading Loading @@ -177,8 +179,8 @@ private fun TaskBarAnd3ButtonAmbientCue( horizontalAlignment = Alignment.End, modifier = modifier.graphicsLayer { translationX = pillCenter.x - size.width - actionsPaddingPx translationY = pillCenter.y - size.height - actionsPaddingPx translationX = screenWidthPx - size.width - actionsHorizontalPaddingPx translationY = pillCenter.y - size.height - actionsVerticalPaddingPx }, ) } Loading Loading @@ -212,7 +214,12 @@ private fun NavBarAmbientCue( ActionList( actions = actions, visible = visible && expanded, modifier = modifier.padding(bottom = NAV_BAR_ACTIONS_PADDING.dp), modifier = modifier.padding( bottom = NAV_BAR_ACTIONS_PADDING.dp, start = ACTIONS_HORIZONTAL_PADDING.dp, end = ACTIONS_HORIZONTAL_PADDING.dp, ), ) } Loading @@ -220,5 +227,6 @@ private const val NAV_BAR_WIDTH_DP = 108 // R.dimen.taskbar_stashed_small_screen private const val NAV_BAR_LARGE_WIDTH_DP = 220 // R.dimen.taskbar_stashed_handle_width from Launcher private const val NAV_BAR_HEIGHT_DP = 24 // R.dimen.taskbar_stashed_size from Launcher private const val SHORT_PILL_ACTIONS_PADDING = 38 private const val SHORT_PILL_ACTIONS_VERTICAL_PADDING = 38 private const val NAV_BAR_ACTIONS_PADDING = NAV_BAR_HEIGHT_DP + 22 private const val ACTIONS_HORIZONTAL_PADDING = 32 Loading
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/ActionList.kt +0 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier Loading @@ -50,7 +49,6 @@ fun ActionList( actions.forEachIndexed { index, action -> AnimatedVisibility( visible = visible, modifier = Modifier.padding(horizontal = 32.dp), enter = slideInVertically( spring( Loading
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/AmbientCueContainer.kt +13 −5 Original line number Diff line number Diff line Loading @@ -118,10 +118,12 @@ private fun TaskBarAnd3ButtonAmbientCue( ) { val configuration = LocalConfiguration.current val density = LocalDensity.current val actionsPaddingPx = with(density) { SHORT_PILL_ACTIONS_PADDING.dp.toPx() } val actionsVerticalPaddingPx = with(density) { SHORT_PILL_ACTIONS_VERTICAL_PADDING.dp.toPx() } val actionsHorizontalPaddingPx = with(density) { ACTIONS_HORIZONTAL_PADDING.dp.toPx() } val portrait = configuration.orientation == Configuration.ORIENTATION_PORTRAIT var pillCenter by remember { mutableStateOf(Offset.Zero) } val screenHeightPx = with(density) { configuration.screenHeightDp.dp.toPx() } val screenWidthPx = with(density) { configuration.screenWidthDp.dp.toPx() } var touchableRegion by remember { mutableStateOf<Rect?>(null) } LaunchedEffect(expanded, touchableRegion) { onShouldInterceptTouches(true, if (expanded) null else touchableRegion) Loading Loading @@ -177,8 +179,8 @@ private fun TaskBarAnd3ButtonAmbientCue( horizontalAlignment = Alignment.End, modifier = modifier.graphicsLayer { translationX = pillCenter.x - size.width - actionsPaddingPx translationY = pillCenter.y - size.height - actionsPaddingPx translationX = screenWidthPx - size.width - actionsHorizontalPaddingPx translationY = pillCenter.y - size.height - actionsVerticalPaddingPx }, ) } Loading Loading @@ -212,7 +214,12 @@ private fun NavBarAmbientCue( ActionList( actions = actions, visible = visible && expanded, modifier = modifier.padding(bottom = NAV_BAR_ACTIONS_PADDING.dp), modifier = modifier.padding( bottom = NAV_BAR_ACTIONS_PADDING.dp, start = ACTIONS_HORIZONTAL_PADDING.dp, end = ACTIONS_HORIZONTAL_PADDING.dp, ), ) } Loading @@ -220,5 +227,6 @@ private const val NAV_BAR_WIDTH_DP = 108 // R.dimen.taskbar_stashed_small_screen private const val NAV_BAR_LARGE_WIDTH_DP = 220 // R.dimen.taskbar_stashed_handle_width from Launcher private const val NAV_BAR_HEIGHT_DP = 24 // R.dimen.taskbar_stashed_size from Launcher private const val SHORT_PILL_ACTIONS_PADDING = 38 private const val SHORT_PILL_ACTIONS_VERTICAL_PADDING = 38 private const val NAV_BAR_ACTIONS_PADDING = NAV_BAR_HEIGHT_DP + 22 private const val ACTIONS_HORIZONTAL_PADDING = 32