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

Commit 4496b6f9 authored by Olivier St-Onge's avatar Olivier St-Onge
Browse files

Enable dual target UI for all large tiles

This includes edit mode

Test: manually
Test: verified with tile request service
Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Fixes: 383092998
Change-Id: I6f836b45f452926fd64f9c57d029967e1cbca6fb
parent 4991b7f2
Loading
Loading
Loading
Loading
+24 −23
Original line number Diff line number Diff line
@@ -105,11 +105,12 @@ fun LargeTileContent(
        val focusBorderColor = MaterialTheme.colorScheme.secondary
        Box(
            modifier =
                Modifier.size(CommonTileDefaults.ToggleTargetSize).thenIf(toggleClick != null) {
                    Modifier.borderOnFocus(color = focusBorderColor, iconShape.topEnd)
                Modifier.size(CommonTileDefaults.ToggleTargetSize)
                    .clip(iconShape)
                    .verticalSquish(squishiness)
                    .drawBehind { drawRect(animatedBackgroundColor) }
                    .thenIf(toggleClick != null) {
                        Modifier.borderOnFocus(color = focusBorderColor, iconShape.topEnd)
                            .combinedClickable(
                                onClick = toggleClick!!,
                                onLongClick = onLongClick,
+4 −4
Original line number Diff line number Diff line
@@ -356,10 +356,10 @@ private object TileDefaults {
    val ActiveIconCornerRadius = 16.dp
    val ActiveTileCornerRadius = 24.dp

    /** An active tile without dual target uses the active color as background */
    /** An active icon tile uses the active color as background */
    @Composable
    @ReadOnlyComposable
    fun activeTileColors(): TileColors =
    fun activeIconTileColors(): TileColors =
        TileColors(
            background = MaterialTheme.colorScheme.primary,
            iconBackground = MaterialTheme.colorScheme.primary,
@@ -418,10 +418,10 @@ private object TileDefaults {
    fun getColorForState(uiState: TileUiState, iconOnly: Boolean): TileColors {
        return when (uiState.state) {
            STATE_ACTIVE -> {
                if (uiState.handlesSecondaryClick && !iconOnly) {
                if (!iconOnly) {
                    activeDualTargetTileColors()
                } else {
                    activeTileColors()
                    activeIconTileColors()
                }
            }