Add About section to Settings; bump version to 1.0.1#9
Conversation
… and Version rows; bump version to 1.0.1 Agent-Logs-Url: https://github.com/benju69/Tasks/sessions/dcee19e7-1a70-4b30-a438-e9a119ccf90e Co-authored-by: benju69 <2486590+benju69@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds an About section to the Settings screen with support links and a dynamically-resolved app version, and bumps the app version to 1.0.1.
Changes:
- Adds “About” section rows for Contact Support, Support me, and Version in
SettingsScreen. - Updates localized string resources (en/fr/de/es/it) to support the new About section and makes
settings_versionlabel-only. - Bumps
versionCodeandversionNamein the app Gradle config.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| feature/settings/src/main/res/values/strings.xml | Adds About-section strings and changes version string to a label. |
| feature/settings/src/main/res/values-it/strings.xml | Adds About-section strings and changes version string to a label (IT). |
| feature/settings/src/main/res/values-fr/strings.xml | Adds About-section strings and changes version string to a label (FR). |
| feature/settings/src/main/res/values-es/strings.xml | Adds About-section strings and changes version string to a label (ES). |
| feature/settings/src/main/res/values-de/strings.xml | Adds About-section strings and changes version string to a label (DE). |
| feature/settings/src/main/java/fr/benju/tasks/feature/settings/SettingsScreen.kt | Implements About section UI, external intents, and dynamic version lookup. |
| app/build.gradle.kts | Bumps app version to 1.0.1 / versionCode 2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val intent = Intent(Intent.ACTION_SENDTO).apply { | ||
| data = Uri.parse("mailto:begonin@gmail.com") | ||
| } |
There was a problem hiding this comment.
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).
| .clickable { | ||
| val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://benju.fr/support.html")) | ||
| runCatching { context.startActivity(intent) } |
There was a problem hiding this comment.
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.
| val versionName = runCatching { | ||
| context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty() | ||
| }.getOrDefault("") |
There was a problem hiding this comment.
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).
| style = MaterialTheme.typography.bodyMedium | ||
| ) | ||
| val versionName = runCatching { | ||
| context.packageManager.getPackageInfo(context.packageName, 0).versionName.orEmpty() |
There was a problem hiding this comment.
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.
| 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() | |
| } |
| <string name="settings_contact_support">Contact Support</string> | ||
| <string name="settings_support_me">Support me</string> | ||
| <string name="settings_version">Version</string> |
There was a problem hiding this comment.
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.
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clickable { | ||
| val intent = Intent(Intent.ACTION_SENDTO).apply { | ||
| data = Uri.parse("mailto:begonin@gmail.com") | ||
| } | ||
| runCatching { context.startActivity(intent) } | ||
| } | ||
| .padding(vertical = 12.dp), |
There was a problem hiding this comment.
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.
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .clickable { | ||
| val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://benju.fr/support.html")) | ||
| runCatching { context.startActivity(intent) } | ||
| } | ||
| .padding(vertical = 12.dp), | ||
| verticalAlignment = Alignment.CenterVertically |
There was a problem hiding this comment.
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).
📦 Debug APK ready |
Settings screen lacked any app info or support contact. Adds an About section below the existing Dark Mode toggle with three rows.
Changes
feature/settingsACTION_SENDTO→mailto:begonin@gmail.comACTION_VIEW→https://benju.fr/support.htmlPackageManagerrather than hardcodedgetPackageInfowrapped inrunCatchingto handle missing app/browser gracefullysettings_versionreduced to label-onlyapp/build.gradle.ktsversionCode1 → 2,versionName1.0.0→1.0.1