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 guide toolbar
David Nashashdeed02dd66e3
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 24f0dc6b..55ff8f7d 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@@ -1,6 +1,5 @@package com.streamvault.app.ui.screens.epg-import androidx.compose.foundation.BorderStrokeimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.layout.Arrangementimport androidx.compose.foundation.layout.Column@@ -17,20 +16,16 @@ import androidx.compose.material3.LinearProgressIndicatorimport androidx.compose.runtime.Composableimport androidx.compose.runtime.derivedStateOfimport androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.remember-import androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.draw.clip-import androidx.compose.ui.focus.onFocusChangedimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.style.TextOverflowimport androidx.compose.ui.unit.dpimport androidx.compose.ui.unit.spimport androidx.tv.material3.Border-import androidx.tv.material3.ClickableSurfaceDefaultsimport androidx.tv.material3.MaterialThemeimport androidx.tv.material3.Surfaceimport androidx.tv.material3.SurfaceDefaults@@ -40,11 +35,9 @@ import com.streamvault.feature.live.presentation.epg.GuideDensityimport com.streamvault.feature.live.presentation.epg.currentLiveGuideNowimport com.streamvault.core.ui.image.ChannelLogoBadgeimport com.streamvault.domain.playback.isArchivePlayable-import com.streamvault.core.ui.interaction.TvClickableSurfaceimport com.streamvault.feature.live.presentation.model.guideLookupKeyimport com.streamvault.feature.live.presentation.time.LocalLiveTimeFormatimport com.streamvault.feature.live.presentation.time.createLiveTimeFormat-import com.streamvault.core.ui.theme.FocusBorderimport com.streamvault.core.ui.theme.OnSurfaceimport com.streamvault.core.ui.theme.OnSurfaceDimimport com.streamvault.core.ui.theme.Primary@@ -120,7 +113,6 @@ internal fun GuideHeroSection(modifier = modifier)}-@Composableinternal fun ImmersiveGuideHero(selection: GuideHeroSelection?,@@ -298,79 +290,3 @@ internal fun GuideHeroBadge()}}--@Composable-internal fun GuideToolbarRow(- selectedCategoryName: String,- onOpenCategoryPicker: () -> Unit,- onJumpToNow: () -> Unit,- onOpenSearch: () -> Unit,- onOpenOptions: () -> Unit,- onGuideInteract: () -> Unit,- modifier: Modifier = Modifier-) {- Row(- modifier = modifier,- horizontalArrangement = Arrangement.spacedBy(5.dp),- verticalAlignment = Alignment.CenterVertically- ) {- GuideToolbarButton(- label = selectedCategoryName,- modifier = Modifier.widthIn(min = 200.dp, max = 280.dp),- onClick = onOpenCategoryPicker,- onFocused = onGuideInteract- )- GuideToolbarButton(- label = stringResource(R.string.epg_jump_now),- onClick = onJumpToNow,- onFocused = onGuideInteract- )- GuideToolbarButton(- label = stringResource(R.string.epg_search_label),- onClick = onOpenSearch,- onFocused = onGuideInteract- )- GuideToolbarButton(- label = stringResource(R.string.epg_options_short),- onClick = onOpenOptions,- onFocused = onGuideInteract- )- }-}--@Composable-internal fun GuideToolbarButton(- label: String,- modifier: Modifier = Modifier,- onClick: () -> Unit,- onFocused: () -> Unit-) {- var focused by remember { mutableStateOf(false) }- TvClickableSurface(- onClick = onClick,- modifier = modifier.onFocusChanged {- if (it.isFocused && !focused) onFocused()- focused = it.isFocused- },- colors = ClickableSurfaceDefaults.colors(- containerColor = SurfaceElevated,- focusedContainerColor = SurfaceHighlight- ),- shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(14.dp)),- border = ClickableSurfaceDefaults.border(- focusedBorder = Border(- border = BorderStroke(2.dp, FocusBorder),- shape = RoundedCornerShape(14.dp)- )- )- ) {- Text(- text = label,- modifier = Modifier.padding(horizontal = 11.dp, vertical = 7.dp),- style = MaterialTheme.typography.labelMedium,- color = OnSurface,- maxLines = 1,- overflow = TextOverflow.Ellipsis- )- }-}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 9820b26c..fb10249f 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@@ -22,6 +22,8 @@ import com.streamvault.feature.live.presentation.epg.LiveGuideTimeControlLabelsimport com.streamvault.feature.live.presentation.epg.LiveGuideViewOptionsLabelsimport com.streamvault.feature.live.presentation.epg.LiveGuidePreviewLabelsimport com.streamvault.feature.live.presentation.epg.LiveGuidePreviewPane+import com.streamvault.feature.live.presentation.epg.LiveGuideToolbarLabels+import com.streamvault.feature.live.presentation.epg.LiveGuideToolbarRowimport androidx.compose.foundation.BorderStrokeimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.clickable@@ -450,11 +452,16 @@ fun FullEpgScreen(.padding(horizontal = 14.dp, vertical = 4.dp))}- GuideToolbarRow(+ LiveGuideToolbarRow(selectedCategoryName = uiState.categories.firstOrNull { it.id == uiState.selectedCategoryId }?.name?: stringResource(R.string.epg_filter_short),+ labels = LiveGuideToolbarLabels(+ jumpNow = stringResource(R.string.epg_jump_now),+ search = stringResource(R.string.epg_search_label),+ options = stringResource(R.string.epg_options_short)+ ),onOpenCategoryPicker = {showCategoryPicker = true},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 95a448e0..4d5d2557 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@@ -41,7 +41,7 @@ import com.streamvault.feature.live.presentation.epg.LiveGuideCategoryPickerDialimport com.streamvault.feature.live.presentation.epg.LiveGuideCategoryPickerLabelsimport com.streamvault.feature.live.presentation.epg.LiveCompactGuideProgramDialogimport com.streamvault.feature.live.presentation.epg.LiveCompactGuideProgramLabels-import com.streamvault.app.ui.screens.epg.GuideToolbarButton+import com.streamvault.feature.live.presentation.epg.LiveGuideToolbarButtonimport com.streamvault.feature.live.presentation.epg.currentLiveGuideNowimport com.streamvault.app.ui.screens.epg.isGuideCategoryLockedimport com.streamvault.core.ui.theme.OnSurfaceDim@@ -171,23 +171,23 @@ fun PlayerTransparentGuideOverlay(horizontalArrangement = Arrangement.spacedBy(8.dp),verticalAlignment = Alignment.CenterVertically) {- GuideToolbarButton(+ LiveGuideToolbarButton(label = selectedCategoryName.ifBlank { stringResource(R.string.epg_filter_short) },modifier = Modifier.widthIn(min = 180.dp, max = 280.dp),onClick = { showCategoryPicker = true },onFocused = {})- GuideToolbarButton(+ LiveGuideToolbarButton(label = stringResource(R.string.epg_jump_now),onClick = onJumpToNow,onFocused = {})- GuideToolbarButton(+ LiveGuideToolbarButton(label = stringResource(R.string.epg_search_label),onClick = { showSearchOverlay = true },onFocused = {})- GuideToolbarButton(+ LiveGuideToolbarButton(label = stringResource(R.string.settings_cancel),onClick = onDismiss,onFocused = {}diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.mdindex 1a6a0bd2..2b7f7a78 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md@@ -136,8 +136,8 @@ header, channel-content state host, channel-list host, and category-list hostand 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, guide-category picker, compact guide-program dialog, guide control rows, and EPG-preview pane are now feature-owned+category picker, compact guide-program dialog, guide control rows, EPG preview+pane, and guide toolbar 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, and EPG preview pane are-independent of app code;+compact guide-program dialog, guide control rows, EPG preview pane, and guide+toolbar 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 2d1b5e5d..456cd4a6 100644--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md@@ -26,8 +26,8 @@ header, channel-content state host, channel-list host, and category-list hostand 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, guide-category picker, compact guide-program dialog, guide control rows, and EPG-preview pane are now feature-owned+category picker, compact guide-program dialog, guide control rows, EPG preview+pane, and guide toolbar 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.@@ -705,6 +705,8 @@ favorites) are also feature-owned; the options shell continues to supply labelsand ViewModel callbacks from `:app`. The preview pane owns render-surfaceselection, 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 app+supplies category text and navigation callbacks.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/LiveGuideToolbar.kt b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideToolbar.ktnew file mode 100644index 00000000..6ee396a6--- /dev/null+++ b/feature/live/src/main/java/com/streamvault/feature/live/presentation/epg/LiveGuideToolbar.kt@@ -0,0 +1,99 @@+package com.streamvault.feature.live.presentation.epg++import androidx.compose.foundation.BorderStroke+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Row+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.layout.widthIn+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.runtime.Composable+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.setValue+import androidx.compose.ui.Modifier+import androidx.compose.ui.Alignment+import androidx.compose.ui.focus.onFocusChanged+import androidx.compose.ui.text.style.TextOverflow+import androidx.compose.ui.unit.dp+import androidx.tv.material3.Border+import androidx.tv.material3.ClickableSurfaceDefaults+import androidx.tv.material3.MaterialTheme+import androidx.tv.material3.Text+import com.streamvault.core.ui.interaction.TvClickableSurface+import com.streamvault.core.ui.theme.FocusBorder+import com.streamvault.core.ui.theme.OnSurface+import com.streamvault.core.ui.theme.SurfaceElevated+import com.streamvault.core.ui.theme.SurfaceHighlight++data class LiveGuideToolbarLabels(+ val jumpNow: String,+ val search: String,+ val options: String+)++@Composable+fun LiveGuideToolbarRow(+ selectedCategoryName: String,+ labels: LiveGuideToolbarLabels,+ onOpenCategoryPicker: () -> Unit,+ onJumpToNow: () -> Unit,+ onOpenSearch: () -> Unit,+ onOpenOptions: () -> Unit,+ onGuideInteract: () -> Unit,+ modifier: Modifier = Modifier+) {+ Row(+ modifier = modifier,+ horizontalArrangement = Arrangement.spacedBy(5.dp),+ verticalAlignment = Alignment.CenterVertically+ ) {+ LiveGuideToolbarButton(+ label = selectedCategoryName,+ modifier = Modifier.widthIn(min = 200.dp, max = 280.dp),+ onClick = onOpenCategoryPicker,+ onFocused = onGuideInteract+ )+ LiveGuideToolbarButton(label = labels.jumpNow, onClick = onJumpToNow, onFocused = onGuideInteract)+ LiveGuideToolbarButton(label = labels.search, onClick = onOpenSearch, onFocused = onGuideInteract)+ LiveGuideToolbarButton(label = labels.options, onClick = onOpenOptions, onFocused = onGuideInteract)+ }+}++@Composable+fun LiveGuideToolbarButton(+ label: String,+ modifier: Modifier = Modifier,+ onClick: () -> Unit,+ onFocused: () -> Unit+) {+ var focused by remember { mutableStateOf(false) }+ TvClickableSurface(+ onClick = onClick,+ modifier = modifier.onFocusChanged {+ if (it.isFocused && !focused) onFocused()+ focused = it.isFocused+ },+ colors = ClickableSurfaceDefaults.colors(+ containerColor = SurfaceElevated,+ focusedContainerColor = SurfaceHighlight+ ),+ shape = ClickableSurfaceDefaults.shape(RoundedCornerShape(14.dp)),+ border = ClickableSurfaceDefaults.border(+ focusedBorder = Border(+ border = BorderStroke(2.dp, FocusBorder),+ shape = RoundedCornerShape(14.dp)+ )+ )+ ) {+ Text(+ text = label,+ modifier = Modifier.padding(horizontal = 11.dp, vertical = 7.dp),+ style = MaterialTheme.typography.labelMedium,+ color = OnSurface,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis+ )+ }+}