mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
feat: add ReadOnlySetting and corresponding UI component for displaying read-only settings
This commit is contained in:
@@ -41,6 +41,7 @@ import hu.bbara.purefin.core.feature.settings.SettingsViewModel
|
||||
import hu.bbara.purefin.core.settings.BooleanSetting
|
||||
import hu.bbara.purefin.core.settings.DropdownSetting
|
||||
import hu.bbara.purefin.core.settings.RangeSetting
|
||||
import hu.bbara.purefin.core.settings.ReadOnlySetting
|
||||
import hu.bbara.purefin.core.settings.SettingOption
|
||||
import hu.bbara.purefin.core.settings.StringSetting
|
||||
import hu.bbara.purefin.core.settings.VoidSetting
|
||||
@@ -149,6 +150,13 @@ private fun TvSettingOptionItem(
|
||||
}
|
||||
}
|
||||
|
||||
is ReadOnlySetting -> {
|
||||
TvReadOnlySettingItem(
|
||||
title = option.title,
|
||||
value = option.value
|
||||
)
|
||||
}
|
||||
|
||||
is VoidSetting -> {
|
||||
TvVoidSettingItem(
|
||||
title = option.title,
|
||||
@@ -200,6 +208,31 @@ private fun TvSettingsTopBar(
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TvReadOnlySettingItem(
|
||||
title: String,
|
||||
value: String,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 28.dp, vertical = 16.dp)
|
||||
) {
|
||||
Text(
|
||||
text = title,
|
||||
style = MaterialTheme.typography.bodyLarge
|
||||
)
|
||||
Text(
|
||||
text = value,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TvVoidSettingItem(
|
||||
title: String,
|
||||
|
||||
Reference in New Issue
Block a user