You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Card badges look alike and fade into light posters — give each kind its own look
#2079
The badges in the top corners of cards — unwatched count, number of versions, episode number — all use the same translucent black plate. They look the same, so a bare number can be unwatched episodes or versions, and on light posters they nearly disappear. Seen on the official Wholphin 1.0.9 on Dune HD Homatics; before/after screenshots below.
Two more things I noticed while looking:
On collections the right number is UnplayedItemCount, not the size: "James Bond" with 26 movies shows "8". In my library 8 of 73 collections differ; it only matches until you start one.
Home page rows (they use BannerCard) never show the versions badge, and only "Continue watching" requests MediaSourceCount.
What I did — every kind gets its own shape on an opaque plate, colours from the current theme, so it works for all themes:
Badge
Look
Unwatched episodes / seasons
pill in the watched-check colour (WatchedIconBackground()), black or white text by contrast — the count and the check read as one indicator
unwatched in the watched-check colour + a stack icon (FA layer-group) with the total (ChildCount, added to SlimItemFields); not started or finished — total only, finished also gets the check
Episode
neutral plate, grey border, season dimmed; on the home page "S3 E2" instead of "E2"
Code: new ui/cards/CardBadges.kt; BannerCard takes a CornerBadge instead of cornerText: String, versions badge added there next to the favourite heart; MEDIA_SOURCE_COUNT added to HomeItemFields. Checked on NVIDIA Shield (purple theme) and Dune HD Homatics (blue); the diff applies cleanly to current main. Not checked: light themes; unit tests not run yet.
This sits next to #1518 (size / hiding of the watched check) — if you're reworking indicators anyway, happy to fit this into whatever direction you pick. Would you take it as a PR?
Screenshots (Dune HD Homatics, blue theme unless noted)
Before — official Wholphin 1.0.9, overview
After — the same screens
Before — a movie with two versions
After — versions badge
After in the purple theme — colours follow the theme
Diff
From c7fd829ba45e65a0fa204d1917ad16275f81d14a Mon Sep 17 00:00:00 2001
From: Sergey K <17836309+SergeiAK@users.noreply.github.com>
Date: Wed, 14 Oct 2026 17:48:38 +0300
Subject: [PATCH 1/2] Tell card badges apart and keep them readable over
artwork
The unwatched count, the number of versions and the episode number all
shared one translucent plate in the top corners, so they looked the same
and faded into light posters. Each kind now has its own look on an opaque
plate, with colors taken from the theme:
- unwatched count: a pill in the watched-check color, so the count and
the check read as one indicator;
- versions: a "copies" icon and the count outlined in the primary color;- collection: the unwatched part in the watched-check color next to a
stack icon with the number of items (ChildCount, now requested for
grids); nothing watched or everything watched shows the total only;
- episode: a neutral plate with the season dimmed. On the home page the
season is added, since "E5" alone does not say which one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---
.../wholphin/data/model/BaseItem.kt | 36 ++-
.../damontecres/wholphin/ui/Formatting.kt | 3 +
.../damontecres/wholphin/ui/UiConstants.kt | 2 +
.../wholphin/ui/cards/BannerCard.kt | 29 +--
.../wholphin/ui/cards/CardBadges.kt | 224 ++++++++++++++++++
.../damontecres/wholphin/ui/cards/GridCard.kt | 1 +
.../wholphin/ui/cards/ItemCardImage.kt | 47 +---
.../wholphin/ui/cards/SeasonCard.kt | 3 +
.../ui/detail/series/SeriesOverviewContent.kt | 2 +-
.../damontecres/wholphin/ui/main/HomePage.kt | 4 +-
app/src/main/res/values/fa_strings.xml | 2 +
app/src/main/res/values/strings.xml | 1 +
12 files changed, 284 insertions(+), 70 deletions(-)
create mode 100644 app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt
diff --git a/app/src/main/java/com/github/damontecres/wholphin/data/model/BaseItem.kt b/app/src/main/java/com/github/damontecres/wholphin/data/model/BaseItem.kt
index 94dc23c2..33f38d11 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/data/model/BaseItem.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/data/model/BaseItem.kt@@ -8,6 +8,7 @@ import androidx.compose.ui.text.buildAnnotatedString
import com.github.damontecres.wholphin.R
import com.github.damontecres.wholphin.WholphinApplication
import com.github.damontecres.wholphin.ui.abbreviateNumber
+import com.github.damontecres.wholphin.ui.cards.CornerBadge
import com.github.damontecres.wholphin.ui.detail.CardGridItem
import com.github.damontecres.wholphin.ui.detail.music.artistsString
import com.github.damontecres.wholphin.ui.detail.series.SeasonEpisodeIds
@@ -15,6 +16,7 @@ import com.github.damontecres.wholphin.ui.dot
import com.github.damontecres.wholphin.ui.formatDateTime
import com.github.damontecres.wholphin.ui.formatDuration
import com.github.damontecres.wholphin.ui.formatEpisodeNumber
+import com.github.damontecres.wholphin.ui.formatSeasonNumberShort
import com.github.damontecres.wholphin.ui.getDateFormatter
import com.github.damontecres.wholphin.ui.joinNotBlank
import com.github.damontecres.wholphin.ui.nav.Destination
@@ -111,27 +113,43 @@ data class BaseItem(
@Transient
val ui =
BaseItemUi(
- episodeCornerText =+ episodeCornerBadge =
if (type == BaseItemKind.EPISODE) {
- data.indexNumber?.let { formatEpisodeNumber(it) }- ?: data.premiereDate?.let(::formatDateTime)+ (+ data.indexNumber?.let { formatEpisodeNumber(it) }+ ?: data.premiereDate?.let(::formatDateTime)+ )?.let { CornerBadge.Episode(season = null, episode = it) }
} else {
null
},
- episodeUnplayedCornerText =+ episodeUnplayedCornerBadge =
when (type) {
BaseItemKind.EPISODE -> {
- data.indexNumber?.let { formatEpisodeNumber(it) }+ // Outside of its season the episode number alone does not say which one+ data.indexNumber?.let {+ CornerBadge.Episode(+ season = data.parentIndexNumber?.let(::formatSeasonNumberShort),+ episode = formatEpisodeNumber(it),+ )+ }+ }++ BaseItemKind.BOX_SET -> {+ data.childCount?.takeIf { it > 0 }?.let {+ CornerBadge.collection(data.userData?.unplayedItemCount ?: 0, it)+ } ?: data.userData+ ?.unplayedItemCount+ ?.takeIf { it > 0 }+ ?.let { CornerBadge.Unplayed(abbreviateNumber(it)) }
}
BaseItemKind.SERIES,
BaseItemKind.SEASON,
- BaseItemKind.BOX_SET,
-> {
data.userData
?.unplayedItemCount
?.takeIf { it > 0 }
- ?.let { abbreviateNumber(it) }+ ?.let { CornerBadge.Unplayed(abbreviateNumber(it)) }
}
else -> {
@@ -361,8 +379,8 @@ val BaseItemDto.alphabetSortName: String get() = sortName ?: name ?: ""
@Immutable
data class BaseItemUi(
- val episodeCornerText: String?,- val episodeUnplayedCornerText: String?,+ val episodeCornerBadge: CornerBadge?,+ val episodeUnplayedCornerBadge: CornerBadge?,
val quickDetails: QuickDetailsData,
)
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/Formatting.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/Formatting.kt
index 282c161e..b931c80a 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/Formatting.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/Formatting.kt@@ -122,6 +122,9 @@ fun formatSeasonEpisode(
/** Compact episode-only label, e.g. `E3`. */
fun formatEpisodeNumber(episode: Int): String = formatStringWithFallback(R.string.episode_number_short, "E%1\$d", episode)
+/** Compact season-only label, e.g. `S2`. */+fun formatSeasonNumberShort(season: Int): String = formatStringWithFallback(R.string.season_number_short, "S%1\$d", season)+
/** Fallback season title when the library has no season name, e.g. `Season 2`. */
fun formatSeasonNumber(season: Int): String = formatStringWithFallback(R.string.season_number, "Season %1\$d", season)
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt
index 2e57b407..e77c4a76 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt@@ -68,6 +68,8 @@ val SlimItemFields =
ItemFields.SORT_NAME,
ItemFields.MEDIA_SOURCE_COUNT,
ItemFields.CAN_DELETE,
+ // Size of a collection on its card+ ItemFields.CHILD_COUNT,
)
/**
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt
index e055e8b0..9ef15797 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt@@ -1,6 +1,5 @@
package com.github.damontecres.wholphin.ui.cards
-import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
import androidx.compose.foundation.layout.Arrangement
@@ -13,7 +12,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
-import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -41,7 +39,6 @@ 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.ui.AppColors
import com.github.damontecres.wholphin.ui.AspectRatios
import com.github.damontecres.wholphin.ui.Cards
import com.github.damontecres.wholphin.ui.FontAwesome
@@ -59,7 +56,7 @@ fun BannerCard(
onClick: () -> Unit,
onLongClick: () -> Unit,
modifier: Modifier = Modifier,
- cornerText: String? = null,+ cornerBadge: CornerBadge? = null,
played: Boolean = false,
favorite: Boolean = false,
playPercent: Double = 0.0,
@@ -139,7 +136,7 @@ fun BannerCard(
.align(Alignment.Center),
)
}
- if (played || cornerText != null) {+ if (played || cornerBadge != null) {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalAlignment = Alignment.CenterVertically,
@@ -151,22 +148,8 @@ fun BannerCard(
if (played && (playPercent <= 0 || playPercent >= 100)) {
WatchedIcon(Modifier.size(24.dp))
}
- if (cornerText != null) {- Box(- modifier =- Modifier- .background(- AppColors.TransparentBlack50,- shape = RoundedCornerShape(25),- ),- ) {- Text(- text = cornerText,- style = MaterialTheme.typography.bodySmall,- color = MaterialTheme.colorScheme.onSurface,- modifier = Modifier.padding(4.dp),- )- }+ if (cornerBadge != null) {+ CornerBadge(cornerBadge, MaterialTheme.typography.bodySmall)
}
}
}
@@ -200,7 +183,7 @@ fun BannerCardWithTitle(
onClick: () -> Unit,
onLongClick: () -> Unit,
modifier: Modifier = Modifier,
- cornerText: String? = null,+ cornerBadge: CornerBadge? = null,
played: Boolean = false,
favorite: Boolean = false,
playPercent: Double = 0.0,
@@ -225,7 +208,7 @@ fun BannerCardWithTitle(
onClick = onClick,
onLongClick = onLongClick,
modifier = Modifier,
- cornerText = cornerText,+ cornerBadge = cornerBadge,
played = played,
favorite = favorite,
playPercent = playPercent,
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt
new file mode 100644
index 00000000..fe5394d6
--- /dev/null+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt@@ -0,0 +1,224 @@+package com.github.damontecres.wholphin.ui.cards++import androidx.compose.foundation.background+import androidx.compose.foundation.border+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Row+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.shape.CircleShape+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.runtime.Composable+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.draw.clip+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.graphics.luminance+import androidx.compose.ui.res.stringResource+import androidx.compose.ui.text.TextStyle+import androidx.compose.ui.unit.dp+import androidx.compose.ui.unit.sp+import androidx.tv.material3.MaterialTheme+import androidx.tv.material3.Text+import com.github.damontecres.wholphin.R+import com.github.damontecres.wholphin.data.model.BaseItem+import com.github.damontecres.wholphin.ui.FontAwesome+import com.github.damontecres.wholphin.ui.PreviewTvSpec+import com.github.damontecres.wholphin.ui.abbreviateNumber+import com.github.damontecres.wholphin.ui.theme.WholphinTheme+import org.jellyfin.sdk.model.api.BaseItemKind++/**+ * What a card shows in its top corner.+ *+ * The badges used to share one translucent plate, so an unwatched count, a number of versions+ * and an episode number looked the same and faded into light artwork. Each kind now has its+ * own look on an opaque plate:+ * - state (unwatched) is filled with the watched-check color of the theme, so the count and+ * the check read as one indicator that turns into the check once everything is watched;+ * - versions are outlined with the theme's primary color;+ * - names (episode number) stay neutral.+ */+sealed interface CornerBadge {+ /** [season] is optional and drawn dimmed, e.g. `S2 E5` on the home page, `E5` in a season */+ data class Episode(+ val season: String?,+ val episode: String,+ ) : CornerBadge++ data class Unplayed(+ val count: String,+ ) : CornerBadge++ /** [unplayed] is null when nothing or everything in the collection is watched */+ data class Collection(+ val unplayed: String?,+ val total: String,+ ) : CornerBadge++ companion object {+ fun collection(+ unplayed: Int,+ total: Int,+ ) = Collection(+ unplayed = unplayed.takeIf { it in 1..<total }?.let(::abbreviateNumber),+ total = abbreviateNumber(total),+ )+ }+}++/** Number of items in a collection, 0 for anything else or when the server did not send it */+val BaseItem?.collectionSize: Int+ get() = if (this?.type == BaseItemKind.BOX_SET) data.childCount ?: 0 else 0++private val PlateColor = Color(0xE6000000)+private val PlateTextColor = Color(0xFFECECEC)+private val PlateMutedColor = Color(0xFF8A8A8A)+private val PlateShape = RoundedCornerShape(4.dp)+private val BadgePadding = Modifier.padding(horizontal = 5.dp, vertical = 2.dp)++@Composable+fun CornerBadge(+ badge: CornerBadge,+ textStyle: TextStyle,+ modifier: Modifier = Modifier,+) {+ when (badge) {+ is CornerBadge.Episode -> EpisodeBadge(badge.season, badge.episode, textStyle, modifier)+ is CornerBadge.Unplayed -> UnplayedBadge(badge.count, textStyle, modifier)+ is CornerBadge.Collection -> CollectionBadge(badge.unplayed, badge.total, textStyle, modifier)+ }+}++/** The watched-check color with whichever of black or white reads better on it */+@Composable+private fun unplayedColors(): Pair<Color, Color> {+ val background = WatchedIconBackground()+ // Contrast against white beats contrast against black only below this luminance+ val content = if (background.luminance() > 0.179f) Color.Black else Color.White+ return background to content+}++@Composable+fun UnplayedBadge(+ count: String,+ textStyle: TextStyle,+ modifier: Modifier = Modifier,+) {+ val (background, content) = unplayedColors()+ Text(+ text = count,+ style = textStyle,+ color = content,+ modifier =+ modifier+ .background(background, CircleShape)+ .border(.5.dp, Color.Black, CircleShape)+ .padding(horizontal = 7.dp, vertical = 2.dp),+ )+}++@Composable+fun VersionsBadge(+ count: Int,+ textStyle: TextStyle,+ modifier: Modifier = Modifier,+) {+ val color = MaterialTheme.colorScheme.primary+ Row(+ horizontalArrangement = Arrangement.spacedBy(3.dp),+ verticalAlignment = Alignment.CenterVertically,+ modifier =+ modifier+ .background(PlateColor, PlateShape)+ .border(1.dp, color, PlateShape)+ .then(BadgePadding),+ ) {+ BadgeIcon(R.string.fa_clone, color, textStyle)+ Text(text = count.toString(), style = textStyle, color = color)+ }+}++@Composable+fun CollectionBadge(+ unplayed: String?,+ total: String,+ textStyle: TextStyle,+ modifier: Modifier = Modifier,+) {+ val (background, content) = unplayedColors()+ Row(+ verticalAlignment = Alignment.CenterVertically,+ modifier =+ modifier+ .clip(PlateShape)+ .background(PlateColor)+ .border(1.dp, PlateMutedColor, PlateShape),+ ) {+ if (unplayed != null) {+ Text(+ text = unplayed,+ style = textStyle,+ color = content,+ modifier = Modifier.background(background).then(BadgePadding),+ )+ }+ Row(+ horizontalArrangement = Arrangement.spacedBy(3.dp),+ verticalAlignment = Alignment.CenterVertically,+ modifier = BadgePadding,+ ) {+ BadgeIcon(R.string.fa_layer_group, PlateTextColor, textStyle)+ Text(text = total, style = textStyle, color = PlateTextColor)+ }+ }+}++@Composable+fun EpisodeBadge(+ season: String?,+ episode: String,+ textStyle: TextStyle,+ modifier: Modifier = Modifier,+) {+ Row(+ horizontalArrangement = Arrangement.spacedBy(3.dp),+ verticalAlignment = Alignment.CenterVertically,+ modifier =+ modifier+ .background(PlateColor, PlateShape)+ .border(1.dp, PlateMutedColor, PlateShape)+ .then(BadgePadding),+ ) {+ if (season != null) {+ Text(text = season, style = textStyle, color = PlateMutedColor)+ }+ Text(text = episode, style = textStyle, color = PlateTextColor)+ }+}++@Composable+private fun BadgeIcon(+ glyph: Int,+ color: Color,+ textStyle: TextStyle,+) = Text(+ text = stringResource(glyph),+ color = color,+ fontFamily = FontAwesome,+ fontSize = if (textStyle.fontSize.isSp) textStyle.fontSize * .85f else 12.sp,+)++@PreviewTvSpec+@Composable+private fun CardBadgesPreview() {+ WholphinTheme {+ val style = MaterialTheme.typography.bodyMedium+ Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {+ UnplayedBadge("14", style)+ VersionsBadge(2, style)+ CollectionBadge("8", "26", style)+ CollectionBadge(null, "26", style)+ EpisodeBadge("S2", "E5", style)+ }+ }+}diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/GridCard.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/GridCard.kt
index f49f2d0b..266dacac 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/GridCard.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/GridCard.kt@@ -93,6 +93,7 @@ fun GridCard(
unwatchedCount = dto?.userData?.unplayedItemCount ?: -1,
watchedPercent = dto?.userData?.playedPercentage,
numberOfVersions = dto?.mediaSourceCount ?: 0,
+ collectionSize = item.collectionSize,
useFallbackText = false,
contentScale = imageContentScale,
fillWidth = fillWidth,
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/ItemCardImage.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/ItemCardImage.kt
index c7e584b1..b54b8ea6 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/ItemCardImage.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/ItemCardImage.kt@@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
-import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -35,10 +34,10 @@ 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.ui.AppColors
import com.github.damontecres.wholphin.ui.Cards
import com.github.damontecres.wholphin.ui.FontAwesome
import com.github.damontecres.wholphin.ui.LocalImageUrlService
+import com.github.damontecres.wholphin.ui.abbreviateNumber
import com.github.damontecres.wholphin.ui.gt
import com.github.damontecres.wholphin.ui.isNotNullOrBlank
import com.github.damontecres.wholphin.ui.logCoilError
@@ -65,6 +64,7 @@ fun ItemCardImage(
contentScale: ContentScale = ContentScale.Fit,
fillWidth: Int? = null,
fillHeight: Int? = null,
+ collectionSize: Int = 0,
) {
val imageUrlService = LocalImageUrlService.current
val imageUrl =
@@ -92,6 +92,7 @@ fun ItemCardImage(
modifier = modifier,
useFallbackText = useFallbackText,
contentScale = contentScale,
+ collectionSize = collectionSize,
)
}
@@ -108,6 +109,7 @@ fun ItemCardImage(
modifier: Modifier = Modifier,
useFallbackText: Boolean = true,
contentScale: ContentScale = ContentScale.Fit,
+ collectionSize: Int = 0,
fallback: @Composable BoxScope.() -> Unit = {
ItemCardImageFallback(
name = name,
@@ -145,6 +147,7 @@ fun ItemCardImage(
unwatchedCount = unwatchedCount,
watchedPercent = watchedPercent,
numberOfVersions = numberOfVersions,
+ collectionSize = collectionSize,
modifier = Modifier,
)
}
@@ -202,7 +205,9 @@ fun ItemCardImageOverlay(
watchedPercent: Double?,
numberOfVersions: Int,
modifier: Modifier = Modifier,
+ collectionSize: Int = 0,
) {
+ val badgeStyle = MaterialTheme.typography.bodyMedium
Box(modifier = modifier.fillMaxSize()) {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
@@ -213,22 +218,7 @@ fun ItemCardImageOverlay(
.padding(4.dp),
) {
if (numberOfVersions > 1) {
- Box(- modifier =- Modifier- .background(- AppColors.TransparentBlack50,- shape = RoundedCornerShape(25),- ),- ) {- Text(- text = numberOfVersions.toString(),- color = MaterialTheme.colorScheme.onSurface,- style = MaterialTheme.typography.bodyMedium,-// fontSize = 16.sp,- modifier = Modifier.padding(4.dp),- )- }+ VersionsBadge(numberOfVersions, badgeStyle)
}
if (favorite) {
FavoriteIndicator()
@@ -245,23 +235,10 @@ fun ItemCardImageOverlay(
if (watched && (watchedPercent == null || watchedPercent <= 0.0 || watchedPercent >= 100.0)) {
WatchedIcon(Modifier.size(24.dp))
}
- if (unwatchedCount > 0) {- Box(- modifier =- Modifier- .background(- AppColors.TransparentBlack50,- shape = RoundedCornerShape(25),- ),- ) {- Text(- text = unwatchedCount.toString(),- color = MaterialTheme.colorScheme.onSurface,- style = MaterialTheme.typography.bodyMedium,-// fontSize = 16.sp,- modifier = Modifier.padding(4.dp),- )- }+ if (collectionSize > 0) {+ CornerBadge(CornerBadge.collection(unwatchedCount, collectionSize), badgeStyle)+ } else if (unwatchedCount > 0) {+ UnplayedBadge(abbreviateNumber(unwatchedCount), badgeStyle)
}
}
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/SeasonCard.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/SeasonCard.kt
index 1992cab4..92e0ccb9 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/SeasonCard.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/SeasonCard.kt@@ -62,6 +62,7 @@ fun SeasonCard(
unplayedItemCount = item?.data?.userData?.unplayedItemCount ?: 0,
playedPercentage = item?.data?.userData?.playedPercentage ?: 0.0,
numberOfVersions = item?.data?.mediaSourceCount ?: 0,
+ collectionSize = item.collectionSize,
onClick = onClick,
onLongClick = onLongClick,
modifier = modifier,
@@ -136,6 +137,7 @@ fun SeasonCard(
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
showImageOverlay: Boolean = false,
aspectRatio: Float = AspectRatios.TALL,
+ collectionSize: Int = 0,
) {
val focused by interactionSource.collectIsFocusedAsState()
// Do not use `by` here, this way we are Defer reads and recompositions to only when modifier calculates
@@ -181,6 +183,7 @@ fun SeasonCard(
unwatchedCount = unplayedItemCount,
watchedPercent = playedPercentage,
numberOfVersions = numberOfVersions,
+ collectionSize = collectionSize,
useFallbackText = false,
modifier =
Modifier
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/detail/series/SeriesOverviewContent.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/detail/series/SeriesOverviewContent.kt
index 0759572c..a9142dec 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/detail/series/SeriesOverviewContent.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/detail/series/SeriesOverviewContent.kt@@ -253,7 +253,7 @@ fun SeriesOverviewContent(
?.aspectRatio
?.coerceAtLeast(AspectRatios.FOUR_THREE)
?: (AspectRatios.WIDE),
- cornerText = episode?.ui?.episodeCornerText,+ cornerBadge = episode?.ui?.episodeCornerBadge,
played = episode?.data?.userData?.played ?: false,
playPercent =
episode?.data?.userData?.playedPercentage
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/main/HomePage.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/main/HomePage.kt
index bf24ae00..7dfe26cb 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/main/HomePage.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/main/HomePage.kt@@ -698,7 +698,7 @@ fun HomePageCardContent(
aspectRatio = ratio,
imageType = imageType,
imageContentScale = scale,
- cornerText = item?.ui?.episodeUnplayedCornerText,+ cornerBadge = item?.ui?.episodeUnplayedCornerBadge,
played = item?.data?.userData?.played ?: false,
favorite = item?.favorite ?: false,
playPercent =
@@ -717,7 +717,7 @@ fun HomePageCardContent(
aspectRatio = ratio,
imageType = imageType,
imageContentScale = scale,
- cornerText = item?.ui?.episodeUnplayedCornerText,+ cornerBadge = item?.ui?.episodeUnplayedCornerBadge,
played = item?.data?.userData?.played ?: false,
favorite = item?.favorite ?: false,
playPercent =
diff --git a/app/src/main/res/values/fa_strings.xml b/app/src/main/res/values/fa_strings.xml
index 45a6f7b2..a82010e5 100644
--- a/app/src/main/res/values/fa_strings.xml+++ b/app/src/main/res/values/fa_strings.xml@@ -62,4 +62,6 @@
<string name="fa_xmark" translatable="false"></string>
<string name="fa_dice" translatable="false"></string>
<string name="fa_circle_xmark" translatable="false"></string>
+ <string name="fa_clone" translatable="false"></string>+ <string name="fa_layer_group" translatable="false"></string>
</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 564bd77b..5344b3a9 100644
--- a/app/src/main/res/values/strings.xml+++ b/app/src/main/res/values/strings.xml@@ -164,6 +164,7 @@
<string name="season_episode_number_padded">S%1$02dE%2$02d</string>
<string name="season_episode_number_padded_range">S%1$02dE%2$02d-E%3$02d</string>
<string name="episode_number_short">E%1$d</string>
+ <string name="season_number_short">S%1$d</string>
<string name="season_number">Season %1$d</string>
<string name="tv_shows_title">TV Shows</string>
<string name="ui_interface">Interface</string>
--
2.55.0.windows.3
From 63bbb06f096813729438f3827c970007e60ffe96 Mon Sep 17 00:00:00 2001
From: Sergey K <17836309+SergeiAK@users.noreply.github.com>
Date: Wed, 14 Oct 2026 18:29:37 +0300
Subject: [PATCH 2/2] Show the number of versions on home page cards too
Home page rows draw their cards with BannerCard, which had no versions
badge, and most of them did not request MediaSourceCount. The badge now
sits top left next to the favorite heart, as on posters.
The versions badge uses Tabler's outline "files" icon (MIT) instead of the
solid Font Awesome "clone", and the badge plates are fully opaque.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---
.../damontecres/wholphin/ui/UiConstants.kt | 2 ++
.../wholphin/ui/cards/BannerCard.kt | 28 +++++++++++++------
.../wholphin/ui/cards/CardBadges.kt | 13 +++++++--
app/src/main/res/drawable/tabler_files.xml | 26 +++++++++++++++++
app/src/main/res/values/fa_strings.xml | 1 -
5 files changed, 59 insertions(+), 11 deletions(-)
create mode 100644 app/src/main/res/drawable/tabler_files.xml
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt
index e77c4a76..d2203a45 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/UiConstants.kt@@ -81,6 +81,8 @@ val HomeItemFields =
listOf(
ItemFields.OVERVIEW,
ItemFields.CAN_DELETE,
+ // Number of versions on the card+ ItemFields.MEDIA_SOURCE_COUNT,
)
val PhotoItemFields =
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt
index 9ef15797..27831bbc 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/BannerCard.kt@@ -63,6 +63,7 @@ fun BannerCard(
cardHeight: Dp = 120.dp,
aspectRatio: Float = AspectRatios.WIDE,
interactionSource: MutableInteractionSource? = null,
+ numberOfVersions: Int = item?.data?.mediaSourceCount ?: 0,
imageType: ImageType = ImageType.PRIMARY,
imageContentScale: ContentScale = ContentScale.FillBounds,
useSeriesForPrimary: Boolean = true,
@@ -153,17 +154,28 @@ fun BannerCard(
}
}
}
- if (favorite) {- Text(+ if (favorite || numberOfVersions > 1) {+ Row(+ horizontalArrangement = Arrangement.spacedBy(4.dp),+ verticalAlignment = Alignment.CenterVertically,
modifier =
Modifier
.align(Alignment.TopStart)
- .padding(8.dp),- color = colorResource(android.R.color.holo_red_light),- text = stringResource(R.string.fa_heart),- fontSize = 16.sp,- fontFamily = FontAwesome,- )+ .padding(4.dp),+ ) {+ if (numberOfVersions > 1) {+ VersionsBadge(numberOfVersions, MaterialTheme.typography.bodySmall)+ }+ if (favorite) {+ Text(+ modifier = Modifier.padding(4.dp),+ color = colorResource(android.R.color.holo_red_light),+ text = stringResource(R.string.fa_heart),+ fontSize = 16.sp,+ fontFamily = FontAwesome,+ )+ }+ }
}
if (playPercent > 0 && playPercent < 100) {
PlayedPercentBar(
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt
index fe5394d6..a9900456 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/cards/CardBadges.kt@@ -5,6 +5,7 @@ import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
@@ -13,10 +14,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.luminance
+import androidx.compose.ui.platform.LocalDensity+import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
+import androidx.tv.material3.Icon
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Text
import com.github.damontecres.wholphin.R
@@ -70,7 +74,7 @@ sealed interface CornerBadge {
val BaseItem?.collectionSize: Int
get() = if (this?.type == BaseItemKind.BOX_SET) data.childCount ?: 0 else 0
-private val PlateColor = Color(0xE6000000)+private val PlateColor = Color(0xFF121212)
private val PlateTextColor = Color(0xFFECECEC)
private val PlateMutedColor = Color(0xFF8A8A8A)
private val PlateShape = RoundedCornerShape(4.dp)
@@ -133,7 +137,12 @@ fun VersionsBadge(
.border(1.dp, color, PlateShape)
.then(BadgePadding),
) {
- BadgeIcon(R.string.fa_clone, color, textStyle)+ Icon(+ painter = painterResource(R.drawable.tabler_files),+ contentDescription = null,+ tint = color,+ modifier = Modifier.size(with(LocalDensity.current) { textStyle.fontSize.toDp() }),+ )
Text(text = count.toString(), style = textStyle, color = color)
}
}
diff --git a/app/src/main/res/drawable/tabler_files.xml b/app/src/main/res/drawable/tabler_files.xml
new file mode 100644
index 00000000..f5db27a5
--- /dev/null+++ b/app/src/main/res/drawable/tabler_files.xml@@ -0,0 +1,26 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- "files" outline icon from Tabler Icons (MIT, https://tabler.io/icons) -->+<vector xmlns:android="http://schemas.android.com/apk/res/android"+ android:width="24dp"+ android:height="24dp"+ android:viewportWidth="24"+ android:viewportHeight="24">+ <path+ android:pathData="M15,3v4a1,1 0,0 0,1 1h4"+ android:strokeWidth="2"+ android:strokeColor="#FFFFFFFF"+ android:strokeLineCap="round"+ android:strokeLineJoin="round" />+ <path+ android:pathData="M18,17h-7a2,2 0,0 1,-2 -2v-10a2,2 0,0 1,2 -2h4l5,5v7a2,2 0,0 1,-2 2z"+ android:strokeWidth="2"+ android:strokeColor="#FFFFFFFF"+ android:strokeLineCap="round"+ android:strokeLineJoin="round" />+ <path+ android:pathData="M16,17v2a2,2 0,0 1,-2 2h-7a2,2 0,0 1,-2 -2v-10a2,2 0,0 1,2 -2h2"+ android:strokeWidth="2"+ android:strokeColor="#FFFFFFFF"+ android:strokeLineCap="round"+ android:strokeLineJoin="round" />+</vector>diff --git a/app/src/main/res/values/fa_strings.xml b/app/src/main/res/values/fa_strings.xml
index a82010e5..964b6781 100644
--- a/app/src/main/res/values/fa_strings.xml+++ b/app/src/main/res/values/fa_strings.xml@@ -62,6 +62,5 @@
<string name="fa_xmark" translatable="false"></string>
<string name="fa_dice" translatable="false"></string>
<string name="fa_circle_xmark" translatable="false"></string>
- <string name="fa_clone" translatable="false"></string>
<string name="fa_layer_group" translatable="false"></string>
</resources>
--
2.55.0.windows.3
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The badges in the top corners of cards — unwatched count, number of versions, episode number — all use the same translucent black plate. They look the same, so a bare number can be unwatched episodes or versions, and on light posters they nearly disappear. Seen on the official Wholphin 1.0.9 on Dune HD Homatics; before/after screenshots below.
Two more things I noticed while looking:
UnplayedItemCount, not the size: "James Bond" with 26 movies shows "8". In my library 8 of 73 collections differ; it only matches until you start one.BannerCard) never show the versions badge, and only "Continue watching" requestsMediaSourceCount.What I did — every kind gets its own shape on an opaque plate, colours from the current theme, so it works for all themes:
WatchedIconBackground()), black or white text by contrast — the count and the check read as one indicatorprimary,primaryborderlayer-group) with the total (ChildCount, added toSlimItemFields); not started or finished — total only, finished also gets the checkCode: new
ui/cards/CardBadges.kt;BannerCardtakes aCornerBadgeinstead ofcornerText: String, versions badge added there next to the favourite heart;MEDIA_SOURCE_COUNTadded toHomeItemFields. Checked on NVIDIA Shield (purple theme) and Dune HD Homatics (blue); the diff applies cleanly to currentmain. Not checked: light themes; unit tests not run yet.This sits next to #1518 (size / hiding of the watched check) — if you're reworking indicators anyway, happy to fit this into whatever direction you pick. Would you take it as a PR?
Screenshots (Dune HD Homatics, blue theme unless noted)
Before — official Wholphin 1.0.9, overview
After — the same screens
Before — a movie with two versions
After — versions badge
After in the purple theme — colours follow the theme
Diff
All reactions