mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-04 11:37:22 +00:00
Added tweaks to GH actions workflow, refactored strings
This commit is contained in:
1 parent
1a69822d3f
commit
7add81e8b6
22 files changed
+728
-857
No files matched your search
@@ -83,7 +83,7 @@ class MainContainer(private val context: Context) {
|
||||
}
|
||||
|
||||
private fun provideLocalSource(): ILocalSource {
|
||||
val builder = Room.databaseBuilder(context, Look4SatDb::class.java, "Look4SatDBv313")
|
||||
val builder = Room.databaseBuilder(context, Look4SatDb::class.java, "Look4SatDBv400")
|
||||
val database = builder.apply { fallbackToDestructiveMigration(false) }.build()
|
||||
return LocalSource(database.look4SatDao())
|
||||
}
|
||||
|
||||
@@ -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.pass_satId, pass.catNum)
|
||||
val passSatId = stringResource(id = R.string.passes_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.pass_aosLos,
|
||||
id = R.string.passes_aosLos,
|
||||
pass.aosAzimuth.toInt(),
|
||||
pass.losAzimuth.toInt()
|
||||
),
|
||||
@@ -235,7 +235,7 @@ fun EmptyListCard(message: String) {
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier.padding(32.dp)
|
||||
) {
|
||||
Text(text = stringResource(R.string.empty_list_title), fontSize = 21.sp)
|
||||
Text(text = stringResource(R.string.empty_list_message), fontSize = 21.sp)
|
||||
Text(text = message, fontSize = 18.sp, textAlign = TextAlign.Center)
|
||||
}
|
||||
}
|
||||
@@ -302,7 +302,7 @@ fun InfoDialog(title: String, text: String, onDismiss: () -> Unit) {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
CardButton(
|
||||
onClick = onDismiss,
|
||||
text = stringResource(id = R.string.btn_understand)
|
||||
text = stringResource(id = R.string.btn_accept)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ private fun MapDataCard(data: MapData) {
|
||||
val textColor = MaterialTheme.colorScheme.primary
|
||||
val cardColors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainerLowest)
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.SpaceBetween) {
|
||||
Text(text = "© OpenStreetMap contributors", fontSize = 14.sp)
|
||||
Text(text = stringResource(R.string.map_copyright), fontSize = 14.sp)
|
||||
Card(colors = cardColors) {
|
||||
Column(modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)) {
|
||||
Row(horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) {
|
||||
@@ -172,7 +172,7 @@ private fun MapDataCard(data: MapData) {
|
||||
private fun MapDataCards(data: MapData) {
|
||||
val cardColors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceContainerLowest)
|
||||
val paddingMod = Modifier.padding(horizontal = 8.dp, vertical = 4.dp).width(160.dp)
|
||||
val osmText = "© OpenStreetMap contributors"
|
||||
val osmText = stringResource(R.string.map_copyright)
|
||||
val textColor = MaterialTheme.colorScheme.primary
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Card(colors = cardColors, modifier = Modifier.align(Alignment.TopStart)) {
|
||||
|
||||
@@ -42,6 +42,7 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
@@ -73,16 +74,16 @@ fun PassesDialog(hours: Int, elevation: Double, cancel: () -> Unit, accept: (Int
|
||||
val onAccept = {
|
||||
accept(hoursValue.intValue, elevationValueNew.doubleValue).also { cancel() }
|
||||
}
|
||||
SharedDialog(title = "Passes", onCancel = cancel, onAccept = onAccept) {
|
||||
SharedDialog(title = stringResource(R.string.passes_filter_passes), onCancel = cancel, onAccept = onAccept) {
|
||||
SliderRow(
|
||||
title = "Show passes above",
|
||||
title = stringResource(R.string.passes_filter_above),
|
||||
value = elevationValueNew.doubleValue,
|
||||
valuePostfix = "°",
|
||||
valueResId = R.drawable.ic_elevation,
|
||||
valueRange = 0f..60f
|
||||
) { elevationValueNew.doubleValue = it.toDouble() }
|
||||
SliderRow(
|
||||
title = "Show passes within",
|
||||
title = stringResource(R.string.passes_filter_within),
|
||||
value = hoursValue.intValue.toDouble(),
|
||||
valuePostfix = "h",
|
||||
valueResId = R.drawable.ic_clock,
|
||||
@@ -145,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 = "Radios", onCancel = cancel, onAccept = onAccept) {
|
||||
SharedDialog(title = stringResource(R.string.passes_filter_modes), onCancel = cancel, onAccept = onAccept) {
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Adaptive(240.dp),
|
||||
modifier = Modifier
|
||||
|
||||
@@ -204,7 +204,7 @@ private fun NearEarthPass(
|
||||
modifier: Modifier = Modifier,
|
||||
isVerticalLayout: Boolean = true
|
||||
) {
|
||||
val passSatId = stringResource(id = R.string.pass_satId, pass.catNum)
|
||||
val passSatId = stringResource(id = R.string.passes_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 = "DeepSpace", fontSize = 15.sp)
|
||||
Text(text = stringResource(R.string.passes_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.pass_aosLos,
|
||||
id = R.string.passes_aosLos,
|
||||
pass.aosAzimuth.toInt(),
|
||||
pass.losAzimuth.toInt()
|
||||
),
|
||||
|
||||
@@ -32,6 +32,8 @@ import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.draw.rotate
|
||||
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.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
@@ -333,7 +335,7 @@ private fun EclipsedIndicator() {
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = "Eclipsed!",
|
||||
text = stringResource(R.string.radar_eclipsed),
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = MaterialTheme.colorScheme.background,
|
||||
@@ -387,12 +389,13 @@ private fun FrequencyRow(radio: SatRadio, isDownlink: Boolean, modifier: Modifie
|
||||
Row(verticalAlignment = Alignment.CenterVertically, modifier = modifier.fillMaxWidth()) {
|
||||
val rotateMod = Modifier.rotate(if (isDownlink) 90f else -90f)
|
||||
val weightMod = Modifier.weight(1f)
|
||||
val desc = if (isDownlink) stringResource(R.string.radar_downlink) else stringResource(R.string.radar_uplink)
|
||||
Text(
|
||||
text = if (isDownlink) "D:" else "U:",
|
||||
textAlign = TextAlign.Center,
|
||||
fontSize = 18.sp,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
modifier = modifier.size(width = 24.dp, height = 24.dp)
|
||||
modifier = modifier.size(width = 24.dp, height = 24.dp).semantics { contentDescription = desc }
|
||||
)
|
||||
FrequencyText(if (isDownlink) radio.downlinkLow else radio.uplinkLow, weightMod)
|
||||
Text(
|
||||
@@ -407,7 +410,7 @@ private fun FrequencyRow(radio: SatRadio, isDownlink: Boolean, modifier: Modifie
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_arrow),
|
||||
tint = MaterialTheme.colorScheme.onSurface,
|
||||
contentDescription = if (isDownlink) "Downlink" else "Uplink",
|
||||
contentDescription = null,
|
||||
modifier = rotateMod.size(width = 24.dp, height = 24.dp)
|
||||
)
|
||||
}
|
||||
@@ -415,10 +418,10 @@ private fun FrequencyRow(radio: SatRadio, isDownlink: Boolean, modifier: Modifie
|
||||
|
||||
@Composable
|
||||
private fun FrequencyText(frequency: Long?, modifier: Modifier = Modifier) {
|
||||
val noLinkText = stringResource(R.string.radio_no_link)
|
||||
val noLinkText = stringResource(R.string.radar_no_link)
|
||||
val freqValue = frequency?.let { it / 1000000f }
|
||||
Text(
|
||||
text = freqValue?.let { stringResource(id = R.string.radio_link_low, it) } ?: noLinkText,
|
||||
text = freqValue?.let { stringResource(id = R.string.radar_link_low, it) } ?: noLinkText,
|
||||
textAlign = TextAlign.Center,
|
||||
fontSize = 21.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
|
||||
@@ -17,10 +17,12 @@ import androidx.compose.runtime.mutableStateListOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.rtbishop.look4sat.R
|
||||
import com.rtbishop.look4sat.presentation.MainTheme
|
||||
import com.rtbishop.look4sat.presentation.common.SharedDialog
|
||||
|
||||
@@ -40,7 +42,7 @@ fun MultiTypesDialog(
|
||||
if (selected.contains(type)) selected.remove(type) else selected.add(type)
|
||||
}
|
||||
val onAccept = { accept(selected.toList()) }
|
||||
SharedDialog(title = "Select category", onCancel = cancel, onAccept = onAccept) {
|
||||
SharedDialog(title = stringResource(R.string.satellites_select_type), onCancel = cancel, onAccept = onAccept) {
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Adaptive(240.dp),
|
||||
modifier = Modifier
|
||||
|
||||
@@ -143,7 +143,7 @@ private fun SearchBar(setQuery: (String) -> Unit, modifier: Modifier = Modifier)
|
||||
decorationBox = { innerTextField ->
|
||||
if (currentQuery.value.isEmpty()) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.entries_search_hint),
|
||||
text = stringResource(id = R.string.satellites_search_hint),
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 20.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
@@ -178,7 +178,7 @@ private fun TypeCard(types: List<String>, onClick: () -> Unit, modifier: Modifie
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Text(
|
||||
text = "Tags: $typesText",
|
||||
text = stringResource(R.string.satellites_type, typesText),
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier
|
||||
@@ -199,7 +199,7 @@ private fun SatellitePreview() {
|
||||
|
||||
@Composable
|
||||
private fun Satellite(item: SatItem, onSelected: (Int, Boolean) -> Unit, modifier: Modifier) {
|
||||
val passSatId = stringResource(id = R.string.pass_satId, item.catnum)
|
||||
val passSatId = stringResource(id = R.string.passes_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.position_title)
|
||||
val titleText = stringResource(id = R.string.settings_position_title)
|
||||
val onAccept = { saveValues(latValue.value, lonValue.value, save).also { dismiss() } }
|
||||
SharedDialog(title = titleText, onCancel = dismiss, onAccept = onAccept) {
|
||||
Text(text = stringResource(id = R.string.position_lat_text))
|
||||
Text(text = stringResource(id = R.string.settings_position_lat_text))
|
||||
OutlinedTextField(value = latValue.value, onValueChange = { latValue.value = it })
|
||||
Text(text = stringResource(id = R.string.position_lon_text))
|
||||
Text(text = stringResource(id = R.string.settings_position_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 = "Radios", onCancel = dismiss, onAccept = onAccept) {
|
||||
Text(text = stringResource(id = R.string.locator_text))
|
||||
SharedDialog(title = stringResource(R.string.settings_locator_title), onCancel = dismiss, onAccept = onAccept) {
|
||||
Text(text = stringResource(id = R.string.settings_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.BTremote_perm_error)
|
||||
val bluetoothError = stringResource(R.string.settings_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.location_gps_error)
|
||||
val locationError = stringResource(R.string.settings_location_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.location_title),
|
||||
text = stringResource(id = R.string.settings_location_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.btn_gps),
|
||||
text = stringResource(id = R.string.settings_station_gps),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = showPosDialog,
|
||||
text = stringResource(id = R.string.btn_manual),
|
||||
text = stringResource(id = R.string.settings_station_manual),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = showLocDialog,
|
||||
text = stringResource(id = R.string.btn_qth),
|
||||
text = stringResource(id = R.string.settings_station_qth),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
}
|
||||
@@ -310,7 +310,7 @@ private fun DataCard(
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.data_title),
|
||||
text = stringResource(id = R.string.settings_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.btn_web),
|
||||
text = stringResource(id = R.string.settings_data_online),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = { updateFromFile() },
|
||||
text = stringResource(id = R.string.btn_import),
|
||||
text = stringResource(id = R.string.settings_data_import),
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
CardButton(
|
||||
onClick = { clearAllData() },
|
||||
text = stringResource(id = R.string.btn_clear),
|
||||
text = stringResource(id = R.string.settings_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.remote_title),
|
||||
text = stringResource(id = R.string.settings_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.remote_switch))
|
||||
Text(text = stringResource(R.string.settings_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.remote_ip_hint)) },
|
||||
label = { Text(text = stringResource(R.string.settings_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.remote_port_hint)) },
|
||||
label = { Text(text = stringResource(R.string.settings_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.BTremote_title),
|
||||
text = stringResource(id = R.string.settings_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.BTremote_switch))
|
||||
Text(text = stringResource(R.string.settings_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.BTremote_device_hint)) },
|
||||
label = { Text(text = stringResource(R.string.settings_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.BTremote_output_hint)) },
|
||||
label = { Text(text = stringResource(R.string.settings_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.other_switch_utc))
|
||||
Text(text = stringResource(id = R.string.settings_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.other_switch_update))
|
||||
Text(text = stringResource(id = R.string.settings_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.other_switch_sweep))
|
||||
Text(text = stringResource(id = R.string.settings_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.other_switch_sensors))
|
||||
Text(text = stringResource(id = R.string.settings_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.last_updated_pattern)
|
||||
val timePattern = stringResource(id = R.string.settings_last_updated_pattern)
|
||||
SimpleDateFormat(timePattern, Locale.getDefault()).format(Date(updateTime))
|
||||
} else {
|
||||
stringResource(id = R.string.pass_placeholder)
|
||||
stringResource(id = R.string.passes_placeholder)
|
||||
}
|
||||
return stringResource(id = R.string.data_update, updateDate)
|
||||
return stringResource(id = R.string.settings_data_update, 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.outro_title),
|
||||
text = stringResource(id = R.string.settings_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.outro_thanks
|
||||
id = R.string.settings_outro_thanks
|
||||
), fontSize = 16.sp, textAlign = TextAlign.Center
|
||||
)
|
||||
Text(
|
||||
text = stringResource(id = R.string.outro_license),
|
||||
text = stringResource(id = R.string.settings_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.location_success
|
||||
val messageResId = R.string.settings_location_success
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = true, messageResId = messageResId
|
||||
)
|
||||
_uiState.update { it.copy(positionSettings = newPosSettings) }
|
||||
} else {
|
||||
val errorResId = R.string.location_gps_error
|
||||
val errorResId = R.string.settings_location_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.location_success
|
||||
val messageResId = R.string.settings_location_success
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = messageResId
|
||||
)
|
||||
_uiState.update { it.copy(positionSettings = newPosSettings) }
|
||||
} else {
|
||||
val errorResId = R.string.location_manual_error
|
||||
val errorResId = R.string.settings_location_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.location_success
|
||||
val messageResId = R.string.settings_location_success
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = messageResId
|
||||
)
|
||||
_uiState.update { it.copy(positionSettings = newPosSettings) }
|
||||
} else {
|
||||
val errorResId = R.string.location_qth_error
|
||||
val errorResId = R.string.settings_location_qth_error
|
||||
val newPosSettings = _uiState.value.positionSettings.copy(
|
||||
isUpdating = false, messageResId = errorResId
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user