From 127cdc196dffe7d6a5bad8e826dd1ad004523d6b Mon Sep 17 00:00:00 2001 From: DatLag Date: Sat, 9 Mar 2024 18:43:17 +0100 Subject: [PATCH] updated content --- .../home/component/DeviceContent.android.kt | 34 +++++++++++++++++-- .../burningseries/shared/other/Constants.kt | 5 +++ .../commonMain/resources/MR/base/strings.xml | 2 ++ .../commonMain/resources/MR/de/strings.xml | 2 ++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Constants.kt diff --git a/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/home/component/DeviceContent.android.kt b/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/home/component/DeviceContent.android.kt index 6ddcf11b..73656fdf 100644 --- a/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/home/component/DeviceContent.android.kt +++ b/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/home/component/DeviceContent.android.kt @@ -15,6 +15,7 @@ import dev.datlag.burningseries.shared.SharedRes import dev.datlag.burningseries.shared.common.header import dev.datlag.burningseries.shared.common.lifecycle.collectAsStateWithLifecycle import dev.datlag.burningseries.shared.common.openInBrowser +import dev.datlag.burningseries.shared.other.Constants import dev.icerock.moko.resources.compose.painterResource import dev.icerock.moko.resources.compose.stringResource import kotlinx.coroutines.flow.StateFlow @@ -59,8 +60,37 @@ actual fun LazyGridScope.DeviceContent(release: StateFlow, onDeviceRea Text(text = stringResource(SharedRes.strings.github)) } } - } else if (!reachable) { - Text(text = stringResource(SharedRes.strings.enable_custom_dns)) + } else { + val context = LocalContext.current + + Card( + modifier = Modifier.fillMaxWidth(), + onClick = { + Constants.GOOGLE_PLAY_PULZ.openInBrowser(context) + }, + colors = CardDefaults.cardColors( + containerColor = MaterialTheme.colorScheme.primary, + contentColor = MaterialTheme.colorScheme.onPrimary, + ) + ) { + Row( + modifier = Modifier.fillMaxWidth().padding(16.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + Text( + modifier = Modifier.weight(1F), + text = stringResource(SharedRes.strings.google_play_pulz) + ) + FilledTonalButton( + onClick = { + Constants.GOOGLE_PLAY_PULZ.openInBrowser(context) + } + ) { + Text(text = stringResource(SharedRes.strings.yes)) + } + } + } } } } \ No newline at end of file diff --git a/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Constants.kt b/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Constants.kt new file mode 100644 index 00000000..05c19ad0 --- /dev/null +++ b/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Constants.kt @@ -0,0 +1,5 @@ +package dev.datlag.burningseries.shared.other + +data object Constants { + const val GOOGLE_PLAY_PULZ = "https://play.google.com/store/apps/details?id=dev.datlag.pulz" +} \ No newline at end of file diff --git a/app/shared/src/commonMain/resources/MR/base/strings.xml b/app/shared/src/commonMain/resources/MR/base/strings.xml index c08c731e..8d135874 100644 --- a/app/shared/src/commonMain/resources/MR/base/strings.xml +++ b/app/shared/src/commonMain/resources/MR/base/strings.xml @@ -74,4 +74,6 @@ Unmuted Loading series You should set a custom DNS to make sure you can access all features. + Are you interested in Gaming or E-Sports? + Yes \ No newline at end of file diff --git a/app/shared/src/commonMain/resources/MR/de/strings.xml b/app/shared/src/commonMain/resources/MR/de/strings.xml index 63bbf8e1..04d04984 100644 --- a/app/shared/src/commonMain/resources/MR/de/strings.xml +++ b/app/shared/src/commonMain/resources/MR/de/strings.xml @@ -74,4 +74,6 @@ Nicht stumm Lade Serie Du solltest einen DNS-Server einrichten, um alle Funktionen zuverlässig nutzen zu können. + Bist du an Gaming oder E-Sport interessiert? + Ja \ No newline at end of file