Release GPS2Audio v2.5.44 POI category fix
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package de.waypointaudio.ui
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.selection.selectable
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.RadioButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import de.waypointaudio.R
|
||||
import de.waypointaudio.data.MapProvider
|
||||
|
||||
/**
|
||||
* Auswahl-Dialog für den Karten-Tile-Provider.
|
||||
*
|
||||
* Listet alle Provider aus [MapProvider]. Die OSM-Attribution bleibt für alle
|
||||
* Provider sichtbar (eigenes Overlay in MapScreen).
|
||||
*/
|
||||
@Composable
|
||||
fun MapProviderDialog(
|
||||
selected: MapProvider,
|
||||
onSelect: (MapProvider) -> Unit,
|
||||
onDismiss: () -> Unit
|
||||
) {
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
title = { Text(stringResource(R.string.map_provider_title)) },
|
||||
text = {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
MapProvider.values().forEach { provider ->
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.selectable(
|
||||
selected = (provider == selected),
|
||||
onClick = { onSelect(provider) }
|
||||
)
|
||||
.padding(vertical = 6.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
RadioButton(
|
||||
selected = (provider == selected),
|
||||
onClick = { onSelect(provider) }
|
||||
)
|
||||
Text(
|
||||
stringResource(provider.displayNameRes),
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = onDismiss) { Text(stringResource(R.string.about_close)) }
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user