Loading packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/ActionList.kt +2 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ fun ActionList( pillCenter: Offset = Offset.Unspecified, pillWidth: Float = 0f, rotation: Int = 0, inTaskBarOr3ButtonMode: Boolean = false, taskBarMode: Boolean = false, ) { val density = LocalDensity.current val minOverscrollDelta = (-8).dp Loading Loading @@ -308,7 +308,7 @@ fun ActionList( } .drawBehind { val sidePaddingPx = if (inTaskBarOr3ButtonMode && portrait) { if (taskBarMode) { pillCenter.x - actionListCenterPositionX } else { with(density) { scrimHorizontalPadding.toPx() } Loading packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/AmbientCueContainer.kt +9 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.padding import androidx.compose.material3.windowsizeclass.WindowHeightSizeClass import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect Loading Loading @@ -135,6 +136,11 @@ private fun TaskBarAnd3ButtonAmbientCue( } val content = LocalContext.current val rotation = content.display.rotation val windowWidthSizeClass = calculateWindowSizeClass().widthSizeClass val windowHeightSizeClass = calculateWindowSizeClass().heightSizeClass val largeScreen = (windowWidthSizeClass != WindowWidthSizeClass.Compact && windowHeightSizeClass != WindowHeightSizeClass.Compact) ActionList( actions = actions, Loading Loading @@ -178,7 +184,7 @@ private fun TaskBarAnd3ButtonAmbientCue( pillCenter = pillCenter, pillWidth = pillSize.width, rotation = rotation, inTaskBarOr3ButtonMode = true, taskBarMode = largeScreen, ) ShortPill( actions = actions, Loading @@ -186,6 +192,7 @@ private fun TaskBarAnd3ButtonAmbientCue( horizontal = portrait, expanded = expanded, rotation = rotation, taskBarMode = largeScreen, modifier = if (pillPositionInWindow == null) { modifier.padding(bottom = 12.dp, end = 24.dp).onGloballyPositioned { Loading Loading @@ -283,4 +290,4 @@ private const val NAV_BAR_HEIGHT_DP = 24 // R.dimen.taskbar_stashed_size from La private const val SHORT_PILL_ACTIONS_VERTICAL_PADDING = 38 private const val NAV_BAR_ACTIONS_PADDING = NAV_BAR_HEIGHT_DP + 24 private const val ACTIONS_HORIZONTAL_PADDING = 32 private const val ACTIONS_TOP_PADDING = 32 private const val ACTIONS_TOP_PADDING = 42 packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/ShortPill.kt +7 −5 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ fun ShortPill( visible: Boolean = true, expanded: Boolean = false, rotation: Int = 0, taskBarMode: Boolean = false, onClick: () -> Unit = {}, onCloseClick: () -> Unit = {}, ) { Loading Loading @@ -163,12 +164,13 @@ fun ShortPill( // SmartScrim val halfWidth = size.width / 2f val halfHeight = size.height / 2f val smartScrimRadius = 50.dp.toPx() if (!(halfWidth > 0) || !(halfHeight > 0)) return@drawBehind val scrimBrush = Brush.radialGradient( colors = listOf(scrimColor, scrimColor.copy(alpha = 0f)), center = Offset.Zero, radius = if (horizontal) halfWidth else halfHeight, radius = if (horizontal) smartScrimRadius * 0.9f else halfHeight, ) translate( left = Loading @@ -176,17 +178,17 @@ fun ShortPill( else { if (rotation == ROTATION_90) size.width else 0f }, top = if (horizontal) size.height else halfHeight, top = if (taskBarMode) size.height else halfHeight, ) { scale( scaleX = if (horizontal) 1f else 0.3f, scaleY = if (horizontal) 0.3f else 1f, scaleX = if (horizontal) 4.12f else 0.3f, scaleY = 1f, pivot = Offset.Zero, ) { drawCircle( brush = scrimBrush, alpha = smartScrimAlpha + smartScrimAlphaBoost, radius = if (horizontal) halfWidth else halfHeight, radius = if (horizontal) smartScrimRadius else halfHeight, center = Offset.Zero, ) } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/ActionList.kt +2 −2 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ fun ActionList( pillCenter: Offset = Offset.Unspecified, pillWidth: Float = 0f, rotation: Int = 0, inTaskBarOr3ButtonMode: Boolean = false, taskBarMode: Boolean = false, ) { val density = LocalDensity.current val minOverscrollDelta = (-8).dp Loading Loading @@ -308,7 +308,7 @@ fun ActionList( } .drawBehind { val sidePaddingPx = if (inTaskBarOr3ButtonMode && portrait) { if (taskBarMode) { pillCenter.x - actionListCenterPositionX } else { with(density) { scrimHorizontalPadding.toPx() } Loading
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/AmbientCueContainer.kt +9 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.padding import androidx.compose.material3.windowsizeclass.WindowHeightSizeClass import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect Loading Loading @@ -135,6 +136,11 @@ private fun TaskBarAnd3ButtonAmbientCue( } val content = LocalContext.current val rotation = content.display.rotation val windowWidthSizeClass = calculateWindowSizeClass().widthSizeClass val windowHeightSizeClass = calculateWindowSizeClass().heightSizeClass val largeScreen = (windowWidthSizeClass != WindowWidthSizeClass.Compact && windowHeightSizeClass != WindowHeightSizeClass.Compact) ActionList( actions = actions, Loading Loading @@ -178,7 +184,7 @@ private fun TaskBarAnd3ButtonAmbientCue( pillCenter = pillCenter, pillWidth = pillSize.width, rotation = rotation, inTaskBarOr3ButtonMode = true, taskBarMode = largeScreen, ) ShortPill( actions = actions, Loading @@ -186,6 +192,7 @@ private fun TaskBarAnd3ButtonAmbientCue( horizontal = portrait, expanded = expanded, rotation = rotation, taskBarMode = largeScreen, modifier = if (pillPositionInWindow == null) { modifier.padding(bottom = 12.dp, end = 24.dp).onGloballyPositioned { Loading Loading @@ -283,4 +290,4 @@ private const val NAV_BAR_HEIGHT_DP = 24 // R.dimen.taskbar_stashed_size from La private const val SHORT_PILL_ACTIONS_VERTICAL_PADDING = 38 private const val NAV_BAR_ACTIONS_PADDING = NAV_BAR_HEIGHT_DP + 24 private const val ACTIONS_HORIZONTAL_PADDING = 32 private const val ACTIONS_TOP_PADDING = 32 private const val ACTIONS_TOP_PADDING = 42
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/ShortPill.kt +7 −5 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ fun ShortPill( visible: Boolean = true, expanded: Boolean = false, rotation: Int = 0, taskBarMode: Boolean = false, onClick: () -> Unit = {}, onCloseClick: () -> Unit = {}, ) { Loading Loading @@ -163,12 +164,13 @@ fun ShortPill( // SmartScrim val halfWidth = size.width / 2f val halfHeight = size.height / 2f val smartScrimRadius = 50.dp.toPx() if (!(halfWidth > 0) || !(halfHeight > 0)) return@drawBehind val scrimBrush = Brush.radialGradient( colors = listOf(scrimColor, scrimColor.copy(alpha = 0f)), center = Offset.Zero, radius = if (horizontal) halfWidth else halfHeight, radius = if (horizontal) smartScrimRadius * 0.9f else halfHeight, ) translate( left = Loading @@ -176,17 +178,17 @@ fun ShortPill( else { if (rotation == ROTATION_90) size.width else 0f }, top = if (horizontal) size.height else halfHeight, top = if (taskBarMode) size.height else halfHeight, ) { scale( scaleX = if (horizontal) 1f else 0.3f, scaleY = if (horizontal) 0.3f else 1f, scaleX = if (horizontal) 4.12f else 0.3f, scaleY = 1f, pivot = Offset.Zero, ) { drawCircle( brush = scrimBrush, alpha = smartScrimAlpha + smartScrimAlphaBoost, radius = if (horizontal) halfWidth else halfHeight, radius = if (horizontal) smartScrimRadius else halfHeight, center = Offset.Zero, ) } Loading