diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreen.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreen.kt index 9f60158..5c7a2e6 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreen.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/MediumScreen.kt @@ -154,6 +154,7 @@ fun MediumScreen(component: MediumComponent) { episodesFlow = component.episodes, durationFlow = component.duration, statusFlow = component.status, + isAdultFlow = component.isAdult, modifier = Modifier.fillParentMaxWidth().padding(horizontal = 16.dp) ) } diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/CoverSection.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/CoverSection.kt index 4305a19..a3b3fbf 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/CoverSection.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/CoverSection.kt @@ -3,6 +3,7 @@ package dev.datlag.aniflow.ui.navigation.screen.medium.component import androidx.compose.foundation.layout.* import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.List +import androidx.compose.material.icons.filled.NoAdultContent import androidx.compose.material.icons.filled.OndemandVideo import androidx.compose.material.icons.filled.RssFeed import androidx.compose.material.icons.filled.Timelapse @@ -17,6 +18,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.unit.dp import coil3.compose.AsyncImage import coil3.compose.rememberAsyncImagePainter +import dev.datlag.aniflow.SharedRes import dev.datlag.aniflow.anilist.model.Medium import dev.datlag.aniflow.anilist.type.MediaFormat import dev.datlag.aniflow.anilist.type.MediaStatus @@ -35,6 +37,7 @@ fun CoverSection( episodesFlow: Flow, durationFlow: Flow, statusFlow: Flow, + isAdultFlow: Flow, modifier: Modifier = Modifier ) { Row( @@ -84,6 +87,7 @@ fun CoverSection( val episodes by episodesFlow.collectAsStateWithLifecycle(initialMedium.episodes) val duration by durationFlow.collectAsStateWithLifecycle(initialMedium.avgEpisodeDurationInMin) val status by statusFlow.collectAsStateWithLifecycle(initialMedium.status) + val isAdult by isAdultFlow.collectAsStateWithLifecycle(initialMedium.isAdult) Row( modifier = Modifier.fillMaxWidth(), @@ -96,6 +100,19 @@ fun CoverSection( ) Text(text = stringResource(format.text())) } + if (isAdult) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + Icon( + imageVector = Icons.Default.NoAdultContent, + contentDescription = null + ) + Text(text = stringResource(SharedRes.strings.explicit)) + } + } if (episodes > -1) { Row( modifier = Modifier.fillMaxWidth(), diff --git a/composeApp/src/commonMain/moko-resources/base/strings.xml b/composeApp/src/commonMain/moko-resources/base/strings.xml index d329de8..8bb1f5d 100644 --- a/composeApp/src/commonMain/moko-resources/base/strings.xml +++ b/composeApp/src/commonMain/moko-resources/base/strings.xml @@ -54,4 +54,5 @@ Romaji (Western Order) Romaji Native + Explicit