Remove map bug report dialog, launch fixme url right away

This commit is contained in:
MM20
2024-03-26 19:22:35 +01:00
parent dfb76bd3af
commit 559b65f20a
2 changed files with 5 additions and 56 deletions
@@ -111,8 +111,6 @@ fun LocationItem(
val distance = userLocation?.distanceTo(location.toAndroidLocation())
var showBugreportDialog by remember { mutableStateOf(false) }
Row(modifier = modifier) {
Column {
Row(
@@ -445,7 +443,11 @@ fun LocationItem(
label = stringResource(id = R.string.menu_bugreport),
icon = Icons.Rounded.BugReport,
) {
showBugreportDialog = true
context.tryStartActivity(
Intent(
Intent.ACTION_VIEW, Uri.parse(location.fixMeUrl)
)
)
}
}
@@ -463,58 +465,6 @@ fun LocationItem(
}
}
}
if (showBugreportDialog && location.fixMeUrl != null) {
AlertDialog(
containerColor = MaterialTheme.colorScheme.surface,
tonalElevation = 35.dp,
confirmButton = {
TextButton(
onClick = { showBugreportDialog = false },
shape = MaterialTheme.shapes.medium,
) {
Text(
text = stringResource(id = android.R.string.ok),
style = MaterialTheme.typography.labelLarge,
)
}
},
onDismissRequest = {
showBugreportDialog = false
},
text = {
Column(
Modifier
.fillMaxWidth()
.padding(8.dp)
) {
Text(
text = stringResource(id = R.string.alert_bugreport),
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.onSurface,
softWrap = true,
textAlign = TextAlign.Justify
)
HorizontalDivider(Modifier.padding(vertical = 8.dp))
Text(
modifier = modifier.clickable {
showBugreportDialog = false
viewModel.viewModelScope.launch {
context.tryStartActivity(
Intent(
Intent.ACTION_VIEW, Uri.parse(location.fixMeUrl)
)
)
}
},
text = location.fixMeUrl!!,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}
)
}
}
@Composable
@@ -887,7 +887,6 @@
<string name="preference_search_location_custom_tile_server_url">Tileserver URL</string>
<string name="menu_dial">Dial</string>
<string name="menu_bugreport">Bug Report</string>
<string name="alert_bugreport">You have reached the bug-report dialog. In case the location result contains incorrect data, please double check with the provider and tap the link below if the issue is theirs. If this is not the case, please raise an issue on GitHub with the location that you were looking up!</string>
<string name="location_open_24_7">Open 24/7</string>
<string name="plugin_state_error">This plugin isn\'t working correctly</string>
<string name="plugin_state_setup_required">You need to setup this plugin first</string>