mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-18 16:01:44 +00:00
add watched badge to catalog screen
This commit is contained in:
parent
7be85691ed
commit
03e4dd3809
1 changed files with 15 additions and 0 deletions
|
|
@ -58,6 +58,8 @@ import com.nuvio.app.features.home.HomeCatalogSettingsRepository
|
|||
import com.nuvio.app.features.home.PosterShape
|
||||
import com.nuvio.app.features.home.stableKey
|
||||
import com.nuvio.app.features.library.LibraryRepository
|
||||
import com.nuvio.app.features.watched.WatchedRepository
|
||||
import com.nuvio.app.features.watching.application.WatchingState
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.map
|
||||
|
|
@ -88,6 +90,7 @@ fun CatalogScreen(
|
|||
LibraryRepository.ensureLoaded()
|
||||
LibraryRepository.uiState
|
||||
}.collectAsStateWithLifecycle()
|
||||
val watchedUiState by WatchedRepository.uiState.collectAsStateWithLifecycle()
|
||||
|
||||
LaunchedEffect(manifestUrl, type, catalogId, genre, supportsPagination, homeCatalogSettingsUiState.hideUnreleasedContent) {
|
||||
CatalogRepository.load(
|
||||
|
|
@ -203,6 +206,10 @@ fun CatalogScreen(
|
|||
cornerRadiusDp = posterCardStyle.cornerRadiusDp,
|
||||
hideLabels = posterCardStyle.hideLabelsEnabled,
|
||||
isSaved = isSaved,
|
||||
isWatched = WatchingState.isPosterWatched(
|
||||
watchedKeys = watchedUiState.watchedKeys,
|
||||
item = item,
|
||||
),
|
||||
onClick = onPosterClick?.let { { it(item) } },
|
||||
)
|
||||
}
|
||||
|
|
@ -273,6 +280,7 @@ private fun CatalogPosterTile(
|
|||
item: MetaPreview,
|
||||
cornerRadiusDp: Int,
|
||||
hideLabels: Boolean,
|
||||
isWatched: Boolean = false,
|
||||
isSaved: Boolean = false,
|
||||
onClick: (() -> Unit)? = null,
|
||||
) {
|
||||
|
|
@ -296,6 +304,13 @@ private fun CatalogPosterTile(
|
|||
)
|
||||
}
|
||||
|
||||
NuvioAnimatedWatchedBadge(
|
||||
isVisible = isWatched,
|
||||
modifier = Modifier
|
||||
.align(Alignment.TopEnd)
|
||||
.padding(6.dp),
|
||||
)
|
||||
|
||||
NuvioAnimatedBookmarkedBadge(
|
||||
isVisible = isSaved,
|
||||
modifier = Modifier
|
||||
|
|
|
|||
Loading…
Reference in a new issue