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
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId = "fr.benju.tasks"
minSdk = 26
targetSdk = 36
versionCode = 1
versionName = "1.0.0"
versionCode = 2
versionName = "1.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

package fr.benju.tasks.feature.settings

import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -22,6 +25,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
Expand All @@ -34,6 +38,7 @@ fun SettingsScreen(
onBack: () -> Unit = {}
) {
val isDarkMode by viewModel.darkModeFlow.collectAsStateWithLifecycle()
val context = LocalContext.current

Scaffold(
topBar = {
Expand Down Expand Up @@ -77,10 +82,91 @@ fun SettingsScreen(
)

Text(
text = stringResource(R.string.settings_version),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant
text = stringResource(R.string.settings_about),
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.padding(bottom = 8.dp)
)

Row(
modifier = Modifier
.fillMaxWidth()
.clickable {
val intent = Intent(Intent.ACTION_SENDTO).apply {
data = Uri.parse("mailto:begonin@gmail.com")
}
Comment on lines +94 to +96
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The support email address is hardcoded in the UI code. For easier future updates (and to keep UI strings/config in one place), consider moving this address into a string resource or a small constants file (and building the mailto: Uri from it).

Copilot uses AI. Check for mistakes.
runCatching { context.startActivity(intent) }
}
.padding(vertical = 12.dp),
Comment on lines +91 to +99
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this modifier chain, .padding(vertical = 12.dp) comes after .clickable { ... }, which means the padded area will not be part of the tappable/clickable hit target. Reorder modifiers so the padding is applied before clickable (or move clickable to be the outermost modifier) to ensure the full row (including padding) is clickable.

Copilot uses AI. Check for mistakes.
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.settings_contact_support),
style = MaterialTheme.typography.bodyMedium
)
}

Row(
modifier = Modifier
.fillMaxWidth()
.clickable {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://benju.fr/support.html"))
runCatching { context.startActivity(intent) }
Comment on lines +111 to +113
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The support URL is hardcoded in the UI code. Consider moving it to a string resource or constant (possibly per build variant) so it can be updated without touching UI logic.

Copilot uses AI. Check for mistakes.
}
.padding(vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically
Comment on lines +109 to +116
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: .padding(vertical = 12.dp) is applied after .clickable { ... }, so the padded area won't be clickable. Reorder the modifiers so the padding is inside the clickable surface (e.g., apply padding before clickable).

Copilot uses AI. Check for mistakes.
) {
Text(
text = stringResource(R.string.settings_support_me),
style = MaterialTheme.typography.bodyMedium
)
}

Row(
modifier = Modifier
.fillMaxWidth()
.clickable {
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse("market://details?id=${context.packageName}")
).apply {
addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_NEW_DOCUMENT or Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
}
val fallback = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/details?id=${context.packageName}")
)
runCatching { context.startActivity(intent) }
.onFailure { runCatching { context.startActivity(fallback) } }
}
.padding(vertical = 12.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.settings_rate_app),
style = MaterialTheme.typography.bodyMedium
)
}

Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 12.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.settings_version),
style = MaterialTheme.typography.bodyMedium
)
val versionName = runCatching {
context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty()
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With compileSdk = 36, PackageManager.getPackageInfo(String, Int) is deprecated. Use the newer flags-based API on API 33+ (and fall back to the legacy call on older SDKs) to avoid deprecation warnings and keep the code aligned with current Android APIs.

Suggested change
context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty()
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) {
context.packageManager.getPackageInfo(
context.packageName,
android.content.pm.PackageManager.PackageInfoFlags.of(0)
).versionName.orEmpty()
} else {
@Suppress("DEPRECATION")
context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty()
}

Copilot uses AI. Check for mistakes.
}.getOrDefault("")
Comment on lines +161 to +163
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versionName is computed by calling PackageManager.getPackageInfo(...) directly in the composable body, which will re-run on every recomposition. Cache this (e.g., with remember/produceState) so it’s only resolved once per composition (or when context.packageName changes).

Copilot uses AI. Check for mistakes.
Text(
text = versionName,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant
)
}
}
}
}
6 changes: 5 additions & 1 deletion feature/settings/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<resources>
<string name="settings_title">Einstellungen</string>
<string name="settings_dark_mode">Dunkelmodus</string>
<string name="settings_version">Version 1.0.0</string>
<string name="settings_about">Über</string>
<string name="settings_contact_support">Support kontaktieren</string>
<string name="settings_support_me">Unterstütze mich</string>
<string name="settings_rate_app">App bewerten</string>
<string name="settings_version">Version</string>
<string name="cd_back">Zurück</string>
</resources>

6 changes: 5 additions & 1 deletion feature/settings/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<resources>
<string name="settings_title">Ajustes</string>
<string name="settings_dark_mode">Modo oscuro</string>
<string name="settings_version">Versión 1.0.0</string>
<string name="settings_about">Acerca de</string>
<string name="settings_contact_support">Contactar soporte</string>
<string name="settings_support_me">Apóyame</string>
<string name="settings_rate_app">Valorar la aplicación</string>
<string name="settings_version">Versión</string>
<string name="cd_back">Atrás</string>
</resources>

6 changes: 5 additions & 1 deletion feature/settings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<resources>
<string name="settings_title">Paramètres</string>
<string name="settings_dark_mode">Mode sombre</string>
<string name="settings_version">Version 1.0.0</string>
<string name="settings_about">À propos</string>
<string name="settings_contact_support">Contacter le support</string>
<string name="settings_support_me">Me soutenir</string>
<string name="settings_rate_app">Noter l\'application</string>
<string name="settings_version">Version</string>
<string name="cd_back">Retour</string>
</resources>

6 changes: 5 additions & 1 deletion feature/settings/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<resources>
<string name="settings_title">Impostazioni</string>
<string name="settings_dark_mode">Modalità scura</string>
<string name="settings_version">Versione 1.0.0</string>
<string name="settings_about">Informazioni</string>
<string name="settings_contact_support">Contatta supporto</string>
<string name="settings_support_me">Supportami</string>
<string name="settings_rate_app">Valuta l\'app</string>
<string name="settings_version">Versione</string>
<string name="cd_back">Indietro</string>
</resources>

8 changes: 7 additions & 1 deletion feature/settings/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
<!-- Settings -->
<string name="settings_title">Settings</string>
<string name="settings_dark_mode">Dark Mode</string>
<string name="settings_version">Version 1.0.0</string>

<!-- About -->
<string name="settings_about">About</string>
<string name="settings_contact_support">Contact Support</string>
<string name="settings_support_me">Support me</string>
<string name="settings_rate_app">Rate the app</string>
<string name="settings_version">Version</string>
Comment on lines +9 to +12
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization is inconsistent with the other Settings strings (e.g., "Dark Mode", "Contact Support" are title case). Update this string to match the established casing.

Copilot uses AI. Check for mistakes.

<!-- Content Descriptions -->
<string name="cd_back">Back</string>
Expand Down
Loading