mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-06 02:40:58 +01:00
Show overlay for extra items (#1320)
## Description Shows the overlay (watched, progress bar) for extras appearing as single items. Grouped extras individually show the overlay when clicking into. If all of the grouped are played, the group is show with the watched indicator. Also very slightly optimizations the UI by offloading the title/subtitle/imageUrl to object creation time instead of when they're shown on screen. ### Related issues Closes #1311 ### Testing Shield testing with different extras ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
8cf99900e5
commit
5571654a22
3 changed files with 69 additions and 42 deletions
|
|
@ -15,7 +15,11 @@ sealed interface ExtrasItem {
|
|||
val parentId: UUID
|
||||
val type: ExtraType
|
||||
val destination: Destination
|
||||
val title: String?
|
||||
val imageUrl: String?
|
||||
val title: String
|
||||
val subtitle: String?
|
||||
val isPlayed: Boolean
|
||||
val playedPercentage: Double
|
||||
|
||||
/**
|
||||
* Represents multiple extras of the same type
|
||||
|
|
@ -24,11 +28,16 @@ sealed interface ExtrasItem {
|
|||
override val parentId: UUID,
|
||||
override val type: ExtraType,
|
||||
val items: List<BaseItem>,
|
||||
override val imageUrl: String?,
|
||||
override val title: String,
|
||||
override val subtitle: String,
|
||||
override val isPlayed: Boolean,
|
||||
) : ExtrasItem {
|
||||
override val destination: Destination =
|
||||
Destination.ItemGrid(null, type.stringRes, items.map { it.id })
|
||||
|
||||
override val title: String? = null
|
||||
override val playedPercentage
|
||||
get() = -1.0
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -38,12 +47,18 @@ sealed interface ExtrasItem {
|
|||
override val parentId: UUID,
|
||||
override val type: ExtraType,
|
||||
val item: BaseItem,
|
||||
override val imageUrl: String?,
|
||||
override val title: String,
|
||||
override val subtitle: String?,
|
||||
) : ExtrasItem {
|
||||
override val destination: Destination =
|
||||
Destination.Playback(
|
||||
item = item,
|
||||
)
|
||||
override val title: String? get() = item.title
|
||||
override val isPlayed: Boolean
|
||||
get() = item.played
|
||||
override val playedPercentage
|
||||
get() = item.data.userData?.playedPercentage ?: 0.0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue