From 559b65f20ab207c944a9888dccdd64f76b3363aa Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:22:35 +0100 Subject: [PATCH] Remove map bug report dialog, launch fixme url right away --- .../launcher/search/location/LocationItem.kt | 60 ++----------------- core/i18n/src/main/res/values/strings.xml | 1 - 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/location/LocationItem.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/location/LocationItem.kt index 64f0a1b2..6c46c2ed 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/location/LocationItem.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/location/LocationItem.kt @@ -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 diff --git a/core/i18n/src/main/res/values/strings.xml b/core/i18n/src/main/res/values/strings.xml index adfb3b85..57c88724 100644 --- a/core/i18n/src/main/res/values/strings.xml +++ b/core/i18n/src/main/res/values/strings.xml @@ -887,7 +887,6 @@ Tileserver URL Dial Bug Report - 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! Open 24/7 This plugin isn\'t working correctly You need to setup this plugin first