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): move Home supporting composables
David Nashashe6041d7439b3
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.ktindex 43a4fc24..cf25cca9 100644--- a/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt+++ b/app/src/main/java/com/streamvault/app/ui/screens/home/HomeScreen.kt@@ -52,7 +52,8 @@ import com.streamvault.feature.live.presentation.components.LiveSourceSwitcherimport com.streamvault.feature.live.home.HomeViewModelimport com.streamvault.feature.live.home.CategoryItemimport com.streamvault.feature.live.home.CompactSplitLauncherButton-import com.streamvault.feature.live.home.LivePreviewPane+import com.streamvault.feature.live.home.HomeLoadingPane+import com.streamvault.feature.live.home.HomePreviewHostimport com.streamvault.core.ui.components.shell.ContentMetadataStripimport com.streamvault.feature.live.presentation.components.LiveChannelRowSurfaceimport com.streamvault.core.ui.components.shell.StatusPill@@ -113,64 +114,6 @@ private sealed interface FocusedRemoteShortcutTarget {private const val HOME_ALL_FILTER_KEY = "__all_categories__"-@Composable-private fun HomeLoadingPane(- message: String,- modifier: Modifier = Modifier-) {- Box(- modifier = modifier.fillMaxSize(),- contentAlignment = Alignment.Center- ) {- Column(- horizontalAlignment = Alignment.CenterHorizontally,- verticalArrangement = Arrangement.spacedBy(16.dp)- ) {- CircularProgressIndicator(color = Color.White)- Text(- text = message,- color = Color.White.copy(alpha = 0.7f),- style = MaterialTheme.typography.bodyMedium- )- }- }-}--@Composable-private fun HomePreviewHost(- viewModel: HomeViewModel,- channels: List<Channel>,- modifier: Modifier = Modifier-) {- val previewUiState by viewModel.previewUiState.collectAsStateWithLifecycle()- val previewChannel = remember(channels, previewUiState.previewChannelId) {- channels.firstOrNull { it.id == previewUiState.previewChannelId }- }- val hasActivePreview = previewUiState.previewPlayerEngine != null- val context = androidx.compose.ui.platform.LocalContext.current-- DisposableEffect(hasActivePreview) {- val window = (context as? android.app.Activity)?.window- if (hasActivePreview) {- window?.addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)- }- onDispose {- if (hasActivePreview) {- window?.clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)- }- }- }-- LivePreviewPane(- channel = previewChannel,- playerEngine = previewUiState.previewPlayerEngine,- isLoading = previewUiState.isPreviewLoading,- errorMessage = previewUiState.previewErrorMessage,- modifier = modifier- )-}--// ׳’ג€ג‚¬׳’ג€ג‚¬ Screen ׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬׳’ג€ג‚¬diff --git a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.mdindex 398e90ba..f360d5ec 100644--- a/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md+++ b/docs/COMPOSE_REDUCTION_PHASE5_TRANSITIONAL_DEPENDENCIES.md@@ -128,9 +128,9 @@ The `:feature:live` module itself depends only on `:core:navigation`, `:core:ui``:domain`, `:data`, and `:player`; its boundary verifier rejects app andfeature-to-feature imports. Home and Guide ViewModels are being moved behindthe live boundary incrementally: `HomeViewModel`, the sidebar/preview surface,-the live source switcher, Home quick-filter chip row, Home reorder top bar, and-Home channel row surface are now feature-owned while the Home screen/dialog-composition remains in `:app`.+the loading/preview host supporting composables, the live source switcher, Home+quick-filter chip row, Home reorder top bar, and Home channel row surface are+now feature-owned while the Home screen/dialog composition remains in `:app`.The source switcher receives localized labels from the app at the currentcomposition boundary. Live-ownedpresentation primitives, `HomeUiState`, `HomePreviewUiState`, and Guidediff --git a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md b/docs/superpowers/plans/2026-08-28-live-feature-extraction.mdindex e2d82d16..28f87c3c 100644--- a/docs/superpowers/plans/2026-08-28-live-feature-extraction.md+++ b/docs/superpowers/plans/2026-08-28-live-feature-extraction.md@@ -18,8 +18,9 @@ golden/runtime/performance gates, and legacy app cleanup remain open; this planclaim the Live slice or Phase 5 complete.Status update (2026-08-29): `HomeViewModel`, the sidebar/preview surface, the-live source switcher, Home quick-filter chip row, Home reorder top bar, and-Home channel row surface are now feature-owned+loading/preview host supporting composables, the live source switcher, Home+quick-filter chip row, Home reorder top bar, and Home channel row surface 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.diff --git a/feature/live/src/main/java/com/streamvault/feature/live/home/HomeScreenSupportingComponents.kt b/feature/live/src/main/java/com/streamvault/feature/live/home/HomeScreenSupportingComponents.ktnew file mode 100644index 00000000..eb1fcca3--- /dev/null+++ b/feature/live/src/main/java/com/streamvault/feature/live/home/HomeScreenSupportingComponents.kt@@ -0,0 +1,78 @@+package com.streamvault.feature.live.home++import android.app.Activity+import android.view.WindowManager+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.runtime.Composable+import androidx.compose.runtime.DisposableEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.remember+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.unit.dp+import androidx.lifecycle.compose.collectAsStateWithLifecycle+import androidx.tv.material3.MaterialTheme+import androidx.tv.material3.Text+import com.streamvault.domain.model.Channel++@Composable+fun HomeLoadingPane(+ message: String,+ modifier: Modifier = Modifier+) {+ Box(+ modifier = modifier.fillMaxSize(),+ contentAlignment = Alignment.Center+ ) {+ Column(+ horizontalAlignment = Alignment.CenterHorizontally,+ verticalArrangement = Arrangement.spacedBy(16.dp)+ ) {+ androidx.compose.material3.CircularProgressIndicator(color = Color.White)+ Text(+ text = message,+ color = Color.White.copy(alpha = 0.7f),+ style = MaterialTheme.typography.bodyMedium+ )+ }+ }+}++@Composable+fun HomePreviewHost(+ viewModel: HomeViewModel,+ channels: List<Channel>,+ modifier: Modifier = Modifier+) {+ val previewUiState by viewModel.previewUiState.collectAsStateWithLifecycle()+ val previewChannel = remember(channels, previewUiState.previewChannelId) {+ channels.firstOrNull { it.id == previewUiState.previewChannelId }+ }+ val hasActivePreview = previewUiState.previewPlayerEngine != null+ val context = LocalContext.current++ DisposableEffect(hasActivePreview) {+ val window = (context as? Activity)?.window+ if (hasActivePreview) {+ window?.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)+ }+ onDispose {+ if (hasActivePreview) {+ window?.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)+ }+ }+ }++ LivePreviewPane(+ channel = previewChannel,+ playerEngine = previewUiState.previewPlayerEngine,+ isLoading = previewUiState.isPreviewLoading,+ errorMessage = previewUiState.previewErrorMessage,+ modifier = modifier+ )+}