Small UI fixes

This commit is contained in:
Nullptr 2022-11-09 14:10:02 +08:00
parent c191397dc0
commit 319a21f103
No known key found for this signature in database
2 changed files with 12 additions and 7 deletions

View File

@ -251,24 +251,30 @@ private fun KeepAlive() {
onDismissRequest = { expanded = false }, onDismissRequest = { expanded = false },
onClick = { expanded = true }, onClick = { expanded = true },
surface = { surface = {
val (title, desc) = when (Configs.keepAlive) { val desc = when (Configs.keepAlive) {
Configs.KeepAlive.OFF -> R.string.settings_keep_alive to R.string.off Configs.KeepAlive.OFF -> R.string.off
Configs.KeepAlive.FOREGROUND -> R.string.settings_keep_alive_foreground to R.string.settings_keep_alive_foreground_desc Configs.KeepAlive.FOREGROUND -> R.string.settings_keep_alive_foreground
} }
SettingsItem( SettingsItem(
icon = Icons.Outlined.HourglassEmpty, icon = Icons.Outlined.HourglassEmpty,
title = stringResource(title), title = stringResource(R.string.settings_keep_alive),
desc = stringResource(desc) desc = stringResource(desc)
) )
} }
) { ) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.off)) }, text = { Text(stringResource(R.string.off)) },
onClick = { Configs.keepAlive = Configs.KeepAlive.OFF } onClick = {
Configs.keepAlive = Configs.KeepAlive.OFF
expanded = false
}
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.settings_keep_alive_foreground)) }, text = { Text(stringResource(R.string.settings_keep_alive_foreground)) },
onClick = { Configs.keepAlive = Configs.KeepAlive.FOREGROUND } onClick = {
Configs.keepAlive = Configs.KeepAlive.FOREGROUND
expanded = false
}
) )
} }
} }

View File

@ -90,5 +90,4 @@
<string name="settings_detail_patch_logs">Detail patch logs</string> <string name="settings_detail_patch_logs">Detail patch logs</string>
<string name="settings_keep_alive">Keep alive</string> <string name="settings_keep_alive">Keep alive</string>
<string name="settings_keep_alive_foreground">Foreground</string> <string name="settings_keep_alive_foreground">Foreground</string>
<string name="settings_keep_alive_foreground_desc">Create a notification to keep manager alive</string>
</resources> </resources>