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

Commit 045b99e0 authored by Anton Potapov's avatar Anton Potapov Committed by Android (Google) Code Review
Browse files

Merge "Make ToggleButtonComponent Switch for a11y semantics" into main

parents 09e86fb0 e231c7b5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -32,8 +32,10 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
@@ -62,7 +64,10 @@ class ToggleButtonComponent(
        ) {
            OutlinedIconToggleButton(
                modifier =
                    Modifier.height(64.dp).fillMaxWidth().semantics { contentDescription = label },
                    Modifier.height(64.dp).fillMaxWidth().semantics {
                        role = Role.Switch
                        contentDescription = label
                    },
                checked = viewModel.isChecked,
                onCheckedChange = onCheckedChange,
                shape = RoundedCornerShape(28.dp),