diff --git a/app/src/main/java/life/andre/message487/AppInfo.kt b/app/src/main/java/life/andre/message487/AppInfo.kt index 53b2a76..5d8bc47 100644 --- a/app/src/main/java/life/andre/message487/AppInfo.kt +++ b/app/src/main/java/life/andre/message487/AppInfo.kt @@ -11,23 +11,32 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +@OptIn(ExperimentalLayoutApi::class) @Composable internal fun AppInfo() { val context = LocalContext.current var browserError by remember { mutableStateOf(false) } + fun openLink(url: String) { + browserError = false + try { + context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url))) + } catch (_: ActivityNotFoundException) { + browserError = true + } catch (_: SecurityException) { + browserError = true + } + } Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { - SupportingText(stringResource(R.string.app_version, BuildConfig.VERSION_NAME, BuildConfig.GIT_COMMIT_HASH)) - TextButton(onClick = { - browserError = false - try { - context.startActivity(Intent(Intent.ACTION_VIEW, - Uri.parse("https://github.com/andre487/AndroidMessage487/blob/main/PRIVACY.md"))) - } catch (_: ActivityNotFoundException) { - browserError = true - } catch (_: SecurityException) { - browserError = true + FlowRow(horizontalArrangement = Arrangement.Center) { + Text(stringResource(R.string.app_version, BuildConfig.VERSION_NAME, BuildConfig.GIT_COMMIT_HASH), + modifier = Modifier.align(Alignment.CenterVertically), + style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant) + TextButton(onClick = { openLink("https://github.com/andre487/AndroidMessage487") }) { + Text(stringResource(R.string.github), style = MaterialTheme.typography.bodySmall) } - }, modifier = Modifier.fillMaxWidth()) { + } + TextButton(onClick = { openLink("https://github.com/andre487/AndroidMessage487/blob/main/PRIVACY.md") }, + modifier = Modifier.fillMaxWidth()) { Text(stringResource(R.string.privacy_policy)) } if (browserError) Text(stringResource(R.string.no_browser), color = MaterialTheme.colorScheme.error) diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index c76a7a1..09f63e5 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -1,8 +1,8 @@ - + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index f42194b..5b34bbd 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index dcb7214..de36c53 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index 3fc05a6..01f1f83 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index 399d84a..a884d97 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index 81f75d1..79492df 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index e976297..f3f703d 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -121,8 +121,9 @@ Введите токен без префикса Bearer. Хранится на устройстве в зашифрованном виде. Введите токен без пробелов и префикса Bearer. Версия %1$s · %2$s + GitHub Политика конфиденциальности - Не удалось открыть политику конфиденциальности: браузер недоступен. + Не удалось открыть ссылку: браузер недоступен. Не отправлять дубли SMS Не отправлять дубли уведомлений Пропускать сообщения с одинаковыми источником и текстом в выбранном окне времени. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 031a887..6f157f3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -121,8 +121,9 @@ Enter the token without the Bearer prefix. Stored encrypted on this device. Enter a token without spaces or the Bearer prefix. Version %1$s · %2$s + GitHub Privacy policy - No browser is available to open the privacy policy. + No browser is available to open this link. Skip duplicate SMS Skip duplicate notifications Skip messages with the same source and exact text within the selected time window. diff --git a/app/src/test/java/life/andre/message487/ScreenInteractionTest.kt b/app/src/test/java/life/andre/message487/ScreenInteractionTest.kt index 4bbb6ea..b45b0cf 100644 --- a/app/src/test/java/life/andre/message487/ScreenInteractionTest.kt +++ b/app/src/test/java/life/andre/message487/ScreenInteractionTest.kt @@ -91,11 +91,18 @@ class ScreenInteractionTest { node(R.string.connection_heading).assertIsDisplayed() } - @Test fun `overview and connection show version and open the public privacy policy`() { + @Test fun `overview and connection show version and open GitHub and privacy policy`() { for (connection in listOf(false, true)) { if (connection) compose.onNode(hasText(application.getString(R.string.connection_nav)) and hasClickAction()).performClick() compose.onNode(hasScrollToIndexAction()).performScrollToNode(hasText(application.getString(R.string.privacy_policy))) compose.onNodeWithText(application.getString(R.string.app_version, BuildConfig.VERSION_NAME, BuildConfig.GIT_COMMIT_HASH)).assertIsDisplayed() + node(R.string.github).performClick() + compose.runOnIdle { + val intent = org.robolectric.Shadows.shadowOf(compose.activity).nextStartedActivity + assertNotNull(intent) + assertEquals(android.content.Intent.ACTION_VIEW, intent.action) + assertEquals("https://github.com/andre487/AndroidMessage487", intent.dataString) + } node(R.string.privacy_policy).performClick() compose.runOnIdle { val intent = org.robolectric.Shadows.shadowOf(compose.activity).nextStartedActivity diff --git a/assets/branding/README.md b/assets/branding/README.md index 7678ec5..a33fd3d 100644 --- a/assets/branding/README.md +++ b/assets/branding/README.md @@ -20,8 +20,9 @@ Sizes: square/round icon 512×512, status icon 24×24, feature graphic 1024×500 The round and status PNGs retain transparency; the white status mark needs a contrasting background. Android adaptive layers live in `app/src/main/res/drawable/ic_launcher_{background,foreground}.xml`. -The foreground uses scale `0.73` about the center of its 1254-unit viewport; the SVGs use the -same paths, transform and gradient, cropped to Android's central 836×836 viewport. +The adaptive foreground and round SVG use scale `0.65` about the center of their 1254-unit +viewport for extra circular-mask padding. The square SVG retains scale `0.73`. +Both SVGs share the Android paths and gradient, cropped to the central 836×836 viewport. Keep these sources synchronized when changing the artwork. The themed launcher and notification small icon share `ic_notification.xml`, the simplified white monitor/phone silhouette without envelopes or gradient. Update notifications use this diff --git a/assets/branding/icon-round.png b/assets/branding/icon-round.png index 09685f7..c691353 100644 Binary files a/assets/branding/icon-round.png and b/assets/branding/icon-round.png differ diff --git a/assets/branding/icon-round.svg b/assets/branding/icon-round.svg index 026e00b..2d0a3bd 100644 --- a/assets/branding/icon-round.svg +++ b/assets/branding/icon-round.svg @@ -10,7 +10,7 @@ - +