From 5048cdfc649afb540730db2c3e9229592a8f3ad5 Mon Sep 17 00:00:00 2001 From: dadachi Date: Sun, 5 Apr 2026 09:58:54 +0900 Subject: [PATCH] Add app version and reorganize settings sections Split Information section into Support, About, and App sections. Add icons to About items. Move Website to About. Display app version. Remove Discussions link. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../nativeapptemplatefree/NatConstants.kt | 1 - .../ui/settings/SettingsView.kt | 157 ++++++++++++------ app/src/main/res/values/strings.xml | 7 +- 3 files changed, 108 insertions(+), 57 deletions(-) diff --git a/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/NatConstants.kt b/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/NatConstants.kt index c5762b0..74b01ef 100644 --- a/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/NatConstants.kt +++ b/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/NatConstants.kt @@ -8,7 +8,6 @@ object NatConstants { const val HOW_TO_USE_URL: String = "https://myturntag.com/how" const val SUPPORT_WEBSITE_URL: String = "https://nativeapptemplate.com" const val FAQS_URL: String = "https://nativeapptemplate.com/faqs" - const val DISCUSSIONS_URL: String = "https://github.com/nativeapptemplate/NativeAppTemplate-Free-Android/discussions" const val PRIVACY_POLICY_URL: String = "https://nativeapptemplate.com/privacy" const val TERMS_OF_USE_URL: String = "https://nativeapptemplate.com/terms" diff --git a/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/ui/settings/SettingsView.kt b/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/ui/settings/SettingsView.kt index 68dac0d..880d8c1 100644 --- a/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/ui/settings/SettingsView.kt +++ b/app/src/main/kotlin/com/nativeapptemplate/nativeapptemplatefree/ui/settings/SettingsView.kt @@ -6,13 +6,14 @@ import android.net.Uri import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.outlined.Forum import androidx.compose.material.icons.outlined.Info import androidx.compose.material.icons.outlined.Key import androidx.compose.material.icons.outlined.Language @@ -254,7 +255,7 @@ private fun SettingsContentView( ListItem( headlineContent = { Text( - stringResource(R.string.information), + stringResource(R.string.support), style = MaterialTheme.typography.titleMedium, ) }, @@ -265,15 +266,15 @@ private fun SettingsContentView( ListItem( headlineContent = { Text( - stringResource(R.string.support_website), + stringResource(R.string.how_to_use), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, leadingContent = { Icon( - Icons.Outlined.Language, - contentDescription = stringResource(R.string.support_website), + Icons.Outlined.Info, + contentDescription = stringResource(R.string.how_to_use), tint = MaterialTheme.colorScheme.onSurfaceVariant, ) }, @@ -282,7 +283,7 @@ private fun SettingsContentView( context.startActivity( Intent( Intent.ACTION_VIEW, - Uri.parse(NatConstants.SUPPORT_WEBSITE_URL), + Uri.parse(NatConstants.HOW_TO_USE_URL), ), ) }, @@ -293,49 +294,50 @@ private fun SettingsContentView( ListItem( headlineContent = { Text( - stringResource(R.string.how_to_use), + stringResource(R.string.faqs), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, leadingContent = { Icon( - Icons.Outlined.Info, - contentDescription = stringResource(R.string.how_to_use), + Icons.Outlined.QuestionMark, + contentDescription = stringResource(R.string.faqs), tint = MaterialTheme.colorScheme.onSurfaceVariant, ) }, modifier = Modifier .clickable { - context.startActivity( - Intent( - Intent.ACTION_VIEW, - Uri.parse(NatConstants.HOW_TO_USE_URL), - ), - ) + context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(NatConstants.FAQS_URL))) }, ) HorizontalDivider() } item { + val emailAppNotFoundMessage = stringResource(R.string.email_app_is_not_found) + ListItem( headlineContent = { Text( - stringResource(R.string.faqs), + stringResource(R.string.contact), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, leadingContent = { Icon( - Icons.Outlined.QuestionMark, - contentDescription = stringResource(R.string.faqs), + Icons.Outlined.Mail, + contentDescription = stringResource(R.string.contact), tint = MaterialTheme.colorScheme.onSurfaceVariant, ) }, modifier = Modifier .clickable { - context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(NatConstants.FAQS_URL))) + try { + Utility.sendContactMail(context) + } catch (exception: ActivityNotFoundException) { + viewModel.updateMessage(emailAppNotFoundMessage) + } }, ) HorizontalDivider() @@ -344,56 +346,48 @@ private fun SettingsContentView( ListItem( headlineContent = { Text( - stringResource(R.string.discussions), + stringResource(R.string.rate_app), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, leadingContent = { Icon( - Icons.Outlined.Forum, - contentDescription = stringResource(R.string.discussions), + Icons.Outlined.ThumbUp, + contentDescription = stringResource(R.string.rate_app), tint = MaterialTheme.colorScheme.onSurfaceVariant, ) }, modifier = Modifier .clickable { - context.startActivity( - Intent( - Intent.ACTION_VIEW, - Uri.parse(NatConstants.DISCUSSIONS_URL), - ), - ) + try { + context.startActivity(Intent(Intent.ACTION_VIEW, Utility.marketUri())) + } catch (e: ActivityNotFoundException) { + context.startActivity(Intent(Intent.ACTION_VIEW, Utility.googlePlayStoreUri())) + } }, ) - HorizontalDivider() } - item { - val emailAppNotFoundMessage = stringResource(R.string.email_app_is_not_found) + item { ListItem( headlineContent = { Text( - stringResource(R.string.contact), + "", style = MaterialTheme.typography.titleMedium, - color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, - leadingContent = { - Icon( - Icons.Outlined.Mail, - contentDescription = stringResource(R.string.contact), - tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + + item { + ListItem( + headlineContent = { + Text( + stringResource(R.string.about), + style = MaterialTheme.typography.titleMedium, ) }, - modifier = Modifier - .clickable { - try { - Utility.sendContactMail(context) - } catch (exception: ActivityNotFoundException) { - viewModel.updateMessage(emailAppNotFoundMessage) - } - }, ) HorizontalDivider() } @@ -401,25 +395,26 @@ private fun SettingsContentView( ListItem( headlineContent = { Text( - stringResource(R.string.rate_app), + stringResource(R.string.website), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, leadingContent = { Icon( - Icons.Outlined.ThumbUp, - contentDescription = stringResource(R.string.rate_app), + Icons.Outlined.Language, + contentDescription = stringResource(R.string.website), tint = MaterialTheme.colorScheme.onSurfaceVariant, ) }, modifier = Modifier .clickable { - try { - context.startActivity(Intent(Intent.ACTION_VIEW, Utility.marketUri())) - } catch (e: ActivityNotFoundException) { - context.startActivity(Intent(Intent.ACTION_VIEW, Utility.googlePlayStoreUri())) - } + context.startActivity( + Intent( + Intent.ACTION_VIEW, + Uri.parse(NatConstants.SUPPORT_WEBSITE_URL), + ), + ) }, ) HorizontalDivider() @@ -433,6 +428,13 @@ private fun SettingsContentView( color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, + leadingContent = { + Icon( + Icons.Outlined.Info, + contentDescription = stringResource(R.string.privacy_policy), + tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + }, modifier = Modifier .clickable { context.startActivity( @@ -454,6 +456,13 @@ private fun SettingsContentView( color = MaterialTheme.colorScheme.onPrimaryContainer, ) }, + leadingContent = { + Icon( + Icons.Outlined.Info, + contentDescription = stringResource(R.string.terms_of_use), + tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + }, modifier = Modifier .clickable { context.startActivity( @@ -464,8 +473,48 @@ private fun SettingsContentView( ) }, ) + } + + item { + ListItem( + headlineContent = { + Text( + "", + style = MaterialTheme.typography.titleMedium, + ) + }, + ) + } + + item { + ListItem( + headlineContent = { + Text( + stringResource(R.string.app_section), + style = MaterialTheme.typography.titleMedium, + ) + }, + ) HorizontalDivider() } + item { + ListItem( + headlineContent = { + Row { + Text( + stringResource(R.string.version), + style = MaterialTheme.typography.titleMedium, + ) + Spacer(modifier = Modifier.weight(1f)) + Text( + "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", + style = MaterialTheme.typography.titleMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + }, + ) + } item { Column( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 167ed36..67ea8cf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -159,11 +159,14 @@ Dark Mode Preference My Account Profile - Information + Support + About + App + Version + Website How To Use Support Website FAQs - Discussions Rate or Review the App Contact Email app is not found.