Change SwitchPreference switch color in unchecked state

This commit is contained in:
MM20 2021-09-26 23:38:05 +02:00
parent 2f691863c1
commit e3a2fd5e02
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -1,6 +1,8 @@
package de.mm20.launcher2.ui.component.preferences
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Switch
import androidx.compose.material.SwitchDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.vector.ImageVector
@ -22,7 +24,9 @@ fun SwitchPreference(
onValueChanged(!value)
},
controls = {
Switch(checked = value, onCheckedChange = onValueChanged)
Switch(checked = value, onCheckedChange = onValueChanged, colors = SwitchDefaults.colors(
uncheckedThumbColor = MaterialTheme.colors.onSurface
))
}
)
}