@@ -28,10 +28,13 @@ import androidx.compose.runtime.saveable.rememberSaveable
2828import androidx.compose.runtime.setValue
2929import androidx.compose.ui.Alignment
3030import androidx.compose.ui.Modifier
31+ import androidx.compose.ui.res.stringArrayResource
32+ import androidx.compose.ui.res.stringResource
3133import androidx.compose.ui.semantics.semantics
3234import androidx.compose.ui.semantics.stateDescription
3335import androidx.compose.ui.tooling.preview.Preview
3436import androidx.compose.ui.unit.dp
37+ import dev.fabik.bluetoothhid.R
3538import dev.fabik.bluetoothhid.utils.PreferenceStore
3639import dev.fabik.bluetoothhid.utils.rememberPreference
3740import dev.fabik.bluetoothhid.utils.rememberPreferenceNull
@@ -45,8 +48,8 @@ fun VolumeKeyOptionsModal() {
4548 var showSheet by rememberSaveable { mutableStateOf(false ) }
4649
4750 ButtonPreference (
48- title = " Use volume keys " ,
49- desc = " Specify action when pressing volume up/down " ,
51+ title = stringResource( R .string.send_with_volume_keys) ,
52+ desc = stringResource( R .string.send_vol_keys_desc) ,
5053 icon = Icons .AutoMirrored .Filled .VolumeMute ,
5154 onClick = { showSheet = true },
5255 extra = {
@@ -90,36 +93,33 @@ fun VolumeKeysOptionsContent() {
9093 .padding(horizontal = 16 .dp)
9194 ) {
9295 Text (
93- " Volume keys " ,
96+ stringResource( R .string.send_with_volume_keys) ,
9497 style = MaterialTheme .typography.titleLarge,
9598 )
9699
97- val actions = arrayOf(
98- " Nothing" ,
99- " Send value" ,
100- " Clear value" ,
101- " Run OCR" ,
102- " Open manual input" ,
103- " Toggle flash" ,
104- " Toggle zoom" ,
105- " Trigger focus"
106- )
100+ val actions = stringArrayResource(R .array.volume_keys_actions)
107101
108102 AdvancedEnumSelectionOption (
109- " Volume up " ,
103+ stringResource( R .string.volume_up) ,
110104 actions,
111105 PreferenceStore .VOLUME_ACTION_UP
112106 )
113107
114108 AdvancedEnumSelectionOption (
115- " Volume down " ,
116- actions,
117- PreferenceStore .VOLUME_ACTION_DOWN
109+ text = stringResource( R .string.volume_down) ,
110+ values = actions,
111+ preference = PreferenceStore .VOLUME_ACTION_DOWN
118112 )
119113
120- AdvancedSliderOption (" Zoom level (%)" , 0f to 100f , PreferenceStore .VOLUME_ZOOM_LEVEL )
121-
122- // AdvancedToggleOption("Trigger on key release")
114+ AdvancedSliderOption (
115+ stringResource(R .string.zoom_level),
116+ 0f to 100f ,
117+ PreferenceStore .VOLUME_ZOOM_LEVEL
118+ )
119+ AdvancedToggleOption (
120+ stringResource(R .string.trigger_on_key_release),
121+ PreferenceStore .VOLUME_ON_RELEASE
122+ )
123123
124124 Spacer (Modifier .height(12 .dp))
125125 }
0 commit comments