diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/common/ExtendMedium.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/common/ExtendMedium.kt index d3c25b6..5ac71a9 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/common/ExtendMedium.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/common/ExtendMedium.kt @@ -179,4 +179,9 @@ fun MediaListStatus.stringRes(isManga: Boolean) = when (this) { else -> SharedRes.strings.add } -fun MediaListStatus.stringRes(type: MediaType) = this.stringRes(type == MediaType.MANGA) \ No newline at end of file +fun MediaListStatus.stringRes(type: MediaType) = this.stringRes(type == MediaType.MANGA) + +fun MediaType.stringRes() = when (this) { + MediaType.MANGA -> SharedRes.strings.manga + else -> SharedRes.strings.anime +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/CharacterSection.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/CharacterSection.kt index e50f70e..4b248b2 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/CharacterSection.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/CharacterSection.kt @@ -17,6 +17,8 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import com.maxkeppeker.sheets.core.models.base.Header +import com.maxkeppeker.sheets.core.models.base.IconSource import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState import com.maxkeppeler.sheets.option.OptionDialog import com.maxkeppeler.sheets.option.models.DisplayMode @@ -56,6 +58,10 @@ fun CharacterSection( ), config = OptionConfig( mode = DisplayMode.LIST, + ), + header = Header.Default( + icon = IconSource(imageVector = Icons.Filled.PersonPin), + title = stringResource(SharedRes.strings.char_language) ) ) diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/ColorSection.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/ColorSection.kt index 83fe271..2dd4563 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/ColorSection.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/ColorSection.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import com.maxkeppeker.sheets.core.models.base.Header import com.maxkeppeker.sheets.core.models.base.IconSource import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState import com.maxkeppeler.sheets.option.OptionDialog @@ -79,6 +80,13 @@ fun ColorSection( config = OptionConfig( mode = DisplayMode.GRID_VERTICAL, gridColumns = 4 + ), + header = Header.Default( + icon = IconSource( + imageVector = Icons.Filled.Circle, + tint = MaterialTheme.colorScheme.primary + ), + title = stringResource(SharedRes.strings.profile_color) ) ) diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/TitleSection.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/TitleSection.kt index f92012f..360436f 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/TitleSection.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/home/dialog/settings/component/TitleSection.kt @@ -17,6 +17,8 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import com.maxkeppeker.sheets.core.models.base.Header +import com.maxkeppeker.sheets.core.models.base.IconSource import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState import com.maxkeppeler.sheets.option.OptionDialog import com.maxkeppeler.sheets.option.models.DisplayMode @@ -56,6 +58,10 @@ fun TitleSection( ), config = OptionConfig( mode = DisplayMode.LIST, + ), + header = Header.Default( + icon = IconSource(imageVector = Icons.Rounded.Title), + title = stringResource(SharedRes.strings.title_language), ) ) diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/FABContent.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/FABContent.kt index 6431639..edd830b 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/FABContent.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/FABContent.kt @@ -85,6 +85,7 @@ fun FABContent( RatingDialog( state = ratingState, initialValue = rating, + type = type, onRating = { component.rate(it) } diff --git a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/RatingDialog.kt b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/RatingDialog.kt index 62b61b9..95a962d 100644 --- a/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/RatingDialog.kt +++ b/composeApp/src/commonMain/kotlin/dev/datlag/aniflow/ui/navigation/screen/medium/component/RatingDialog.kt @@ -10,6 +10,10 @@ import com.maxkeppeker.sheets.core.models.base.UseCaseState import com.maxkeppeler.sheets.rating.models.RatingBody import com.maxkeppeler.sheets.rating.models.RatingConfig import com.maxkeppeler.sheets.rating.models.RatingSelection +import dev.datlag.aniflow.SharedRes +import dev.datlag.aniflow.anilist.type.MediaType +import dev.datlag.aniflow.common.stringRes +import dev.icerock.moko.resources.compose.stringResource import io.github.aakira.napier.Napier @OptIn(ExperimentalMaterial3Api::class) @@ -17,6 +21,7 @@ import io.github.aakira.napier.Napier fun RatingDialog( state: UseCaseState, initialValue: Int, + type: MediaType, onRating: (Int) -> Unit, ) { com.maxkeppeler.sheets.rating.RatingDialog( @@ -31,10 +36,12 @@ fun RatingDialog( onRating(rating) } ), - body = RatingBody.Custom(body = { }), + body = RatingBody.Default( + bodyText = stringResource(SharedRes.strings.rating_text, stringResource(type.stringRes())) + ), header = Header.Default( icon = IconSource(imageVector = Icons.Rounded.Star), - title = "Rating" + title = stringResource(SharedRes.strings.rating) ) ) } \ No newline at end of file diff --git a/composeApp/src/commonMain/moko-resources/base/strings.xml b/composeApp/src/commonMain/moko-resources/base/strings.xml index d865e07..bc1b38d 100644 --- a/composeApp/src/commonMain/moko-resources/base/strings.xml +++ b/composeApp/src/commonMain/moko-resources/base/strings.xml @@ -84,4 +84,8 @@ Polar Patreon Sponsor + Rating + Rate this %s between 0-5 + Anime + Manga