Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt +13 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredHeightIn import androidx.compose.foundation.layout.requiredWidthIn import androidx.compose.foundation.layout.safeContent import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBarsPadding Loading @@ -78,6 +77,7 @@ import androidx.compose.foundation.lazy.grid.LazyGridState import androidx.compose.foundation.lazy.grid.itemsIndexed import androidx.compose.foundation.lazy.grid.rememberLazyGridState import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.InlineTextContent import androidx.compose.foundation.verticalScroll Loading Loading @@ -119,6 +119,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.isSpecified Loading Loading @@ -211,6 +212,7 @@ import com.android.systemui.qs.panels.ui.viewmodel.InfiniteGridSnapshotViewModel import com.android.systemui.qs.pipeline.shared.TileSpec import com.android.systemui.qs.shared.model.TileCategory import com.android.systemui.qs.shared.model.groupAndSort import com.android.systemui.qs.ui.compose.borderOnFocus import com.android.systemui.res.R import kotlin.math.abs import kotlin.math.roundToInt Loading Loading @@ -1220,8 +1222,13 @@ private fun LazyGridItemScope.TileGridCell( customActions = actions } } .borderOnFocus( MaterialTheme.colorScheme.secondary, CornerSize(InactiveCornerRadius), ) .thenIf(isSelectable) { draggableModifier } .tileBackground { backgroundColor } .clickable { selectionState.onTap(cell.tile.tileSpec) } .thenIf(isSelectable) { selectableModifier } ) { EditTile( Loading Loading @@ -1315,6 +1322,10 @@ private fun AvailableTileGridCell( Box( Modifier.then(draggableModifier) .fillMaxSize() .borderOnFocus( MaterialTheme.colorScheme.secondary, CornerSize(InactiveCornerRadius), ) .tileBackground { colors.background } .clickable( enabled = !cell.isCurrent, Loading @@ -1336,6 +1347,7 @@ private fun AvailableTileGridCell( contentDescription = clickLabel, enabled = !cell.isCurrent, onClick = onClick, modifier = Modifier.focusProperties { canFocus = false }, ) } Box(Modifier.fillMaxSize()) { Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/selection/Selection.kt +10 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxScope import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.systemGestureExclusion import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Remove Loading Loading @@ -86,6 +87,7 @@ import com.android.systemui.qs.panels.ui.compose.selection.TileState.None import com.android.systemui.qs.panels.ui.compose.selection.TileState.Placeable import com.android.systemui.qs.panels.ui.compose.selection.TileState.Removable import com.android.systemui.qs.panels.ui.compose.selection.TileState.Selected import com.android.systemui.qs.ui.compose.borderOnFocus import kotlin.math.cos import kotlin.math.min import kotlin.math.roundToInt Loading Loading @@ -221,10 +223,15 @@ fun StaticTileBadge( contentDescription: String?, enabled: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, ) { val offset = with(LocalDensity.current) { Offset(BadgeXOffset.toPx(), BadgeYOffset.toPx()) } val alpha by animateFloatAsState(if (enabled) 1f else 0f) MinimumInteractiveSizeComponent(angle = { BADGE_ANGLE_RAD }, offset = { offset }) { MinimumInteractiveSizeComponent( angle = { BADGE_ANGLE_RAD }, offset = { offset }, modifier = modifier, ) { Box( Modifier.fillMaxSize() .graphicsLayer { this.alpha = alpha } Loading Loading @@ -276,7 +283,8 @@ private fun MinimumInteractiveSizeComponent( } .thenIf(excludeSystemGesture) { Modifier.systemGestureExclusion { Rect(Offset.Zero, it.size.toSize()) } }, } .borderOnFocus(MaterialTheme.colorScheme.secondary, CornerSize(50)), content = content, ) } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt +13 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredHeightIn import androidx.compose.foundation.layout.requiredWidthIn import androidx.compose.foundation.layout.safeContent import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBarsPadding Loading @@ -78,6 +77,7 @@ import androidx.compose.foundation.lazy.grid.LazyGridState import androidx.compose.foundation.lazy.grid.itemsIndexed import androidx.compose.foundation.lazy.grid.rememberLazyGridState import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.InlineTextContent import androidx.compose.foundation.verticalScroll Loading Loading @@ -119,6 +119,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.isSpecified Loading Loading @@ -211,6 +212,7 @@ import com.android.systemui.qs.panels.ui.viewmodel.InfiniteGridSnapshotViewModel import com.android.systemui.qs.pipeline.shared.TileSpec import com.android.systemui.qs.shared.model.TileCategory import com.android.systemui.qs.shared.model.groupAndSort import com.android.systemui.qs.ui.compose.borderOnFocus import com.android.systemui.res.R import kotlin.math.abs import kotlin.math.roundToInt Loading Loading @@ -1220,8 +1222,13 @@ private fun LazyGridItemScope.TileGridCell( customActions = actions } } .borderOnFocus( MaterialTheme.colorScheme.secondary, CornerSize(InactiveCornerRadius), ) .thenIf(isSelectable) { draggableModifier } .tileBackground { backgroundColor } .clickable { selectionState.onTap(cell.tile.tileSpec) } .thenIf(isSelectable) { selectableModifier } ) { EditTile( Loading Loading @@ -1315,6 +1322,10 @@ private fun AvailableTileGridCell( Box( Modifier.then(draggableModifier) .fillMaxSize() .borderOnFocus( MaterialTheme.colorScheme.secondary, CornerSize(InactiveCornerRadius), ) .tileBackground { colors.background } .clickable( enabled = !cell.isCurrent, Loading @@ -1336,6 +1347,7 @@ private fun AvailableTileGridCell( contentDescription = clickLabel, enabled = !cell.isCurrent, onClick = onClick, modifier = Modifier.focusProperties { canFocus = false }, ) } Box(Modifier.fillMaxSize()) { Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/selection/Selection.kt +10 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxScope import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.systemGestureExclusion import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Remove Loading Loading @@ -86,6 +87,7 @@ import com.android.systemui.qs.panels.ui.compose.selection.TileState.None import com.android.systemui.qs.panels.ui.compose.selection.TileState.Placeable import com.android.systemui.qs.panels.ui.compose.selection.TileState.Removable import com.android.systemui.qs.panels.ui.compose.selection.TileState.Selected import com.android.systemui.qs.ui.compose.borderOnFocus import kotlin.math.cos import kotlin.math.min import kotlin.math.roundToInt Loading Loading @@ -221,10 +223,15 @@ fun StaticTileBadge( contentDescription: String?, enabled: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, ) { val offset = with(LocalDensity.current) { Offset(BadgeXOffset.toPx(), BadgeYOffset.toPx()) } val alpha by animateFloatAsState(if (enabled) 1f else 0f) MinimumInteractiveSizeComponent(angle = { BADGE_ANGLE_RAD }, offset = { offset }) { MinimumInteractiveSizeComponent( angle = { BADGE_ANGLE_RAD }, offset = { offset }, modifier = modifier, ) { Box( Modifier.fillMaxSize() .graphicsLayer { this.alpha = alpha } Loading Loading @@ -276,7 +283,8 @@ private fun MinimumInteractiveSizeComponent( } .thenIf(excludeSystemGesture) { Modifier.systemGestureExclusion { Rect(Offset.Zero, it.size.toSize()) } }, } .borderOnFocus(MaterialTheme.colorScheme.secondary, CornerSize(50)), content = content, ) } Loading