Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions app/src/main/java/life/andre/message487/AppInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp" android:height="108dp"
android:viewportWidth="1254" android:viewportHeight="1254">
<group android:scaleX="0.73" android:scaleY="0.73"
android:translateX="169.29" android:translateY="169.29">
<group android:scaleX="0.65" android:scaleY="0.65"
android:translateX="219.45" android:translateY="219.45">
<path android:fillColor="#FFFFFFFF" android:pathData="M313,298H877Q942,298 942,363V563H878V377Q878,361 862,361H329Q313,361 313,377V711Q313,727 329,727H764V790H313Q248,790 248,725V363Q248,298 313,298Z M544,790H642V857H698Q730,857 730,887Q730,917 698,917H488Q456,917 456,887Q456,857 488,857H544Z" />
<path android:fillColor="#FFFFFFFF" android:fillType="evenOdd"
android:pathData="M819,563H960Q1015,563 1015,618V887Q1015,942 960,942H819Q764,942 764,887V618Q764,563 819,563Z M831,616Q813,616 813,634V870Q813,888 831,888H948Q966,888 966,870V634Q966,616 948,616Z" />
Expand Down
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@
<string name="token_hint">Введите токен без префикса Bearer. Хранится на устройстве в зашифрованном виде.</string>
<string name="invalid_token">Введите токен без пробелов и префикса Bearer.</string>
<string name="app_version">Версия %1$s · %2$s</string>
<string name="github">GitHub</string>
<string name="privacy_policy">Политика конфиденциальности</string>
<string name="no_browser">Не удалось открыть политику конфиденциальности: браузер недоступен.</string>
<string name="no_browser">Не удалось открыть ссылку: браузер недоступен.</string>
<string name="sms_deduplication">Не отправлять дубли SMS</string>
<string name="notification_deduplication">Не отправлять дубли уведомлений</string>
<string name="deduplication_hint">Пропускать сообщения с одинаковыми источником и текстом в выбранном окне времени.</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@
<string name="token_hint">Enter the token without the Bearer prefix. Stored encrypted on this device.</string>
<string name="invalid_token">Enter a token without spaces or the Bearer prefix.</string>
<string name="app_version">Version %1$s · %2$s</string>
<string name="github">GitHub</string>
<string name="privacy_policy">Privacy policy</string>
<string name="no_browser">No browser is available to open the privacy policy.</string>
<string name="no_browser">No browser is available to open this link.</string>
<string name="sms_deduplication">Skip duplicate SMS</string>
<string name="notification_deduplication">Skip duplicate notifications</string>
<string name="deduplication_hint">Skip messages with the same source and exact text within the selected time window.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions assets/branding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified assets/branding/icon-round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/branding/icon-round.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading