Skip to content

Commit

Permalink
display AniFlowCard
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed May 28, 2024
1 parent b089c32 commit bc6be3a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit bc6be3a

Please sign in to comment.