diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/prefs/BasicPrefs.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/prefs/BasicPrefs.kt index 5458385b..e675f8d4 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/prefs/BasicPrefs.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/prefs/BasicPrefs.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.machiav3lli.fdroid.content.BooleanPrefsMeta +import com.machiav3lli.fdroid.content.NonBooleanPrefsMeta import com.machiav3lli.fdroid.content.Preferences import com.machiav3lli.fdroid.ui.compose.utils.addIf @@ -146,4 +147,24 @@ fun SwitchPreference( ) } ) -} \ No newline at end of file +} + +@Composable +fun StringPreference( + modifier: Modifier = Modifier, + prefKey: Preferences.Key, + index: Int = 1, + groupSize: Int = 1, + isEnabled: Boolean = true, + onClick: (() -> Unit) = {}, +) { + BasePreference( + modifier = modifier, + titleId = NonBooleanPrefsMeta[prefKey] ?: -1, + summary = Preferences[prefKey], + index = index, + groupSize = groupSize, + isEnabled = isEnabled, + onClick = onClick + ) +}