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

Commit 8da15e4d authored by Wes Okuhara's avatar Wes Okuhara
Browse files

Screen Capture: Update RadioButtonGroup button colors

The screen capture component UX spec was recently updated to align
closer to M3 guidelines. This updates the button colors to match the
UX spec.

Bug: 412722889, 412722410
Test: Screenshot tests
Flag: com.android.systemui.desktop_screen_capture
Change-Id: Ic1ce48701525e43161c8ecbd503794e075541db8
parent 4918d313
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.size
import androidx.compose.material3.ButtonGroupDefaults
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.ToggleButton
import androidx.compose.material3.ToggleButtonColors
@@ -56,7 +57,7 @@ fun RadioButtonGroup(
    selectedIndex: Int,
    onSelect: (index: Int) -> Unit,
    modifier: Modifier = Modifier,
    colors: ToggleButtonColors = ToggleButtonDefaults.toggleButtonColors(),
    colors: ToggleButtonColors = defaultColors(),
) {
    require(selectedIndex in 0..items.size) { "selectedIndex is out of range of items." }

@@ -89,3 +90,13 @@ fun RadioButtonGroup(
        }
    }
}

@Composable
private fun defaultColors(): ToggleButtonColors {
    return ToggleButtonDefaults.toggleButtonColors(
        containerColor = MaterialTheme.colorScheme.secondaryContainer,
        contentColor = MaterialTheme.colorScheme.onSecondaryContainer,
        checkedContainerColor = MaterialTheme.colorScheme.secondary,
        checkedContentColor = MaterialTheme.colorScheme.onSecondary,
    )
}