use normal_text_size

This commit is contained in:
FunkyMuse 2023-07-10 16:40:47 +02:00
parent 10eff3707a
commit d90a86c319
2 changed files with 17 additions and 6 deletions

View file

@ -4,10 +4,7 @@ import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.*
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
@ -16,12 +13,15 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.unit.dp
import com.simplemobiletools.calculator.compose.extensions.MyDevices
import com.simplemobiletools.calculator.compose.extensions.NoRippleTheme
import com.simplemobiletools.calculator.compose.theme.AppThemeSurface
import com.simplemobiletools.calculator.compose.theme.preferenceSummaryColor
import com.simplemobiletools.calculator.compose.theme.preferenceTitleColor
import com.simplemobiletools.commons.R
@Composable
fun SettingsCheckBoxComponent(
@ -41,10 +41,10 @@ fun SettingsCheckBoxComponent(
modifier = modifier
.fillMaxWidth()
.clickable(onClick = { onChange?.invoke(!initialValue) }, interactionSource = interactionSource, indication = indication)
.padding(16.dp),
.padding(horizontal = 16.dp, vertical = 8.dp),
) {
Column(
modifier = Modifier.weight(1f),
modifier = Modifier.weight(1f)
) {
Text(
modifier = Modifier
@ -52,6 +52,9 @@ fun SettingsCheckBoxComponent(
.padding(end = 16.dp),
text = title,
color = preferenceTitleColor(isEnabled = isPreferenceEnabled),
fontSize = with(LocalDensity.current) {
dimensionResource(id = R.dimen.normal_text_size).toSp()
}
)
AnimatedVisibility(visible = !summary.isNullOrBlank()) {
Text(

View file

@ -9,6 +9,8 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@ -42,6 +44,9 @@ fun SettingsPreferenceComponent(
text = preferenceTitle,
modifier = Modifier.fillMaxWidth(),
color = preferenceTitleColor(isEnabled = isPreferenceEnabled),
fontSize = with(LocalDensity.current) {
dimensionResource(id = R.dimen.normal_text_size).toSp()
}
)
AnimatedVisibility(visible = !preferenceSummary.isNullOrBlank()) {
Text(
@ -49,6 +54,9 @@ fun SettingsPreferenceComponent(
modifier = Modifier
.fillMaxWidth(),
color = preferenceSummaryColor.copy(alpha = 0.6f),
fontSize = with(LocalDensity.current) {
dimensionResource(id = R.dimen.normal_text_size).toSp()
}
)
}
}