Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

Added a welcome-screen "Set up later" option

Jorge Ceballos80478af972a1
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/welcome/WelcomeScreen.kt b/app/src/main/java/com/streamvault/app/ui/screens/welcome/WelcomeScreen.kt
index 79e0983a..906b510a 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/welcome/WelcomeScreen.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/welcome/WelcomeScreen.kt
@@ -1,31 +1,33 @@
package com.streamvault.app.ui.screens.welcome
import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
-import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.runtime.Composable
-import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.compose.runtime.LaunchedEffect
-import androidx.lifecycle.compose.collectAsStateWithLifecycle
-import androidx.compose.runtime.collectAsState
-import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.ViewModel
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewModelScope
-import androidx.compose.material3.CircularProgressIndicator
+import androidx.tv.material3.ButtonDefaults
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Surface
import androidx.tv.material3.SurfaceDefaults
@@ -33,6 +35,7 @@ import androidx.tv.material3.Text
import com.streamvault.app.R
import com.streamvault.app.ui.components.shell.StatusPill
import com.streamvault.app.ui.design.AppColors
+import com.streamvault.app.ui.interaction.TvButton
import com.streamvault.domain.repository.ProviderRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
@@ -70,7 +73,7 @@ fun WelcomeScreen(
LaunchedEffect(hasProviders) {
when (hasProviders) {
true -> onNavigateToHome()
- false -> onNavigateToSetup()
+ false -> Unit
null -> Unit
}
}
@@ -90,35 +93,113 @@ fun WelcomeScreen(
)
)
- Surface(
- modifier = Modifier
- .align(Alignment.Center)
- .padding(32.dp),
- shape = RoundedCornerShape(28.dp),
- colors = SurfaceDefaults.colors(containerColor = AppColors.Surface.copy(alpha = 0.9f))
+ when (hasProviders) {
+ false -> WelcomeStartCard(
+ onNavigateToHome = onNavigateToHome,
+ onNavigateToSetup = onNavigateToSetup,
+ modifier = Modifier
+ .align(Alignment.Center)
+ .padding(32.dp)
+ )
+
+ else -> WelcomeLoadingCard(
+ modifier = Modifier
+ .align(Alignment.Center)
+ .padding(32.dp)
+ )
+ }
+ }
+}
+
+@Composable
+private fun WelcomeLoadingCard(modifier: Modifier = Modifier) {
+ Surface(
+ modifier = modifier,
+ shape = RoundedCornerShape(28.dp),
+ colors = SurfaceDefaults.colors(containerColor = AppColors.Surface.copy(alpha = 0.9f))
+ ) {
+ Column(
+ modifier = Modifier.padding(horizontal = 36.dp, vertical = 28.dp),
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ StatusPill(
+ label = stringResource(R.string.app_name),
+ containerColor = AppColors.BrandMuted
+ )
+ Spacer(modifier = Modifier.height(18.dp))
+ CircularProgressIndicator(color = AppColors.Brand)
+ Spacer(modifier = Modifier.height(18.dp))
+ Text(
+ text = stringResource(R.string.welcome_loading_title),
+ style = MaterialTheme.typography.titleLarge,
+ color = AppColors.TextPrimary
+ )
+ Spacer(modifier = Modifier.height(6.dp))
+ Text(
+ text = stringResource(R.string.welcome_loading_subtitle),
+ style = MaterialTheme.typography.bodyLarge,
+ color = AppColors.TextSecondary
+ )
+ }
+ }
+}
+
+@Composable
+private fun WelcomeStartCard(
+ onNavigateToHome: () -> Unit,
+ onNavigateToSetup: () -> Unit,
+ modifier: Modifier = Modifier
+) {
+ Surface(
+ modifier = modifier
+ .widthIn(max = 720.dp)
+ .fillMaxWidth(),
+ shape = RoundedCornerShape(28.dp),
+ colors = SurfaceDefaults.colors(containerColor = AppColors.Surface.copy(alpha = 0.9f))
+ ) {
+ Column(
+ modifier = Modifier.padding(horizontal = 40.dp, vertical = 34.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.spacedBy(18.dp)
) {
- Column(
- modifier = Modifier.padding(horizontal = 36.dp, vertical = 28.dp),
- horizontalAlignment = Alignment.CenterHorizontally
+ StatusPill(
+ label = stringResource(R.string.app_name),
+ containerColor = AppColors.BrandMuted
+ )
+ Text(
+ text = stringResource(R.string.welcome_tagline),
+ style = MaterialTheme.typography.headlineMedium,
+ color = AppColors.TextPrimary,
+ textAlign = TextAlign.Center
+ )
+ Text(
+ text = stringResource(R.string.welcome_subtitle),
+ style = MaterialTheme.typography.bodyLarge,
+ color = AppColors.TextSecondary,
+ textAlign = TextAlign.Center
+ )
+ Row(
+ modifier = Modifier.fillMaxWidth(),
+ horizontalArrangement = Arrangement.spacedBy(14.dp),
+ verticalAlignment = Alignment.CenterVertically
) {
- StatusPill(
- label = stringResource(R.string.app_name),
- containerColor = AppColors.BrandMuted
- )
- Spacer(modifier = Modifier.height(18.dp))
- CircularProgressIndicator(color = AppColors.Brand)
- Spacer(modifier = Modifier.height(18.dp))
- Text(
- text = stringResource(R.string.welcome_loading_title),
- style = MaterialTheme.typography.titleLarge,
- color = AppColors.TextPrimary
- )
- Spacer(modifier = Modifier.height(6.dp))
- Text(
- text = stringResource(R.string.welcome_loading_subtitle),
- style = MaterialTheme.typography.bodyLarge,
- color = AppColors.TextSecondary
- )
+ TvButton(
+ onClick = onNavigateToSetup,
+ modifier = Modifier.weight(1f)
+ ) {
+ Text(text = stringResource(R.string.welcome_setup_provider))
+ }
+ TvButton(
+ onClick = onNavigateToHome,
+ modifier = Modifier.weight(1f),
+ colors = ButtonDefaults.colors(
+ containerColor = AppColors.SurfaceElevated,
+ focusedContainerColor = AppColors.BrandMuted,
+ contentColor = AppColors.TextPrimary
+ )
+ ) {
+ Text(text = stringResource(R.string.welcome_setup_later))
+ }
}
}
}
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 9a79e3d8..99942359 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -10,6 +10,7 @@
<string name="welcome_enter_app">Entrar en la app</string>
<string name="welcome_manage_providers">Administrar proveedores</string>
<string name="welcome_setup_provider">Configurar proveedor</string>
+ <string name="welcome_setup_later">Configurar más adelante</string>
<string name="welcome_version">v1.0.3</string>
<string name="welcome_loading_title">Preparando tu biblioteca</string>
<string name="welcome_loading_subtitle">Abriendo la pantalla derecha para este dispositivo.</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3819ffaf..135518f3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -15,6 +15,7 @@
<string name="welcome_enter_app">Enter App</string>
<string name="welcome_manage_providers">Manage Providers</string>
<string name="welcome_setup_provider">Setup Provider</string>
+ <string name="welcome_setup_later">Set up later</string>
<string name="welcome_version">v1.0.3</string>
<string name="welcome_loading_title">Preparing your library</string>
<string name="welcome_loading_subtitle">Opening the right screen for this device.</string>
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 6022a917..aff3b686 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -9,6 +9,7 @@ All notable product changes are recorded in this document.
- Added APK companion plugin support with discovery, activation, capability sync, and plugin provider integration.
- Added plugin installation from APK URL and local file picker, plus automatic detection of compatible plugins installed manually by the user.
- Added a host-rendered plugin configuration schema so plugins can expose StreamVault-native settings screens, persisted values, validation, and plugin actions over IPC.
+- Added a welcome-screen "Set up later" option so first-time users can enter the app and reach Settings before adding a provider.
### Changed