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

Commit de61cab0 authored by Anton Potapov's avatar Anton Potapov
Browse files

Add toggleableState to ToggleButtonComponent

Flag: aconfig new_volume_panel NEXTFOOD
Test: manual on the tablet with voice over turned on
Fixes: 331728705
Change-Id: I7369845c401415c2cd7a5f4870eb2644f63f3cf5
parent e604171b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ 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.semantics.toggleableState
import androidx.compose.ui.state.ToggleableState
import androidx.compose.ui.unit.dp
import com.android.systemui.common.ui.compose.Icon
import com.android.systemui.volume.panel.component.button.ui.viewmodel.ButtonViewModel
@@ -79,6 +81,12 @@ class ToggleButtonComponent(
                    modifier =
                        Modifier.fillMaxSize().padding(8.dp).semantics {
                            role = Role.Switch
                            toggleableState =
                                if (viewModel.isActive) {
                                    ToggleableState.On
                                } else {
                                    ToggleableState.Off
                                }
                            contentDescription = label
                        },
                    onClick = { onCheckedChange(!viewModel.isActive) },