Build the Wolfskin TV shell and navigation
This commit is contained in:
parent
de452448ba
commit
f60a22e435
97 changed files with 4363 additions and 91 deletions
|
|
@ -66,7 +66,6 @@ import com.github.damontecres.wholphin.ui.nav.Destination
|
|||
import com.github.damontecres.wholphin.ui.playback.PlayExternalViewModel
|
||||
import com.github.damontecres.wholphin.ui.showToast
|
||||
import com.github.damontecres.wholphin.ui.theme.WholphinTheme
|
||||
import com.github.damontecres.wholphin.ui.theme.colors.WolfskinThemeColors
|
||||
import com.github.damontecres.wholphin.ui.util.ProvideLocalClock
|
||||
import com.github.damontecres.wholphin.util.DebugLogTree
|
||||
import com.github.damontecres.wholphin.util.ExceptionHandler
|
||||
|
|
@ -234,7 +233,7 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
viewModel.appStart(intent)
|
||||
setContent {
|
||||
MaterialTheme(colorScheme = WolfskinThemeColors.darkScheme) {
|
||||
MaterialTheme {
|
||||
Surface(Modifier.fillMaxSize()) {
|
||||
val userPreferences by userPreferencesService.flow.collectAsState(null)
|
||||
if (userPreferences == null) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import com.github.damontecres.wholphin.services.NavigationManager
|
|||
import com.github.damontecres.wholphin.services.ScreensaverService
|
||||
import com.github.damontecres.wholphin.services.SetupDestination
|
||||
import com.github.damontecres.wholphin.ui.components.AppScreensaver
|
||||
import com.github.damontecres.wholphin.ui.nav.ApplicationContent
|
||||
import org.justinvisser.wolfskin.tv.WolfskinApp
|
||||
import com.github.damontecres.wholphin.ui.setup.SwitchServerContent
|
||||
import com.github.damontecres.wholphin.ui.setup.SwitchUserContent
|
||||
import com.github.damontecres.wholphin.ui.util.InterfaceCustomization
|
||||
|
|
@ -111,7 +111,7 @@ fun MainContent(
|
|||
}
|
||||
|
||||
if (showContent) {
|
||||
ApplicationContent(
|
||||
WolfskinApp(
|
||||
user = current.user,
|
||||
server = current.server,
|
||||
navigationManager = navigationManager,
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ sealed interface AppPreference<Pref, T> {
|
|||
val ThemeColors =
|
||||
AppChoicePreference<AppPreferences, AppThemeColors>(
|
||||
title = R.string.app_theme,
|
||||
defaultValue = AppThemeColors.WOLFSKIN,
|
||||
defaultValue = AppThemeColors.PURPLE,
|
||||
getter = { it.interfacePreferences.appThemeColors },
|
||||
setter = { prefs, value ->
|
||||
prefs.updateInterfacePreferences { appThemeColors = value }
|
||||
|
|
@ -647,6 +647,19 @@ sealed interface AppPreference<Pref, T> {
|
|||
destination = Destination.Settings(PreferenceScreenOption.ADVANCED),
|
||||
)
|
||||
|
||||
val WolfskinScreens =
|
||||
AppSwitchPreference<AppPreferences>(
|
||||
title = R.string.wolfskin_screens,
|
||||
defaultValue = true,
|
||||
getter = { org.justinvisser.wolfskin.tv.WolfskinScreenPreference.enabled },
|
||||
setter = { prefs, value ->
|
||||
org.justinvisser.wolfskin.tv.WolfskinScreenPreference.enabled = value
|
||||
prefs
|
||||
},
|
||||
summaryOn = R.string.enabled,
|
||||
summaryOff = R.string.disabled,
|
||||
)
|
||||
|
||||
val UserProfileSettings =
|
||||
AppDestinationPreference<AppPreferences>(
|
||||
title = R.string.override_user_profile_settings,
|
||||
|
|
@ -1306,6 +1319,7 @@ val advancedPreferences =
|
|||
title = R.string.ui_interface,
|
||||
preferences =
|
||||
listOf(
|
||||
AppPreference.WolfskinScreens,
|
||||
AppPreference.ShowClock,
|
||||
AppPreference.BackdropStylePref,
|
||||
AppPreference.ShowLogos,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ fun WatchedIconBackground(): Color =
|
|||
when (LocalTheme.current) {
|
||||
AppThemeColors.UNRECOGNIZED,
|
||||
AppThemeColors.PURPLE,
|
||||
AppThemeColors.WOLFSKIN,
|
||||
AppThemeColors.BLUE,
|
||||
AppThemeColors.GREEN,
|
||||
AppThemeColors.ORANGE,
|
||||
|
|
@ -56,8 +55,6 @@ fun WatchedIconBackground(): Color =
|
|||
@Composable
|
||||
fun WatchedIconColor(): Color =
|
||||
when (LocalTheme.current) {
|
||||
AppThemeColors.WOLFSKIN -> MaterialTheme.colorScheme.onPrimary
|
||||
|
||||
AppThemeColors.UNRECOGNIZED,
|
||||
AppThemeColors.PURPLE,
|
||||
AppThemeColors.BLUE,
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ fun sliderActiveColor(focused: Boolean): Color {
|
|||
return when (theme) {
|
||||
AppThemeColors.UNRECOGNIZED,
|
||||
AppThemeColors.PURPLE,
|
||||
AppThemeColors.WOLFSKIN,
|
||||
AppThemeColors.BLUE,
|
||||
AppThemeColors.GREEN,
|
||||
AppThemeColors.ORANGE,
|
||||
|
|
@ -180,7 +179,6 @@ fun sliderInactiveColor(focused: Boolean): Color {
|
|||
return when (theme) {
|
||||
AppThemeColors.UNRECOGNIZED,
|
||||
AppThemeColors.PURPLE,
|
||||
AppThemeColors.WOLFSKIN,
|
||||
-> {
|
||||
MaterialTheme.colorScheme.border
|
||||
.copy(alpha = .25f)
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ import java.util.UUID
|
|||
sealed class Destination(
|
||||
val fullScreen: Boolean = false,
|
||||
) : NavKey {
|
||||
@Serializable
|
||||
data class Wolfskin(val route: String) : Destination(false)
|
||||
|
||||
@Serializable
|
||||
data class Home(
|
||||
val id: Long = 0L,
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ fun DestinationContent(
|
|||
LaunchedEffect(Unit) { onClearBackdrop.invoke() }
|
||||
}
|
||||
when (destination) {
|
||||
is Destination.Wolfskin -> {
|
||||
org.justinvisser.wolfskin.tv.WolfskinDestinationContent(destination.route, modifier)
|
||||
}
|
||||
|
||||
is Destination.Home -> {
|
||||
HomePage(
|
||||
preferences = preferences,
|
||||
|
|
|
|||
|
|
@ -771,7 +771,6 @@ fun navItemColor(
|
|||
when (theme) {
|
||||
AppThemeColors.UNRECOGNIZED,
|
||||
AppThemeColors.PURPLE,
|
||||
AppThemeColors.WOLFSKIN,
|
||||
AppThemeColors.BLUE,
|
||||
AppThemeColors.GREEN,
|
||||
AppThemeColors.ORANGE,
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ fun SwitchColors(): SwitchColors {
|
|||
return when (theme) {
|
||||
AppThemeColors.UNRECOGNIZED,
|
||||
AppThemeColors.PURPLE,
|
||||
AppThemeColors.WOLFSKIN,
|
||||
AppThemeColors.BLUE,
|
||||
-> {
|
||||
SwitchDefaults.colors()
|
||||
|
|
|
|||
|
|
@ -13,10 +13,9 @@ import com.github.damontecres.wholphin.ui.theme.colors.OledThemeColors
|
|||
import com.github.damontecres.wholphin.ui.theme.colors.OrangeThemeColors
|
||||
import com.github.damontecres.wholphin.ui.theme.colors.PurpleThemeColors
|
||||
import com.github.damontecres.wholphin.ui.theme.colors.RedThemeColors
|
||||
import com.github.damontecres.wholphin.ui.theme.colors.WolfskinThemeColors
|
||||
|
||||
val LocalTheme =
|
||||
compositionLocalOf<AppThemeColors> { AppThemeColors.WOLFSKIN }
|
||||
compositionLocalOf<AppThemeColors> { AppThemeColors.PURPLE }
|
||||
|
||||
fun getThemeColors(appThemeColors: AppThemeColors): ThemeColors =
|
||||
when (appThemeColors) {
|
||||
|
|
@ -28,14 +27,13 @@ fun getThemeColors(appThemeColors: AppThemeColors): ThemeColors =
|
|||
AppThemeColors.BOLD_BLUE -> BoldBlueThemeColors
|
||||
AppThemeColors.RED -> RedThemeColors
|
||||
AppThemeColors.BROWN -> BrownThemeColors
|
||||
AppThemeColors.WOLFSKIN -> WolfskinThemeColors
|
||||
AppThemeColors.UNRECOGNIZED -> WolfskinThemeColors
|
||||
AppThemeColors.UNRECOGNIZED -> PurpleThemeColors
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun WholphinTheme(
|
||||
darkTheme: Boolean = true,
|
||||
appThemeColors: AppThemeColors = AppThemeColors.WOLFSKIN,
|
||||
appThemeColors: AppThemeColors = AppThemeColors.PURPLE,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val themeColors = getThemeColors(appThemeColors)
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
package com.github.damontecres.wholphin.ui.theme.colors
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import com.github.damontecres.wholphin.ui.theme.ThemeColors
|
||||
|
||||
/** Lilac accents on near-black surfaces, with upstream Purple available separately. */
|
||||
val WolfskinThemeColors =
|
||||
object : ThemeColors {
|
||||
private val background = Color(0xFF07070A)
|
||||
private val lilac = Color(0xFFD2BCFF)
|
||||
private val onLilac = Color(0xFF241334)
|
||||
private val container = Color(0xFF382A49)
|
||||
private val onContainer = Color(0xFFEADCFF)
|
||||
private val surfaceVariant = Color(0xFF24202D)
|
||||
|
||||
override val lightSchemeMaterial = PurpleThemeColors.lightSchemeMaterial
|
||||
override val lightScheme = PurpleThemeColors.lightScheme
|
||||
|
||||
override val darkSchemeMaterial =
|
||||
PurpleThemeColors.darkSchemeMaterial.copy(
|
||||
primary = lilac,
|
||||
onPrimary = onLilac,
|
||||
primaryContainer = container,
|
||||
onPrimaryContainer = onContainer,
|
||||
secondary = lilac,
|
||||
onSecondary = onLilac,
|
||||
secondaryContainer = container,
|
||||
onSecondaryContainer = onContainer,
|
||||
tertiary = lilac,
|
||||
onTertiary = onLilac,
|
||||
tertiaryContainer = container,
|
||||
onTertiaryContainer = onContainer,
|
||||
background = background,
|
||||
surface = background,
|
||||
surfaceVariant = surfaceVariant,
|
||||
inversePrimary = Color(0xFF705090),
|
||||
)
|
||||
|
||||
override val darkScheme =
|
||||
PurpleThemeColors.darkScheme.copy(
|
||||
primary = lilac,
|
||||
onPrimary = onLilac,
|
||||
primaryContainer = container,
|
||||
onPrimaryContainer = onContainer,
|
||||
secondary = lilac,
|
||||
onSecondary = onLilac,
|
||||
secondaryContainer = container,
|
||||
onSecondaryContainer = onContainer,
|
||||
tertiary = lilac,
|
||||
onTertiary = onLilac,
|
||||
tertiaryContainer = container,
|
||||
onTertiaryContainer = onContainer,
|
||||
background = background,
|
||||
surface = background,
|
||||
surfaceVariant = surfaceVariant,
|
||||
inversePrimary = Color(0xFF705090),
|
||||
border = lilac.copy(alpha = .75f),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue