From bc6be3a7606cd597c57484d08001f5fef0957484 Mon Sep 17 00:00:00 2001 From: DatLag Date: Tue, 28 May 2024 18:52:35 +0200 Subject: [PATCH] display AniFlowCard --- .../series/component/AniFlowCard.android.kt | 58 +++++++++---------- .../burningseries/shared/other/Project.kt | 2 +- gradle/libs.versions.toml | 2 +- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/series/component/AniFlowCard.android.kt b/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/series/component/AniFlowCard.android.kt index efd7d8ba..f490bf5b 100644 --- a/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/series/component/AniFlowCard.android.kt +++ b/app/shared/src/androidMain/kotlin/dev/datlag/burningseries/shared/ui/screen/initial/series/component/AniFlowCard.android.kt @@ -38,40 +38,38 @@ actual fun AniFlowCard( val project = Project.AniFlow if (!context.isPackageInstalled(project.`package`)) { - if (!project.googlePlay.isNullOrBlank()) { - val anime by isAnime.collectAsStateWithLifecycle() + val anime by isAnime.collectAsStateWithLifecycle() - if (anime) { - val uriHandler = LocalUriHandler.current + if (anime) { + val uriHandler = LocalUriHandler.current - Card( - modifier = modifier, - onClick = { - uriHandler.openUri(project.googlePlay ?: project.github) - } + Card( + modifier = modifier, + onClick = { + uriHandler.openUri(project.googlePlay ?: project.github) + } + ) { + Row( + modifier = Modifier.fillMaxWidth().padding(16.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(16.dp) ) { - Row( - modifier = Modifier.fillMaxWidth().padding(16.dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.spacedBy(16.dp) + project.icon?.let { + Image( + modifier = Modifier.size(48.dp).clip(MaterialTheme.shapes.medium), + painter = painterResource(it), + contentDescription = stringResource(project.title), + ) + } + Column( + verticalArrangement = Arrangement.spacedBy(8.dp) ) { - project.icon?.let { - Image( - modifier = Modifier.size(48.dp).clip(MaterialTheme.shapes.medium), - painter = painterResource(it), - contentDescription = stringResource(project.title), - ) - } - Column( - verticalArrangement = Arrangement.spacedBy(8.dp) - ) { - Text( - text = stringResource(project.title), - fontWeight = FontWeight.Bold, - style = MaterialTheme.typography.titleLarge - ) - Text(text = stringResource(project.subTitle)) - } + Text( + text = stringResource(project.title), + fontWeight = FontWeight.Bold, + style = MaterialTheme.typography.titleLarge + ) + Text(text = stringResource(project.subTitle)) } } } diff --git a/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Project.kt b/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Project.kt index 45a7085c..f70fdfaa 100644 --- a/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Project.kt +++ b/app/shared/src/commonMain/kotlin/dev/datlag/burningseries/shared/other/Project.kt @@ -29,7 +29,7 @@ sealed interface Project { override val title: StringResource = SharedRes.strings.aniflow override val subTitle: StringResource = SharedRes.strings.aniflow_subtitle override val `package`: String = "dev.datlag.aniflow" - override val googlePlay: String? = null + override val googlePlay: String = "https://play.google.com/store/apps/details?id=$`package`" override val github: String = "https://github.com/DatL4g/AniFlow" } } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1f111f0c..97003232 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -app = "5.5.0" +app = "5.5.1" aboutlibraries = "11.1.4" accompanist = "0.34.0" activity = "1.9.0"