StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.
Kotlin iptv-player
refactor(live): extract guide hero badge
David Nashash65e78c3769f7
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.ktindex 55ff8f7d..073dd671 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgHeroComponents.kt@@ -32,6 +32,7 @@ import androidx.tv.material3.SurfaceDefaultsimport androidx.tv.material3.Textimport com.streamvault.app.Rimport com.streamvault.feature.live.presentation.epg.GuideDensity+import com.streamvault.feature.live.presentation.epg.LiveGuideHeroBadgeimport com.streamvault.feature.live.presentation.epg.currentLiveGuideNowimport com.streamvault.core.ui.image.ChannelLogoBadgeimport com.streamvault.domain.playback.isArchivePlayable@@ -236,12 +237,12 @@ internal fun ImmersiveGuideHero(modifier = Modifier.widthIn(min = 176.dp, max = 220.dp),verticalArrangement = Arrangement.spacedBy(3.dp)) {- GuideHeroBadge(text = stringResource(R.string.epg_schedule_summary_short, channelsWithSchedule, channelCount))+ LiveGuideHeroBadge(text = stringResource(R.string.epg_schedule_summary_short, channelsWithSchedule, channelCount))if (isRefreshing) {- GuideHeroBadge(text = stringResource(R.string.epg_loading))+ LiveGuideHeroBadge(text = stringResource(R.string.epg_loading))}if (selection?.program != null && selection.channel.isArchivePlayable(selection.program, currentLiveGuideNow())) {- GuideHeroBadge(+ LiveGuideHeroBadge(text = if (selection.program.hasArchive) {stringResource(R.string.epg_program_replay_ready)} else {@@ -251,7 +252,7 @@ internal fun ImmersiveGuideHero()}if (isGuideStale) {- GuideHeroBadge(+ LiveGuideHeroBadge(text = stringResource(R.string.epg_stale_short),accentColor = Color(0xFFFF6B6B))@@ -267,26 +268,3 @@ internal fun ImmersiveGuideHero(}}}--@Composable-internal fun GuideHeroBadge(- text: String,- highlight: Boolean = false,- accentColor: Color = Primary-) {- Surface(- shape = RoundedCornerShape(999.dp),- colors = SurfaceDefaults.colors(- containerColor = if (highlight) accentColor.copy(alpha = 0.18f) else SurfaceHighlight- )- ) {- Text(- text = text,- modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp),- style = MaterialTheme.typography.labelMedium,- color = if (highlight) accentColor else OnSurface,- maxLines = 1,- overflow = TextOverflow.Ellipsis- )- }-}diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.mdindex 662dfd56..57f13270 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md@@ -137,7 +137,7 @@ and hidden category/channel dialogs, the category options dialog, thequick-filter add dialog, delete-group dialog, rename-group dialog, M3U categoryorganizer dialog, M3U series-assignment dialogs, EPG search overlay, guidecategory picker, compact guide-program dialog, guide control rows, EPG preview-pane, guide toolbar, and guide message state are now feature-owned+pane, guide toolbar, guide message state, and hero badge are now feature-ownedwhile the Home and EPGscreen/dialog composition remains in `:app` for the remaining app-specificdialogs.@@ -149,6 +149,6 @@ category options dialog, the quick-filter add dialog, the delete-group dialog,and the rename-group dialog, M3U category organizer dialog, and M3Useries-assignment dialogs, the EPG search overlay, guide category picker, andcompact guide-program dialog, guide control rows, EPG preview pane, guide-toolbar, and guide message state are independent of app code;+toolbar, guide message state, and hero badge are independent of app code;screen/resource moves, golden/runtime/performance gates, and legacy app cleanupremain open, so no live slice acceptance gate is claimed yet.diff --git a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md b/docs/superpowers/plans/2026-08-28-live-feature-extraction.mdindex 5296e4a9..69075ffd 100644--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md@@ -27,7 +27,7 @@ and hidden category/channel dialogs, the category options dialog, thequick-filter add dialog, delete-group dialog, rename-group dialog, M3U categoryorganizer dialog, M3U series-assignment dialogs, EPG search overlay, guidecategory picker, compact guide-program dialog, guide control rows, EPG preview-pane, guide toolbar, and guide message state are now feature-owned+pane, guide toolbar, guide message state, and hero badge are now feature-ownedand their feature checks are green. Home screen/dialog composition, theremaining live cards/rows, complete locale resource migration, and acceptancegates remain open.@@ -709,6 +709,8 @@ The guide toolbar owns button layout and focus affordances while the appsupplies category text and navigation callbacks.The guide message state owns centered empty/loading/error presentation and theoptional action affordance while callers supply state-specific copy and action.+The hero badge owns rounded highlight styling and text overflow presentation;+callers supply the text and optional accent.quick-filter key/selection rules are covered by `LiveQuickFiltersTest`. Theremaining app-owned live cards and shell/dialog composition still requirecompatibility seams before the full Home move.diff --git a/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideHeroBadge.kt b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideHeroBadge.ktnew file mode 100644index 00000000..81b928dd--- /dev/null+++ b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideHeroBadge.kt@@ -0,0 +1,39 @@+package com.streamvault.feature.live.presentation.epg++import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.runtime.Composable+import androidx.compose.ui.Modifier+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.text.style.TextOverflow+import androidx.compose.ui.unit.dp+import androidx.tv.material3.MaterialTheme+import androidx.tv.material3.Surface+import androidx.tv.material3.SurfaceDefaults+import androidx.tv.material3.Text+import com.streamvault.core.ui.theme.OnSurface+import com.streamvault.core.ui.theme.Primary+import com.streamvault.core.ui.theme.SurfaceHighlight++@Composable+fun LiveGuideHeroBadge(+ text: String,+ highlight: Boolean = false,+ accentColor: Color = Primary+) {+ Surface(+ shape = RoundedCornerShape(999.dp),+ colors = SurfaceDefaults.colors(+ containerColor = if (highlight) accentColor.copy(alpha = 0.18f) else SurfaceHighlight+ )+ ) {+ Text(+ text = text,+ modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp),+ style = MaterialTheme.typography.labelMedium,+ color = if (highlight) accentColor else OnSurface,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis+ )+ }+}