mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-16 11:31:01 +01:00
refactor: apply mr feedback
This commit is contained in:
parent
d280f40c87
commit
0000ecc50c
@ -46,7 +46,11 @@ fun SettingsCheckBoxComponent(
|
|||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clickable(onClick = { onChange?.invoke(!initialValue) }, interactionSource = interactionSource, indication = indication)
|
.clickable(
|
||||||
|
onClick = { onChange?.invoke(!initialValue) },
|
||||||
|
interactionSource = interactionSource,
|
||||||
|
indication = indication
|
||||||
|
)
|
||||||
.padding(horizontal = 16.dp, vertical = 6.dp),
|
.padding(horizontal = 16.dp, vertical = 6.dp),
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
@ -77,7 +81,10 @@ fun SettingsCheckBoxComponent(
|
|||||||
checked = initialValue,
|
checked = initialValue,
|
||||||
onCheckedChange = { onChange?.invoke(it) },
|
onCheckedChange = { onChange?.invoke(it) },
|
||||||
enabled = isPreferenceEnabled,
|
enabled = isPreferenceEnabled,
|
||||||
colors = CheckboxDefaults.colors(checkedColor = checkboxColor, checkmarkColor = MaterialTheme.colorScheme.surface),
|
colors = CheckboxDefaults.colors(
|
||||||
|
checkedColor = checkboxColor,
|
||||||
|
checkmarkColor = MaterialTheme.colorScheme.surface
|
||||||
|
),
|
||||||
interactionSource = interactionSource
|
interactionSource = interactionSource
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
|||||||
import com.simplemobiletools.calculator.compose.theme.model.Theme
|
import com.simplemobiletools.calculator.compose.theme.model.Theme
|
||||||
import com.simplemobiletools.calculator.compose.theme.model.Theme.Companion.systemDefaultMaterialYou
|
import com.simplemobiletools.calculator.compose.theme.model.Theme.Companion.systemDefaultMaterialYou
|
||||||
import com.simplemobiletools.calculator.extensions.config
|
import com.simplemobiletools.calculator.extensions.config
|
||||||
|
import com.simplemobiletools.commons.helpers.isSPlus
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun Theme(
|
internal fun Theme(
|
||||||
@ -30,7 +31,7 @@ internal fun Theme(
|
|||||||
val colorScheme = if (!view.isInEditMode) {
|
val colorScheme = if (!view.isInEditMode) {
|
||||||
|
|
||||||
val colorScheme = when {
|
val colorScheme = when {
|
||||||
theme is Theme.SystemDefaultMaterialYou && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
theme is Theme.SystemDefaultMaterialYou && isSPlus() -> {
|
||||||
if (isSystemInDarkTheme()) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
if (isSystemInDarkTheme()) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +59,9 @@ internal fun Theme(
|
|||||||
|
|
||||||
colorScheme
|
colorScheme
|
||||||
|
|
||||||
} else darkColorScheme
|
} else {
|
||||||
|
darkColorScheme
|
||||||
|
}
|
||||||
|
|
||||||
SideEffect {
|
SideEffect {
|
||||||
systemUiController.setNavigationBarColor(colorScheme.surface, navigationBarContrastEnforced = false)
|
systemUiController.setNavigationBarColor(colorScheme.surface, navigationBarContrastEnforced = false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user