mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 19:17:21 +00:00
Added various tweaks to translations, sorted strings.xml
This commit is contained in:
1 parent
9e765a3575
commit
1290b8f32f
15 files changed
+609
-677
No files matched your search
@@ -23,11 +23,11 @@ import com.rtbishop.look4sat.presentation.satellites.satellitesDestination
|
||||
import com.rtbishop.look4sat.presentation.settings.settingsDestination
|
||||
|
||||
sealed class Screen(val route: String, val iconResId: Int, val titleResId: Int) {
|
||||
data object Satellites : Screen("satellites", R.drawable.ic_satellites, R.string.nav_satellites)
|
||||
data object Passes : Screen("passes", R.drawable.ic_passes, R.string.nav_passes)
|
||||
data object Satellites : Screen("satellites", R.drawable.ic_satellites, R.string.nav_sat)
|
||||
data object Passes : Screen("passes", R.drawable.ic_passes, R.string.nav_pass)
|
||||
data object Radar : Screen("radar", R.drawable.ic_radar, R.string.nav_radar)
|
||||
data object Map : Screen("map", R.drawable.ic_map, R.string.nav_map)
|
||||
data object Settings : Screen("settings", R.drawable.ic_settings, R.string.nav_settings)
|
||||
data object Settings : Screen("settings", R.drawable.ic_settings, R.string.nav_prefs)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -108,7 +108,7 @@ fun RowScope.NextPassRow(pass: OrbitalPass, modifier: Modifier = Modifier) {
|
||||
// .background(color = MaterialTheme.colorScheme.background)
|
||||
.padding(start = 6.dp, top = 1.dp, end = 6.dp, bottom = 0.dp)
|
||||
) {
|
||||
val passSatId = stringResource(id = R.string.passes_satId, pass.catNum)
|
||||
val passSatId = stringResource(id = R.string.pass_satId, pass.catNum)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = "$passSatId - ",
|
||||
@@ -175,7 +175,7 @@ fun RowScope.NextPassRow(pass: OrbitalPass, modifier: Modifier = Modifier) {
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(
|
||||
id = R.string.passes_aosLos,
|
||||
id = R.string.pass_aosLos,
|
||||
pass.aosAzimuth.toInt(),
|
||||
pass.losAzimuth.toInt()
|
||||
),
|
||||
|
||||
@@ -74,16 +74,16 @@ fun PassesDialog(hours: Int, elevation: Double, cancel: () -> Unit, accept: (Int
|
||||
val onAccept = {
|
||||
accept(hoursValue.intValue, elevationValueNew.doubleValue).also { cancel() }
|
||||
}
|
||||
SharedDialog(title = stringResource(R.string.passes_filter_passes), onCancel = cancel, onAccept = onAccept) {
|
||||
SharedDialog(title = stringResource(R.string.pass_filter_title), onCancel = cancel, onAccept = onAccept) {
|
||||
SliderRow(
|
||||
title = stringResource(R.string.passes_filter_above),
|
||||
title = stringResource(R.string.pass_filter_elev),
|
||||
value = elevationValueNew.doubleValue,
|
||||
valuePostfix = "°",
|
||||
valueResId = R.drawable.ic_elevation,
|
||||
valueRange = 0f..60f
|
||||
) { elevationValueNew.doubleValue = it.toDouble() }
|
||||
SliderRow(
|
||||
title = stringResource(R.string.passes_filter_within),
|
||||
title = stringResource(R.string.pass_filter_hours),
|
||||
value = hoursValue.intValue.toDouble(),
|
||||
valuePostfix = "h",
|
||||
valueResId = R.drawable.ic_clock,
|
||||
@@ -146,7 +146,7 @@ fun RadiosDialog(modes: List<String>, cancel: () -> Unit, accept: (List<String>)
|
||||
if (selected.contains(mode)) selected.remove(mode) else selected.add(mode)
|
||||
}
|
||||
val onAccept = { accept(selected.toList()).also { cancel() } }
|
||||
SharedDialog(title = stringResource(R.string.passes_filter_modes), onCancel = cancel, onAccept = onAccept) {
|
||||
SharedDialog(title = stringResource(R.string.pass_modes_title), onCancel = cancel, onAccept = onAccept) {
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Adaptive(240.dp),
|
||||
modifier = Modifier
|
||||
|
||||
@@ -95,8 +95,8 @@ private fun PassesScreen(uiState: PassesState, navigateToRadar: (Int, Long) -> U
|
||||
}
|
||||
if (uiState.shouldSeeWelcome) {
|
||||
InfoDialog(
|
||||
title = stringResource(R.string.passes_welcome_title),
|
||||
text = stringResource(R.string.passes_welcome_message)
|
||||
title = stringResource(R.string.pass_welcome_title),
|
||||
text = stringResource(R.string.pass_welcome_message)
|
||||
) {
|
||||
uiState.takeAction(PassesAction.DismissWelcome)
|
||||
}
|
||||
@@ -158,7 +158,7 @@ private fun PassesList(
|
||||
}
|
||||
) {
|
||||
if (passes.isEmpty()) {
|
||||
EmptyListCard(message = stringResource(R.string.passes_empty_list_message))
|
||||
EmptyListCard(message = stringResource(R.string.pass_empty_list_message))
|
||||
} else {
|
||||
LazyVerticalGrid(
|
||||
state = gridState,
|
||||
@@ -204,7 +204,7 @@ private fun NearEarthPass(
|
||||
modifier: Modifier = Modifier,
|
||||
isVerticalLayout: Boolean = true
|
||||
) {
|
||||
val passSatId = stringResource(id = R.string.passes_satId, pass.catNum)
|
||||
val passSatId = stringResource(id = R.string.pass_satId, pass.catNum)
|
||||
val horizontalPadding = if (isVerticalLayout) 6.dp else 10.dp
|
||||
Surface(color = MaterialTheme.colorScheme.background, modifier = modifier) {
|
||||
Surface(modifier = Modifier
|
||||
@@ -254,7 +254,7 @@ private fun NearEarthPass(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
if (pass.isDeepSpace) {
|
||||
Text(text = stringResource(R.string.passes_deep_space), fontSize = 15.sp)
|
||||
Text(text = stringResource(R.string.pass_deep_space), fontSize = 15.sp)
|
||||
} else {
|
||||
Text(
|
||||
text = sdfDate.format(Date(pass.aosTime)),
|
||||
@@ -285,7 +285,7 @@ private fun NearEarthPass(
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(
|
||||
id = R.string.passes_aosLos,
|
||||
id = R.string.pass_aosLos,
|
||||
pass.aosAzimuth.toInt(),
|
||||
pass.losAzimuth.toInt()
|
||||
),
|
||||
|
||||
@@ -42,7 +42,7 @@ fun MultiTypesDialog(
|
||||
if (selected.contains(type)) selected.remove(type) else selected.add(type)
|
||||
}
|
||||
val onAccept = { accept(selected.toList()) }
|
||||
SharedDialog(title = stringResource(R.string.satellites_select_type), onCancel = cancel, onAccept = onAccept) {
|
||||
SharedDialog(title = stringResource(R.string.sat_type_title), onCancel = cancel, onAccept = onAccept) {
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Adaptive(240.dp),
|
||||
modifier = Modifier
|
||||
|
||||
+22
-13
@@ -28,6 +28,8 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
@@ -72,8 +74,8 @@ private fun SatellitesScreen(uiState: SatellitesState, navigateUp: () -> Unit) {
|
||||
}
|
||||
if (uiState.shouldSeeWarning) {
|
||||
InfoDialog(
|
||||
stringResource(R.string.satellites_warning_title),
|
||||
stringResource(R.string.satellites_warning_message)
|
||||
stringResource(R.string.sat_warning_title),
|
||||
stringResource(R.string.sat_warning_message)
|
||||
) {
|
||||
uiState.takeAction(SatellitesAction.DismissWarning)
|
||||
}
|
||||
@@ -82,28 +84,34 @@ private fun SatellitesScreen(uiState: SatellitesState, navigateUp: () -> Unit) {
|
||||
val selectAll = { uiState.takeAction(SatellitesAction.SelectAll) }
|
||||
val setQuery = { newQuery: String -> uiState.takeAction(SatellitesAction.SearchFor(newQuery)) }
|
||||
val saveSelection = { uiState.takeAction(SatellitesAction.SaveSelection).also { navigateUp() } }
|
||||
val primCardCd = stringResource(R.string.btn_accept)
|
||||
val primCardMod = Modifier.semantics { contentDescription = primCardCd }
|
||||
val clearAllCd = stringResource(R.string.sat_clear_all)
|
||||
val clearAllMod = Modifier.semantics { contentDescription = clearAllCd }
|
||||
val selectAllCd = stringResource(R.string.sat_select_all)
|
||||
val selectAllMod = Modifier.semantics { contentDescription = selectAllCd }
|
||||
Column(modifier = Modifier.layoutPadding(), verticalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||
if (isVerticalLayout()) {
|
||||
TopBar {
|
||||
TypeCard(types = uiState.currentTypes, toggleDialog, modifier = Modifier.weight(1f))
|
||||
PrimaryIconCard(onClick = saveSelection, resId = R.drawable.ic_done)
|
||||
PrimaryIconCard(onClick = saveSelection, resId = R.drawable.ic_done, modifier = primCardMod)
|
||||
}
|
||||
TopBar {
|
||||
SearchBar(setQuery = { setQuery(it) }, modifier = Modifier.weight(1f))
|
||||
IconCard(action = unselectAll, resId = R.drawable.ic_check_off)
|
||||
IconCard(action = selectAll, resId = R.drawable.ic_check_on)
|
||||
IconCard(action = unselectAll, resId = R.drawable.ic_check_off, modifier = clearAllMod)
|
||||
IconCard(action = selectAll, resId = R.drawable.ic_check_on, modifier = selectAllMod)
|
||||
}
|
||||
} else {
|
||||
TopBar {
|
||||
PrimaryIconCard(onClick = saveSelection, resId = R.drawable.ic_done)
|
||||
PrimaryIconCard(onClick = saveSelection, resId = R.drawable.ic_done, modifier = primCardMod)
|
||||
TypeCard(types = uiState.currentTypes, toggleDialog, modifier = Modifier.weight(1f))
|
||||
SearchBar(setQuery = { setQuery(it) }, modifier = Modifier.weight(1f))
|
||||
IconCard(action = unselectAll, resId = R.drawable.ic_check_off)
|
||||
IconCard(action = selectAll, resId = R.drawable.ic_check_on)
|
||||
IconCard(action = unselectAll, resId = R.drawable.ic_check_off, modifier = clearAllMod)
|
||||
IconCard(action = selectAll, resId = R.drawable.ic_check_on, modifier = selectAllMod)
|
||||
}
|
||||
}
|
||||
ElevatedCard(modifier = Modifier.fillMaxSize()) {
|
||||
val emptyMessage = stringResource(R.string.satellites_empty_list_message)
|
||||
val emptyMessage = stringResource(R.string.sat_empty_list_message)
|
||||
when {
|
||||
uiState.isLoading -> CardLoadingIndicator()
|
||||
uiState.itemsList.isEmpty() -> EmptyListCard(message = emptyMessage)
|
||||
@@ -143,7 +151,7 @@ private fun SearchBar(setQuery: (String) -> Unit, modifier: Modifier = Modifier)
|
||||
decorationBox = { innerTextField ->
|
||||
if (currentQuery.value.isEmpty()) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.satellites_search_hint),
|
||||
text = stringResource(id = R.string.sat_search_hint),
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 20.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
@@ -155,7 +163,8 @@ private fun SearchBar(setQuery: (String) -> Unit, modifier: Modifier = Modifier)
|
||||
cursorBrush = SolidColor(MaterialTheme.colorScheme.onSurface)
|
||||
)
|
||||
IconButton(onClick = { setNewQuery("") }) {
|
||||
Icon(painter = painterResource(id = R.drawable.ic_close), contentDescription = null)
|
||||
val clearCd = stringResource(R.string.sat_search_clear)
|
||||
Icon(painter = painterResource(id = R.drawable.ic_close), contentDescription = clearCd)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,7 +187,7 @@ private fun TypeCard(types: List<String>, onClick: () -> Unit, modifier: Modifie
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Text(
|
||||
text = stringResource(R.string.satellites_type, typesText),
|
||||
text = stringResource(R.string.sat_type_hint, typesText),
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier
|
||||
@@ -199,7 +208,7 @@ private fun SatellitePreview() {
|
||||
|
||||
@Composable
|
||||
private fun Satellite(item: SatItem, onSelected: (Int, Boolean) -> Unit, modifier: Modifier) {
|
||||
val passSatId = stringResource(id = R.string.passes_satId, item.catnum)
|
||||
val passSatId = stringResource(id = R.string.pass_satId, item.catnum)
|
||||
Surface(
|
||||
color = MaterialTheme.colorScheme.background,
|
||||
modifier = modifier.clickable { onSelected(item.catnum, item.isSelected) }) {
|
||||
|
||||
@@ -21,12 +21,12 @@ private fun PositionDialogPreview() {
|
||||
fun PositionDialog(lat: Double, lon: Double, dismiss: () -> Unit, save: (Double, Double) -> Unit) {
|
||||
val latValue = rememberSaveable { mutableStateOf(lat.toString()) }
|
||||
val lonValue = rememberSaveable { mutableStateOf(lon.toString()) }
|
||||
val titleText = stringResource(id = R.string.settings_position_title)
|
||||
val titleText = stringResource(id = R.string.prefs_station_title)
|
||||
val onAccept = { saveValues(latValue.value, lonValue.value, save).also { dismiss() } }
|
||||
SharedDialog(title = titleText, onCancel = dismiss, onAccept = onAccept) {
|
||||
Text(text = stringResource(id = R.string.settings_position_lat_text))
|
||||
Text(text = stringResource(id = R.string.prefs_station_lat_text))
|
||||
OutlinedTextField(value = latValue.value, onValueChange = { latValue.value = it })
|
||||
Text(text = stringResource(id = R.string.settings_position_lon_text))
|
||||
Text(text = stringResource(id = R.string.prefs_station_lon_text))
|
||||
OutlinedTextField(value = lonValue.value, onValueChange = { lonValue.value = it })
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,8 @@ private fun LocatorDialogPreview() {
|
||||
fun LocatorDialog(qthLocator: String, dismiss: () -> Unit, save: (String) -> Unit) {
|
||||
val locator = rememberSaveable { mutableStateOf(qthLocator) }
|
||||
val onAccept = { save(locator.value).also { dismiss() } }
|
||||
SharedDialog(title = stringResource(R.string.settings_locator_title), onCancel = dismiss, onAccept = onAccept) {
|
||||
Text(text = stringResource(id = R.string.settings_locator_text))
|
||||
SharedDialog(title = stringResource(R.string.prefs_locator_title), onCancel = dismiss, onAccept = onAccept) {
|
||||
Text(text = stringResource(id = R.string.prefs_locator_text))
|
||||
OutlinedTextField(value = locator.value, onValueChange = { locator.value = it })
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ fun NavGraphBuilder.settingsDestination() {
|
||||
private fun SettingsScreen(uiState: SettingsState) {
|
||||
// Permissions setup
|
||||
val bluetoothContract = ActivityResultContracts.RequestPermission()
|
||||
val bluetoothError = stringResource(R.string.settings_BTremote_perm_error)
|
||||
val bluetoothError = stringResource(R.string.prefs_BTremote_perm_error)
|
||||
val bluetoothPerm = when {
|
||||
Build.VERSION.SDK_INT < Build.VERSION_CODES.S -> Manifest.permission.BLUETOOTH
|
||||
else -> Manifest.permission.BLUETOOTH_CONNECT
|
||||
@@ -84,7 +84,7 @@ private fun SettingsScreen(uiState: SettingsState) {
|
||||
}
|
||||
}
|
||||
val locationContract = ActivityResultContracts.RequestMultiplePermissions()
|
||||
val locationError = stringResource(R.string.settings_location_gps_error)
|
||||
val locationError = stringResource(R.string.prefs_loc_gps_error)
|
||||
val locationPermCoarse = Manifest.permission.ACCESS_COARSE_LOCATION
|
||||
val locationPermFine = Manifest.permission.ACCESS_FINE_LOCATION
|
||||
val locationRequest = rememberLauncherForActivityResult(locationContract) { permissions ->
|
||||
@@ -233,7 +233,7 @@ private fun LocationCard(
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings_location_title),
|
||||
text = stringResource(id = R.string.prefs_loc_title),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
UpdateIndicator(isUpdating = settings.isUpdating, Modifier.weight(1f))
|
||||
@@ -262,19 +262,19 @@ private fun LocationCard(
|
||||
Row(horizontalArrangement = Arrangement.SpaceEvenly) {
|
||||
CardButton(
|
||||
onClick = setGpsPos,
|
||||
text = stringResource(id = R.string.settings_station_gps),
|
||||
text = stringResource(id = R.string.prefs_loc_gps_title),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = showPosDialog,
|
||||
text = stringResource(id = R.string.settings_station_manual),
|
||||
text = stringResource(id = R.string.prefs_loc_manual_title),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = showLocDialog,
|
||||
text = stringResource(id = R.string.settings_station_qth),
|
||||
text = stringResource(id = R.string.prefs_loc_qth_title),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
@@ -310,7 +310,7 @@ private fun DataCard(
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings_data_title),
|
||||
text = stringResource(id = R.string.prefs_data_title),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
UpdateIndicator(isUpdating = settings.isUpdating, Modifier.weight(1f))
|
||||
@@ -327,19 +327,19 @@ private fun DataCard(
|
||||
Row(horizontalArrangement = Arrangement.SpaceEvenly) {
|
||||
CardButton(
|
||||
onClick = { updateFromWeb() },
|
||||
text = stringResource(id = R.string.settings_data_online),
|
||||
text = stringResource(id = R.string.prefs_data_online),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = { updateFromFile() },
|
||||
text = stringResource(id = R.string.settings_data_import),
|
||||
text = stringResource(id = R.string.prefs_data_import),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = { clearAllData() },
|
||||
text = stringResource(id = R.string.settings_data_clear),
|
||||
text = stringResource(id = R.string.prefs_data_clear),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
@@ -372,7 +372,7 @@ private fun NetworkOutputCard(
|
||||
ElevatedCard(modifier = Modifier.fillMaxWidth()) {
|
||||
Column(modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings_remote_title),
|
||||
text = stringResource(id = R.string.prefs_remote_title),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Row(
|
||||
@@ -380,7 +380,7 @@ private fun NetworkOutputCard(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(text = stringResource(R.string.settings_remote_switch))
|
||||
Text(text = stringResource(R.string.prefs_remote_switch))
|
||||
Switch(checked = settings.rotatorState, onCheckedChange = { setRotatorState(it) })
|
||||
}
|
||||
Row(
|
||||
@@ -391,7 +391,7 @@ private fun NetworkOutputCard(
|
||||
OutlinedTextField(
|
||||
value = settings.rotatorAddress,
|
||||
singleLine = true,
|
||||
label = { Text(text = stringResource(R.string.settings_remote_ip_hint)) },
|
||||
label = { Text(text = stringResource(R.string.prefs_remote_ip_hint)) },
|
||||
onValueChange = { setRotatorAddress(it) },
|
||||
modifier = Modifier.weight(1.5f),
|
||||
enabled = settings.rotatorState
|
||||
@@ -399,7 +399,7 @@ private fun NetworkOutputCard(
|
||||
OutlinedTextField(
|
||||
value = settings.rotatorPort,
|
||||
onValueChange = { setRotatorPort(it) },
|
||||
label = { Text(text = stringResource(R.string.settings_remote_port_hint)) },
|
||||
label = { Text(text = stringResource(R.string.prefs_remote_port_hint)) },
|
||||
singleLine = true,
|
||||
modifier = Modifier.weight(1f),
|
||||
enabled = settings.rotatorState
|
||||
@@ -435,7 +435,7 @@ private fun BluetoothOutputCard(
|
||||
ElevatedCard(modifier = Modifier.fillMaxWidth()) {
|
||||
Column(modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings_BTremote_title),
|
||||
text = stringResource(id = R.string.prefs_BTremote_title),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Row(
|
||||
@@ -443,7 +443,7 @@ private fun BluetoothOutputCard(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(text = stringResource(R.string.settings_BTremote_switch))
|
||||
Text(text = stringResource(R.string.prefs_BTremote_switch))
|
||||
Switch(checked = settings.bluetoothState, onCheckedChange = { setBluetoothState(it) })
|
||||
}
|
||||
Row(
|
||||
@@ -454,7 +454,7 @@ private fun BluetoothOutputCard(
|
||||
OutlinedTextField(
|
||||
value = settings.bluetoothAddress,
|
||||
singleLine = true,
|
||||
label = { Text(text = stringResource(R.string.settings_BTremote_device_hint)) },
|
||||
label = { Text(text = stringResource(R.string.prefs_BTremote_device_hint)) },
|
||||
onValueChange = { setBluetoothAddress(it) },
|
||||
modifier = Modifier.weight(1.5f),
|
||||
enabled = settings.bluetoothState
|
||||
@@ -462,7 +462,7 @@ private fun BluetoothOutputCard(
|
||||
OutlinedTextField(
|
||||
value = settings.bluetoothFormat,
|
||||
onValueChange = { setBluetoothFormat(it) },
|
||||
label = { Text(text = stringResource(R.string.settings_BTremote_output_hint)) },
|
||||
label = { Text(text = stringResource(R.string.prefs_BTremote_output_hint)) },
|
||||
singleLine = true,
|
||||
modifier = Modifier.weight(1f),
|
||||
enabled = settings.bluetoothState
|
||||
@@ -503,7 +503,7 @@ private fun OtherCard(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.settings_other_switch_utc))
|
||||
Text(text = stringResource(id = R.string.prefs_other_switch_utc))
|
||||
Switch(checked = settings.stateOfUtc, onCheckedChange = { toggleUtc(it) })
|
||||
}
|
||||
Row(
|
||||
@@ -511,7 +511,7 @@ private fun OtherCard(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.settings_other_switch_update))
|
||||
Text(text = stringResource(id = R.string.prefs_other_switch_update))
|
||||
Switch(checked = settings.stateOfAutoUpdate, onCheckedChange = { toggleUpdate(it) })
|
||||
}
|
||||
Row(
|
||||
@@ -519,7 +519,7 @@ private fun OtherCard(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.settings_other_switch_sweep))
|
||||
Text(text = stringResource(id = R.string.prefs_other_switch_sweep))
|
||||
Switch(checked = settings.stateOfSweep, onCheckedChange = { toggleSweep(it) })
|
||||
}
|
||||
Row(
|
||||
@@ -527,7 +527,7 @@ private fun OtherCard(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text(text = stringResource(id = R.string.settings_other_switch_sensors))
|
||||
Text(text = stringResource(id = R.string.prefs_other_switch_sensors))
|
||||
Switch(checked = settings.stateOfSensors, onCheckedChange = { toggleSensor(it) })
|
||||
}
|
||||
}
|
||||
@@ -537,12 +537,12 @@ private fun OtherCard(
|
||||
@Composable
|
||||
private fun setUpdateTime(updateTime: Long): String {
|
||||
val updateDate = if (updateTime != 0L) {
|
||||
val timePattern = stringResource(id = R.string.settings_last_updated_pattern)
|
||||
val timePattern = stringResource(id = R.string.prefs_updated_time)
|
||||
SimpleDateFormat(timePattern, Locale.getDefault()).format(Date(updateTime))
|
||||
} else {
|
||||
stringResource(id = R.string.passes_placeholder)
|
||||
stringResource(id = R.string.pass_time_placeholder)
|
||||
}
|
||||
return stringResource(id = R.string.settings_data_update, updateDate)
|
||||
return stringResource(id = R.string.prefs_updated_title, updateDate)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -568,7 +568,7 @@ private fun CardCredits(modifier: Modifier = Modifier) {
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings_outro_title),
|
||||
text = stringResource(id = R.string.prefs_outro_title),
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
@@ -576,11 +576,11 @@ private fun CardCredits(modifier: Modifier = Modifier) {
|
||||
)
|
||||
Text(
|
||||
text = stringResource(
|
||||
id = R.string.settings_outro_thanks
|
||||
id = R.string.prefs_outro_thanks
|
||||
), fontSize = 16.sp, textAlign = TextAlign.Center
|
||||
)
|
||||
Text(
|
||||
text = stringResource(id = R.string.settings_outro_license),
|
||||
text = stringResource(id = R.string.prefs_outro_license),
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
|
||||
@@ -152,13 +152,13 @@ class SettingsViewModel(
|
||||
|
||||
private fun setGpsPosition() {
|
||||
if (settingsRepo.setStationPosition()) {
|
||||
val messageResId = R.string.settings_location_success
|
||||
val messageResId = R.string.prefs_loc_success
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = true, messageResId = messageResId
|
||||
)
|
||||
_uiState.update { it.copy(positionSettings = newPosSettings) }
|
||||
} else {
|
||||
val errorResId = R.string.settings_location_gps_error
|
||||
val errorResId = R.string.prefs_loc_gps_error
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = errorResId
|
||||
)
|
||||
@@ -168,13 +168,13 @@ class SettingsViewModel(
|
||||
|
||||
private fun setGeoPosition(latitude: Double, longitude: Double) {
|
||||
if (settingsRepo.setStationPosition(latitude, longitude, 0.0)) {
|
||||
val messageResId = R.string.settings_location_success
|
||||
val messageResId = R.string.prefs_loc_success
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = messageResId
|
||||
)
|
||||
_uiState.update { it.copy(positionSettings = newPosSettings) }
|
||||
} else {
|
||||
val errorResId = R.string.settings_location_manual_error
|
||||
val errorResId = R.string.prefs_loc_manual_error
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = errorResId
|
||||
)
|
||||
@@ -184,13 +184,13 @@ class SettingsViewModel(
|
||||
|
||||
private fun setQthPosition(locator: String) {
|
||||
if (settingsRepo.setStationPosition(locator)) {
|
||||
val messageResId = R.string.settings_location_success
|
||||
val messageResId = R.string.prefs_loc_success
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = messageResId
|
||||
)
|
||||
_uiState.update { it.copy(positionSettings = newPosSettings) }
|
||||
} else {
|
||||
val errorResId = R.string.settings_location_qth_error
|
||||
val errorResId = R.string.prefs_loc_qth_error
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = errorResId
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user