mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Add logo to playback overlay (#172)
## Details Adds the logo (if available) to the upper left corner of the playback controls overlay. I am still experimenting with how logos can be used on the details pages. It's problematic because of the variety of colors, eg dark logos can be hard to see on the dark background. ## Issues Related to #92 ## Screenshot <img width="1280" height="771" alt="logo_playback Large" src="https://github.com/user-attachments/assets/c6cb43fe-f3bc-42a4-9ef4-0397267e3073" />
This commit is contained in:
parent
0d148e2556
commit
a9f2e684f1
2 changed files with 29 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ data class BaseItem(
|
|||
val data: BaseItemDto,
|
||||
val imageUrl: String?,
|
||||
val backdropImageUrl: String? = null,
|
||||
val logoImageUrl: String? = null,
|
||||
) {
|
||||
val id get() = data.id
|
||||
|
||||
|
|
@ -109,10 +110,22 @@ data class BaseItem(
|
|||
} else {
|
||||
api.imageApi.getItemImageUrl(dto.id, ImageType.PRIMARY)
|
||||
}
|
||||
val logoImageUrl =
|
||||
if (useSeriesForPrimary && (dto.type == BaseItemKind.EPISODE || dto.type == BaseItemKind.SEASON)) {
|
||||
val seriesId = dto.seriesId
|
||||
if (seriesId != null) {
|
||||
api.imageApi.getItemImageUrl(seriesId, ImageType.LOGO)
|
||||
} else {
|
||||
api.imageApi.getItemImageUrl(dto.id, ImageType.LOGO)
|
||||
}
|
||||
} else {
|
||||
api.imageApi.getItemImageUrl(dto.id, ImageType.LOGO)
|
||||
}
|
||||
return BaseItem(
|
||||
dto,
|
||||
primaryImageUrl,
|
||||
backdropImageUrl,
|
||||
logoImageUrl,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import androidx.compose.ui.unit.sp
|
|||
import androidx.media3.common.Player
|
||||
import androidx.tv.material3.MaterialTheme
|
||||
import androidx.tv.material3.Text
|
||||
import coil3.compose.AsyncImage
|
||||
import com.github.damontecres.wholphin.R
|
||||
import com.github.damontecres.wholphin.data.model.BaseItem
|
||||
import com.github.damontecres.wholphin.data.model.Chapter
|
||||
|
|
@ -395,6 +396,21 @@ fun PlaybackOverlay(
|
|||
}
|
||||
}
|
||||
}
|
||||
AnimatedVisibility(
|
||||
!showDebugInfo && item?.logoImageUrl.isNotNullOrBlank() && controllerViewState.controlsVisible,
|
||||
modifier =
|
||||
Modifier
|
||||
.align(Alignment.TopStart),
|
||||
) {
|
||||
AsyncImage(
|
||||
model = item?.logoImageUrl,
|
||||
contentDescription = "Logo",
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth(.33f)
|
||||
.padding(32.dp),
|
||||
)
|
||||
}
|
||||
AnimatedVisibility(
|
||||
showDebugInfo && controllerViewState.controlsVisible,
|
||||
modifier =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue