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 epg message state
David Nashash2d5b5af7398c
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.ktindex da1b7dd0..3b4bf9e4 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgGridComponents.kt@@ -74,47 +74,6 @@ import java.time.ZoneIdimport kotlinx.coroutines.delayimport kotlin.math.max-@Composable-internal fun GuideMessageState(- modifier: Modifier = Modifier,- title: String,- subtitle: String?,- actionLabel: String?,- onAction: (() -> Unit)?-) {- Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) {- Column(- horizontalAlignment = Alignment.CenterHorizontally,- verticalArrangement = Arrangement.spacedBy(10.dp),- modifier = Modifier.padding(horizontal = 32.dp)- ) {- Text(- text = title,- style = MaterialTheme.typography.titleLarge,- color = OnSurface- )- if (!subtitle.isNullOrBlank()) {- Text(- text = subtitle,- style = MaterialTheme.typography.bodyMedium,- color = OnSurfaceDim- )- }- if (actionLabel != null && onAction != null) {- TvButton(- onClick = onAction,- colors = ButtonDefaults.colors(- containerColor = Primary,- contentColor = Color.White- )- ) {- Text(actionLabel)- }- }- }- }-}-@Composableinternal fun EpgGrid(modifier: Modifier = Modifier,@@ -230,7 +189,6 @@ internal fun EpgGrid(}}}-@Composableprivate fun GuideTimelineHeader(windowStart: Long,@@ -327,7 +285,6 @@ private fun GuideTimelineHeader(}}}-@Composablefun EpgRow(channel: Channel,diff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.ktindex fb10249f..147d6fbb 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/EpgScreen.kt@@ -24,6 +24,7 @@ import com.streamvault.feature.live.presentation.epg.LiveGuidePreviewLabelsimport com.streamvault.feature.live.presentation.epg.LiveGuidePreviewPaneimport com.streamvault.feature.live.presentation.epg.LiveGuideToolbarLabelsimport com.streamvault.feature.live.presentation.epg.LiveGuideToolbarRow+import com.streamvault.feature.live.presentation.epg.LiveGuideMessageStateimport androidx.compose.foundation.BorderStrokeimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.clickable@@ -384,7 +385,7 @@ fun FullEpgScreen(}uiState.error != null -> {- GuideMessageState(+ LiveGuideMessageState(modifier = Modifier.weight(1f),title = when (uiState.error) {EpgViewModel.NO_ACTIVE_PROVIDER -> stringResource(R.string.epg_no_provider)@@ -400,7 +401,7 @@ fun FullEpgScreen(}uiState.channels.isEmpty() -> {- GuideMessageState(+ LiveGuideMessageState(modifier = Modifier.weight(1f),title = when {uiState.programSearchQuery.isNotBlank() ->diff --git a/app/src/main/java/com/streamvault/app/ui/screens/epg/PlayerTransparentGuideOverlay.kt b/app/src/main/java/com/streamvault/app/ui/screens/epg/PlayerTransparentGuideOverlay.ktindex 4d5d2557..8bd93864 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/epg/PlayerTransparentGuideOverlay.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/epg/PlayerTransparentGuideOverlay.kt@@ -33,7 +33,6 @@ import com.streamvault.domain.playback.isArchivePlayableimport com.streamvault.app.ui.screens.epg.EpgGridimport com.streamvault.app.ui.screens.epg.EpgUiStateimport com.streamvault.app.ui.screens.epg.EpgViewModel-import com.streamvault.app.ui.screens.epg.GuideMessageStateimport com.streamvault.feature.live.presentation.epg.LiveGuideNowProviderimport com.streamvault.feature.live.presentation.epg.LiveGuideSearchOverlayimport com.streamvault.feature.live.presentation.epg.LiveGuideSearchOverlayLabels@@ -42,6 +41,7 @@ import com.streamvault.feature.live.presentation.epg.LiveGuideCategoryPickerLabeimport com.streamvault.feature.live.presentation.epg.LiveCompactGuideProgramDialogimport com.streamvault.feature.live.presentation.epg.LiveCompactGuideProgramLabelsimport com.streamvault.feature.live.presentation.epg.LiveGuideToolbarButton+import com.streamvault.feature.live.presentation.epg.LiveGuideMessageStateimport com.streamvault.feature.live.presentation.epg.currentLiveGuideNowimport com.streamvault.app.ui.screens.epg.isGuideCategoryLockedimport com.streamvault.core.ui.theme.OnSurfaceDim@@ -205,7 +205,7 @@ fun PlayerTransparentGuideOverlay() {when {uiState.isInitialLoading -> {- GuideMessageState(+ LiveGuideMessageState(title = stringResource(R.string.epg_loading),subtitle = contextLabel.takeIf { it.isNotBlank() },actionLabel = null,@@ -213,7 +213,7 @@ fun PlayerTransparentGuideOverlay()}uiState.channels.isEmpty() -> {- GuideMessageState(+ LiveGuideMessageState(title = stringResource(R.string.epg_title),subtitle = uiState.error?.takeUnless { it == EpgViewModel.NO_ACTIVE_PROVIDER }diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.mdindex 2b7f7a78..662dfd56 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, and guide toolbar are now feature-owned+pane, guide toolbar, and guide message state are now feature-ownedwhile the Home and EPGscreen/dialog composition remains in `:app` for the remaining app-specificdialogs.@@ -148,7 +148,7 @@ mode/density/reminder presentation models, hidden collection dialogs, thecategory 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, and-compact guide-program dialog, guide control rows, EPG preview pane, and guide-toolbar are independent of app code;+compact guide-program dialog, guide control rows, EPG preview pane, guide+toolbar, and guide message state 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 456cd4a6..5296e4a9 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, and guide toolbar are now feature-owned+pane, guide toolbar, and guide message state 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.@@ -707,6 +707,8 @@ selection, placeholder/loading states, channel/program metadata, and progresspresentation while the app supplies the player and focused data.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 the+optional action affordance while callers supply state-specific copy and action.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/LiveGuideMessageState.kt b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideMessageState.ktnew file mode 100644index 00000000..d6e0b221--- /dev/null+++ b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideMessageState.kt@@ -0,0 +1,49 @@+package com.streamvault.feature.live.presentation.epg++import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Box+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.fillMaxSize+import androidx.compose.foundation.layout.padding+import androidx.compose.runtime.Composable+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.unit.dp+import androidx.tv.material3.ButtonDefaults+import androidx.tv.material3.MaterialTheme+import androidx.tv.material3.Text+import com.streamvault.core.ui.interaction.TvButton+import com.streamvault.core.ui.theme.OnSurface+import com.streamvault.core.ui.theme.OnSurfaceDim+import com.streamvault.core.ui.theme.Primary++@Composable+fun LiveGuideMessageState(+ modifier: Modifier = Modifier,+ title: String,+ subtitle: String?,+ actionLabel: String?,+ onAction: (() -> Unit)?+) {+ Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) {+ Column(+ horizontalAlignment = Alignment.CenterHorizontally,+ verticalArrangement = Arrangement.spacedBy(10.dp),+ modifier = Modifier.padding(horizontal = 32.dp)+ ) {+ Text(text = title, style = MaterialTheme.typography.titleLarge, color = OnSurface)+ if (!subtitle.isNullOrBlank()) {+ Text(text = subtitle, style = MaterialTheme.typography.bodyMedium, color = OnSurfaceDim)+ }+ if (actionLabel != null && onAction != null) {+ TvButton(+ onClick = onAction,+ colors = ButtonDefaults.colors(containerColor = Primary, contentColor = Color.White)+ ) {+ Text(actionLabel)+ }+ }+ }+ }+}