From f4fa16b5df3df52a65d7b1985bcf2f7898dfa3eb Mon Sep 17 00:00:00 2001 From: Nishant Mishra Date: Fri, 7 Nov 2025 22:49:44 +0530 Subject: [PATCH] feat(settings): remove BMC link in Play Store version --- .../settingsScreen/components/AboutButtons.kt | 87 +++++++++++++++++++ .../ui/settingsScreen/components/AboutCard.kt | 39 +-------- app/src/main/res/drawable/weblate.xml | 26 ++++++ app/src/main/res/values/strings.xml | 1 + .../settingsScreen/components/AboutButtons.kt | 86 ++++++++++++++++++ 5 files changed, 202 insertions(+), 37 deletions(-) create mode 100644 app/src/foss/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt create mode 100644 app/src/main/res/drawable/weblate.xml create mode 100644 app/src/play/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt diff --git a/app/src/foss/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt b/app/src/foss/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt new file mode 100644 index 0000000..3ce2377 --- /dev/null +++ b/app/src/foss/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2025 Nishant Mishra + * + * This file is part of Tomato - a minimalist pomodoro timer for Android. + * + * Tomato is free software: you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * Tomato is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Tomato. + * If not, see . + */ + +package org.nsh07.pomodoro.ui.settingsScreen.components + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonColors +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalUriHandler +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import org.nsh07.pomodoro.R + +@Composable +fun TopButton( + buttonColors: ButtonColors, + modifier: Modifier = Modifier +) { + val uriHandler = LocalUriHandler.current + Button( + colors = buttonColors, + onClick = { uriHandler.openUri("https://coff.ee/nsh07") }, + modifier = modifier + ) { + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(R.drawable.bmc), + contentDescription = null, + modifier = Modifier.height(24.dp) + ) + + Text(text = stringResource(R.string.bmc)) + } + } +} + +@Composable +fun BottomButton( + buttonColors: ButtonColors, + modifier: Modifier = Modifier +) { + val uriHandler = LocalUriHandler.current + Button( + colors = buttonColors, + onClick = { uriHandler.openUri("https://hosted.weblate.org/engage/tomato/") }, + modifier = modifier + ) { + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(R.drawable.weblate), + contentDescription = null, + modifier = Modifier.size(20.dp) + ) + + Text(text = stringResource(R.string.help_with_translation)) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutCard.kt b/app/src/main/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutCard.kt index 14028fe..3ce8e3a 100644 --- a/app/src/main/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutCard.kt +++ b/app/src/main/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutCard.kt @@ -24,10 +24,8 @@ import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults @@ -119,41 +117,8 @@ fun AboutCard( modifier = Modifier.padding(start = 16.dp, end = 16.dp, bottom = 16.dp), horizontalArrangement = Arrangement.spacedBy(8.dp) ) { - Button( - colors = buttonColors, - onClick = { uriHandler.openUri("https://coff.ee/nsh07") } - ) { - Row( - horizontalArrangement = Arrangement.spacedBy(8.dp), - verticalAlignment = Alignment.CenterVertically - ) { - Icon( - painterResource(R.drawable.bmc), - contentDescription = null, - modifier = Modifier.height(24.dp) - ) - - Text(text = stringResource(R.string.bmc)) - } - } - - Button( - colors = buttonColors, - onClick = { uriHandler.openUri("https://play.google.com/store/apps/details?id=org.nsh07.pomodoro") } - ) { - Row( - horizontalArrangement = Arrangement.spacedBy(8.dp), - verticalAlignment = Alignment.CenterVertically - ) { - Icon( - painterResource(R.drawable.play_store), - contentDescription = null, - modifier = Modifier.size(20.dp) - ) - - Text(text = stringResource(R.string.rate_on_google_play)) - } - } + TopButton(buttonColors) + BottomButton(buttonColors) } } } \ No newline at end of file diff --git a/app/src/main/res/drawable/weblate.xml b/app/src/main/res/drawable/weblate.xml new file mode 100644 index 0000000..22126d0 --- /dev/null +++ b/app/src/main/res/drawable/weblate.xml @@ -0,0 +1,26 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a608b21..078f5d7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -92,4 +92,5 @@ Rate on Google Play BuyMeACoffee Selected + Help with translation \ No newline at end of file diff --git a/app/src/play/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt b/app/src/play/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt new file mode 100644 index 0000000..aebde4a --- /dev/null +++ b/app/src/play/java/org/nsh07/pomodoro/ui/settingsScreen/components/AboutButtons.kt @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2025 Nishant Mishra + * + * This file is part of Tomato - a minimalist pomodoro timer for Android. + * + * Tomato is free software: you can redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * Tomato is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Tomato. + * If not, see . + */ + +package org.nsh07.pomodoro.ui.settingsScreen.components + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Button +import androidx.compose.material3.ButtonColors +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalUriHandler +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp +import org.nsh07.pomodoro.R + +@Composable +fun TopButton( + buttonColors: ButtonColors, + modifier: Modifier = Modifier +) { + val uriHandler = LocalUriHandler.current + Button( + colors = buttonColors, + onClick = { uriHandler.openUri("https://hosted.weblate.org/engage/tomato/") }, + modifier = modifier + ) { + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(R.drawable.weblate), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + + Text(text = stringResource(R.string.help_with_translation)) + } + } +} + +@Composable +fun BottomButton( + buttonColors: ButtonColors, + modifier: Modifier = Modifier +) { + val uriHandler = LocalUriHandler.current + Button( + colors = buttonColors, + onClick = { uriHandler.openUri("https://play.google.com/store/apps/details?id=org.nsh07.pomodoro") }, + modifier = modifier + ) { + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painterResource(R.drawable.play_store), + contentDescription = null, + modifier = Modifier.size(24.dp) + ) + + Text(text = stringResource(R.string.rate_on_google_play)) + } + } +} \ No newline at end of file