Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/QuickQuickSettings.kt +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ fun ContentScope.QuickQuickSettings( viewModel.tileHapticsViewModelFactoryProvider, // There should be no QuickQuickSettings when the details view is enabled. detailsViewModel = null, isVisible = listening, ) } } Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/CommonTile.kt +38 −18 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.key import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue Loading Loading @@ -102,6 +103,7 @@ fun LargeTileContent( sideDrawable: Drawable?, colors: TileColors, squishiness: () -> Float, isVisible: () -> Boolean = { true }, accessibilityUiState: AccessibilityUiState? = null, iconShape: RoundedCornerShape = RoundedCornerShape(CommonTileDefaults.InactiveCornerRadius), toggleClick: (() -> Unit)? = null, Loading Loading @@ -158,6 +160,7 @@ fun LargeTileContent( secondaryLabel = secondaryLabel, colors = colors, accessibilityUiState = accessibilityUiState, isVisible = isVisible, ) if (sideDrawable != null) { Loading @@ -176,6 +179,7 @@ fun LargeTileLabels( secondaryLabel: String?, colors: TileColors, modifier: Modifier = Modifier, isVisible: () -> Boolean = { true }, accessibilityUiState: AccessibilityUiState? = null, ) { val animatedLabelColor by animateColorAsState(colors.label, label = "QSTileLabelColor") Loading @@ -186,12 +190,14 @@ fun LargeTileLabels( text = label, style = MaterialTheme.typography.labelLarge, color = { animatedLabelColor }, isVisible = isVisible, ) if (!TextUtils.isEmpty(secondaryLabel)) { TileLabel( secondaryLabel ?: "", color = { animatedSecondaryLabelColor }, style = MaterialTheme.typography.bodyMedium, isVisible = isVisible, modifier = Modifier.thenIf( accessibilityUiState?.stateDescription?.contains(secondaryLabel ?: "") == Loading Loading @@ -277,18 +283,27 @@ private fun TileLabel( color: ColorProducer, style: TextStyle, modifier: Modifier = Modifier, isVisible: () -> Boolean = { true }, ) { var textSize by remember { mutableIntStateOf(0) } BasicText( text = text, color = color, style = style, maxLines = 1, onTextLayout = { textSize = it.size.width }, modifier = modifier .fillMaxWidth() .graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen } .graphicsLayer { if (textSize > size.width) { compositingStrategy = CompositingStrategy.Offscreen } } .drawWithContent { drawContent() if (textSize > size.width) { // Draw a blur over the end of the text val edgeWidthPx = TileLabelBlurWidth.toPx() drawRect( Loading @@ -303,10 +318,15 @@ private fun TileLabel( blendMode = BlendMode.DstIn, ) } .basicMarquee( } .thenIf(isVisible()) { // Only apply the marquee when the label is visible, which is needed for the // always composed QS Modifier.basicMarquee( iterations = TILE_MARQUEE_ITERATIONS, initialDelayMillis = TILE_INITIAL_DELAY_MILLIS, ), ) }, ) } Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/InfiniteGridLayout.kt +1 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ constructor( isLastInRow = isLastInColumn, ), detailsViewModel = detailsViewModel, isVisible = listening, ) } } Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/Tile.kt +2 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,7 @@ fun Tile( bounceableInfo: BounceableInfo, tileHapticsViewModelFactoryProvider: TileHapticsViewModelFactoryProvider, modifier: Modifier = Modifier, isVisible: () -> Boolean = { true }, detailsViewModel: DetailsViewModel?, ) { trace(tile.traceName) { Loading Loading @@ -249,6 +250,7 @@ fun Tile( onLongClick = longClick, accessibilityUiState = uiState.accessibilityUiState, squishiness = squishiness, isVisible = isVisible, ) } } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/QuickQuickSettings.kt +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ fun ContentScope.QuickQuickSettings( viewModel.tileHapticsViewModelFactoryProvider, // There should be no QuickQuickSettings when the details view is enabled. detailsViewModel = null, isVisible = listening, ) } } Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/CommonTile.kt +38 −18 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.key import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue Loading Loading @@ -102,6 +103,7 @@ fun LargeTileContent( sideDrawable: Drawable?, colors: TileColors, squishiness: () -> Float, isVisible: () -> Boolean = { true }, accessibilityUiState: AccessibilityUiState? = null, iconShape: RoundedCornerShape = RoundedCornerShape(CommonTileDefaults.InactiveCornerRadius), toggleClick: (() -> Unit)? = null, Loading Loading @@ -158,6 +160,7 @@ fun LargeTileContent( secondaryLabel = secondaryLabel, colors = colors, accessibilityUiState = accessibilityUiState, isVisible = isVisible, ) if (sideDrawable != null) { Loading @@ -176,6 +179,7 @@ fun LargeTileLabels( secondaryLabel: String?, colors: TileColors, modifier: Modifier = Modifier, isVisible: () -> Boolean = { true }, accessibilityUiState: AccessibilityUiState? = null, ) { val animatedLabelColor by animateColorAsState(colors.label, label = "QSTileLabelColor") Loading @@ -186,12 +190,14 @@ fun LargeTileLabels( text = label, style = MaterialTheme.typography.labelLarge, color = { animatedLabelColor }, isVisible = isVisible, ) if (!TextUtils.isEmpty(secondaryLabel)) { TileLabel( secondaryLabel ?: "", color = { animatedSecondaryLabelColor }, style = MaterialTheme.typography.bodyMedium, isVisible = isVisible, modifier = Modifier.thenIf( accessibilityUiState?.stateDescription?.contains(secondaryLabel ?: "") == Loading Loading @@ -277,18 +283,27 @@ private fun TileLabel( color: ColorProducer, style: TextStyle, modifier: Modifier = Modifier, isVisible: () -> Boolean = { true }, ) { var textSize by remember { mutableIntStateOf(0) } BasicText( text = text, color = color, style = style, maxLines = 1, onTextLayout = { textSize = it.size.width }, modifier = modifier .fillMaxWidth() .graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen } .graphicsLayer { if (textSize > size.width) { compositingStrategy = CompositingStrategy.Offscreen } } .drawWithContent { drawContent() if (textSize > size.width) { // Draw a blur over the end of the text val edgeWidthPx = TileLabelBlurWidth.toPx() drawRect( Loading @@ -303,10 +318,15 @@ private fun TileLabel( blendMode = BlendMode.DstIn, ) } .basicMarquee( } .thenIf(isVisible()) { // Only apply the marquee when the label is visible, which is needed for the // always composed QS Modifier.basicMarquee( iterations = TILE_MARQUEE_ITERATIONS, initialDelayMillis = TILE_INITIAL_DELAY_MILLIS, ), ) }, ) } Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/InfiniteGridLayout.kt +1 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ constructor( isLastInRow = isLastInColumn, ), detailsViewModel = detailsViewModel, isVisible = listening, ) } } Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/Tile.kt +2 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,7 @@ fun Tile( bounceableInfo: BounceableInfo, tileHapticsViewModelFactoryProvider: TileHapticsViewModelFactoryProvider, modifier: Modifier = Modifier, isVisible: () -> Boolean = { true }, detailsViewModel: DetailsViewModel?, ) { trace(tile.traceName) { Loading Loading @@ -249,6 +250,7 @@ fun Tile( onLongClick = longClick, accessibilityUiState = uiState.accessibilityUiState, squishiness = squishiness, isVisible = isVisible, ) } } Loading