feat: show libraryColored by default on all list/grid

This commit is contained in:
Cuong-Tran 2024-07-22 11:36:49 +07:00 committed by Tran M. Cuong
parent 4c4c6ae292
commit afbb4b70b1
4 changed files with 9 additions and 18 deletions

View file

@ -81,12 +81,12 @@ fun MangaCompactGridItem(
coverBadgeStart: @Composable (RowScope.() -> Unit)? = null, coverBadgeStart: @Composable (RowScope.() -> Unit)? = null,
coverBadgeEnd: @Composable (RowScope.() -> Unit)? = null, coverBadgeEnd: @Composable (RowScope.() -> Unit)? = null,
// KMK --> // KMK -->
libraryColored: Boolean? = null, libraryColored: Boolean = true,
// KMK <-- // KMK <--
) { ) {
// KMK --> // KMK -->
val bgColor = libraryColored?.let { coverData.dominantCoverColors?.first?.let { Color(it) } } val bgColor = coverData.dominantCoverColors?.first?.let { Color(it) }.takeIf { libraryColored }
val onBgColor = libraryColored?.let { coverData.dominantCoverColors?.second } val onBgColor = coverData.dominantCoverColors?.second.takeIf { libraryColored }
// KMK <-- // KMK <--
GridItemSelectable( GridItemSelectable(
isSelected = isSelected, isSelected = isSelected,
@ -212,12 +212,12 @@ fun MangaComfortableGridItem(
coverBadgeEnd: (@Composable RowScope.() -> Unit)? = null, coverBadgeEnd: (@Composable RowScope.() -> Unit)? = null,
onClickContinueReading: (() -> Unit)? = null, onClickContinueReading: (() -> Unit)? = null,
// KMK --> // KMK -->
libraryColored: Boolean? = null, libraryColored: Boolean = true,
// KMK <-- // KMK <--
) { ) {
// KMK --> // KMK -->
val bgColor = libraryColored?.let { coverData.dominantCoverColors?.first?.let { Color(it) } } val bgColor = coverData.dominantCoverColors?.first?.let { Color(it) }.takeIf { libraryColored }
val onBgColor = libraryColored?.let { coverData.dominantCoverColors?.second } val onBgColor = coverData.dominantCoverColors?.second.takeIf { libraryColored }
// KMK <-- // KMK <--
GridItemSelectable( GridItemSelectable(
isSelected = isSelected, isSelected = isSelected,
@ -390,12 +390,12 @@ fun MangaListItem(
coverAlpha: Float = 1f, coverAlpha: Float = 1f,
onClickContinueReading: (() -> Unit)? = null, onClickContinueReading: (() -> Unit)? = null,
// KMK --> // KMK -->
libraryColored: Boolean? = null, libraryColored: Boolean = true,
// KMK <-- // KMK <--
) { ) {
// KMK --> // KMK -->
val bgColor = libraryColored?.let { coverData.dominantCoverColors?.first?.let { Color(it) } } val bgColor = coverData.dominantCoverColors?.first?.let { Color(it) }.takeIf { libraryColored }
val onBgColor = libraryColored?.let { coverData.dominantCoverColors?.second } val onBgColor = coverData.dominantCoverColors?.second.takeIf { libraryColored }
// KMK <-- // KMK <--
Row( Row(
modifier = Modifier modifier = Modifier

View file

@ -61,9 +61,6 @@ internal fun LibraryComfortableGrid(
} else { } else {
null null
}, },
// KMK -->
libraryColored = true,
// KMK <--
) )
} }
} }

View file

@ -62,9 +62,6 @@ internal fun LibraryCompactGrid(
} else { } else {
null null
}, },
// KMK -->
libraryColored = true,
// KMK <--
) )
} }
} }

View file

@ -69,9 +69,6 @@ internal fun LibraryList(
} else { } else {
null null
}, },
// KMK -->
libraryColored = true,
// KMK <--
) )
} }
} }