clean code

This commit is contained in:
BinTianqi
2024-08-03 13:05:30 +08:00
parent a2f8699a15
commit 7b4fccd54b
12 changed files with 112 additions and 125 deletions

View File

@@ -77,6 +77,16 @@ fun Information(content: @Composable ()->Unit) {
}
}
@Composable
fun RadioButtonItem(
@StringRes text: Int,
selected: Boolean,
operation: () -> Unit,
textColor: Color = colorScheme.onBackground
) {
RadioButtonItem(stringResource(text), selected, operation, textColor)
}
@Composable
fun RadioButtonItem(
text: String,
@@ -96,7 +106,7 @@ fun RadioButtonItem(
@Composable
fun CheckBoxItem(
text: String,
@StringRes text: Int,
checked: Boolean,
operation: (Boolean) -> Unit,
textColor: Color = colorScheme.onBackground
@@ -110,7 +120,7 @@ fun CheckBoxItem(
checked = checked,
onCheckedChange = operation
)
Text(text = text, color = textColor, modifier = Modifier.padding(bottom = if(zhCN) { 2 } else { 0 }.dp))
Text(text = stringResource(text), color = textColor, modifier = Modifier.padding(bottom = if(zhCN) { 2 } else { 0 }.dp))
}
}