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
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -254,7 +255,7 @@ private fun SettingsContentView(
ListItem(
headlineContent = {
Text(
stringResource(R.string.information),
stringResource(R.string.support),
style = MaterialTheme.typography.titleMedium,
)
},
Expand All @@ -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,
)
},
Expand All @@ -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),
),
)
},
Expand All @@ -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()
Expand All @@ -344,82 +346,75 @@ 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()
}
item {
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()
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,14 @@
<string name="dark_mode_preference">Dark Mode Preference</string>
<string name="my_account">My Account</string>
<string name="profile">Profile</string>
<string name="information">Information</string>
<string name="support">Support</string>
<string name="about">About</string>
<string name="app_section">App</string>
<string name="version">Version</string>
<string name="website">Website</string>
<string name="how_to_use">How To Use</string>
<string name="support_website">Support Website</string>
<string name="faqs">FAQs</string>
<string name="discussions">Discussions</string>
<string name="rate_app">Rate or Review the App</string>
<string name="contact">Contact</string>
<string name="email_app_is_not_found">Email app is not found.</string>
Expand Down
Loading