refactor(tv): move background gradient to theme
This commit is contained in:
parent
96288db877
commit
2b6649e0ce
22 changed files with 331 additions and 466 deletions
|
@ -4,13 +4,6 @@ import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.graphics.RectangleShape
|
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
|
||||||
import androidx.tv.material3.MaterialTheme
|
|
||||||
import androidx.tv.material3.NonInteractiveSurfaceDefaults
|
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import com.ramcosta.composedestinations.DestinationsNavHost
|
import com.ramcosta.composedestinations.DestinationsNavHost
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import dev.jdtech.jellyfin.database.ServerDatabaseDao
|
import dev.jdtech.jellyfin.database.ServerDatabaseDao
|
||||||
|
@ -32,7 +25,6 @@ class MainActivity : ComponentActivity() {
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var appPreferences: AppPreferences
|
lateinit var appPreferences: AppPreferences
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
@ -48,18 +40,10 @@ class MainActivity : ComponentActivity() {
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface(
|
DestinationsNavHost(
|
||||||
colors = NonInteractiveSurfaceDefaults.colors(
|
navGraph = NavGraphs.root,
|
||||||
containerColor = MaterialTheme.colorScheme.background,
|
startRoute = startRoute,
|
||||||
),
|
)
|
||||||
shape = RectangleShape,
|
|
||||||
modifier = Modifier.fillMaxSize(),
|
|
||||||
) {
|
|
||||||
DestinationsNavHost(
|
|
||||||
navGraph = NavGraphs.root,
|
|
||||||
startRoute = startRoute,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
@ -24,8 +23,6 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
@ -39,7 +36,6 @@ import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.Icon
|
import androidx.tv.material3.Icon
|
||||||
import androidx.tv.material3.LocalContentColor
|
import androidx.tv.material3.LocalContentColor
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -92,8 +88,7 @@ private fun AddServerScreenLayout(
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize(),
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721)))),
|
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
@ -179,16 +174,13 @@ private fun AddServerScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun AddServerScreenLayoutPreview() {
|
private fun AddServerScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
AddServerScreenLayout(
|
||||||
AddServerScreenLayout(
|
uiState = AddServerViewModel.UiState.Normal,
|
||||||
uiState = AddServerViewModel.UiState.Normal,
|
onConnectClick = {},
|
||||||
onConnectClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ import androidx.tv.foundation.lazy.list.TvLazyRow
|
||||||
import androidx.tv.foundation.lazy.list.items
|
import androidx.tv.foundation.lazy.list.items
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -179,18 +178,15 @@ private fun HomeScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun HomeScreenLayoutPreview() {
|
private fun HomeScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
HomeScreenLayout(
|
||||||
HomeScreenLayout(
|
uiState = HomeViewModel.UiState.Normal(dummyHomeItems),
|
||||||
uiState = HomeViewModel.UiState.Normal(dummyHomeItems),
|
isLoading = {},
|
||||||
isLoading = {},
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import androidx.tv.foundation.lazy.grid.TvLazyVerticalGrid
|
||||||
import androidx.tv.foundation.lazy.grid.items
|
import androidx.tv.foundation.lazy.grid.items
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
import dev.jdtech.jellyfin.destinations.LibraryScreenDestination
|
import dev.jdtech.jellyfin.destinations.LibraryScreenDestination
|
||||||
|
@ -102,17 +101,14 @@ private fun LibrariesScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun LibrariesScreenLayoutPreview() {
|
private fun LibrariesScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
LibrariesScreenLayout(
|
||||||
LibrariesScreenLayout(
|
uiState = MediaViewModel.UiState.Normal(dummyCollections),
|
||||||
uiState = MediaViewModel.UiState.Normal(dummyCollections),
|
isLoading = {},
|
||||||
isLoading = {},
|
onClick = { _, _, _ -> },
|
||||||
onClick = { _, _, _ -> },
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
@ -12,8 +11,6 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
|
@ -23,7 +20,6 @@ import androidx.tv.foundation.lazy.grid.TvGridItemSpan
|
||||||
import androidx.tv.foundation.lazy.grid.TvLazyVerticalGrid
|
import androidx.tv.foundation.lazy.grid.TvLazyVerticalGrid
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -94,7 +90,6 @@ private fun LibraryScreenLayout(
|
||||||
contentPadding = PaddingValues(horizontal = MaterialTheme.spacings.default * 2, vertical = MaterialTheme.spacings.large),
|
contentPadding = PaddingValues(horizontal = MaterialTheme.spacings.default * 2, vertical = MaterialTheme.spacings.large),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721))))
|
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
) {
|
) {
|
||||||
item(span = { TvGridItemSpan(this.maxLineSpan) }) {
|
item(span = { TvGridItemSpan(this.maxLineSpan) }) {
|
||||||
|
@ -126,18 +121,15 @@ private fun LibraryScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun LibraryScreenLayoutPreview() {
|
private fun LibraryScreenLayoutPreview() {
|
||||||
val data: Flow<PagingData<FindroidItem>> = flowOf(PagingData.from(dummyMovies))
|
val data: Flow<PagingData<FindroidItem>> = flowOf(PagingData.from(dummyMovies))
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
LibraryScreenLayout(
|
||||||
LibraryScreenLayout(
|
libraryName = "Movies",
|
||||||
libraryName = "Movies",
|
uiState = LibraryViewModel.UiState.Normal(data),
|
||||||
uiState = LibraryViewModel.UiState.Normal(data),
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
@ -24,8 +23,6 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
|
@ -40,7 +37,6 @@ import androidx.tv.material3.Icon
|
||||||
import androidx.tv.material3.LocalContentColor
|
import androidx.tv.material3.LocalContentColor
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.OutlinedButton
|
import androidx.tv.material3.OutlinedButton
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -124,8 +120,7 @@ private fun LoginScreenLayout(
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize(),
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721)))),
|
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
@ -254,34 +249,28 @@ private fun LoginScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun LoginScreenLayoutPreview() {
|
private fun LoginScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
LoginScreenLayout(
|
||||||
LoginScreenLayout(
|
uiState = LoginViewModel.UiState.Normal,
|
||||||
uiState = LoginViewModel.UiState.Normal,
|
quickConnectUiState = LoginViewModel.QuickConnectUiState.Normal,
|
||||||
quickConnectUiState = LoginViewModel.QuickConnectUiState.Normal,
|
onLoginClick = { _, _ -> },
|
||||||
onLoginClick = { _, _ -> },
|
onQuickConnectClick = {},
|
||||||
onQuickConnectClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun LoginScreenLayoutPreviewError() {
|
private fun LoginScreenLayoutPreviewError() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
LoginScreenLayout(
|
||||||
LoginScreenLayout(
|
uiState = LoginViewModel.UiState.Error(UiText.DynamicString("Invalid username or password")),
|
||||||
uiState = LoginViewModel.UiState.Error(UiText.DynamicString("Invalid username or password")),
|
quickConnectUiState = LoginViewModel.QuickConnectUiState.Normal,
|
||||||
quickConnectUiState = LoginViewModel.QuickConnectUiState.Normal,
|
onLoginClick = { _, _ -> },
|
||||||
onLoginClick = { _, _ -> },
|
onQuickConnectClick = {},
|
||||||
onQuickConnectClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
@ -24,7 +23,6 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
@ -34,7 +32,6 @@ import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.Icon
|
import androidx.tv.material3.Icon
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Tab
|
import androidx.tv.material3.Tab
|
||||||
import androidx.tv.material3.TabDefaults
|
import androidx.tv.material3.TabDefaults
|
||||||
import androidx.tv.material3.TabRow
|
import androidx.tv.material3.TabRow
|
||||||
|
@ -102,8 +99,7 @@ private fun MainScreenLayout(
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize(),
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721)))),
|
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
@ -195,16 +191,13 @@ private fun MainScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun MainScreenLayoutPreview() {
|
private fun MainScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
MainScreenLayout(
|
||||||
MainScreenLayout(
|
uiState = MainViewModel.UiState.Normal(server = dummyServer, user = dummyUser),
|
||||||
uiState = MainViewModel.UiState.Normal(server = dummyServer, user = dummyUser),
|
navigator = EmptyDestinationsNavigator,
|
||||||
navigator = EmptyDestinationsNavigator,
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.Icon
|
import androidx.tv.material3.Icon
|
||||||
import androidx.tv.material3.LocalContentColor
|
import androidx.tv.material3.LocalContentColor
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
|
@ -335,41 +334,38 @@ private fun MovieScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun MovieScreenLayoutPreview() {
|
private fun MovieScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
MovieScreenLayout(
|
||||||
MovieScreenLayout(
|
uiState = MovieViewModel.UiState.Normal(
|
||||||
uiState = MovieViewModel.UiState.Normal(
|
item = dummyMovie,
|
||||||
item = dummyMovie,
|
actors = emptyList(),
|
||||||
actors = emptyList(),
|
director = BaseItemPerson(
|
||||||
director = BaseItemPerson(
|
id = UUID.randomUUID(),
|
||||||
id = UUID.randomUUID(),
|
name = "Robert Rodriguez",
|
||||||
name = "Robert Rodriguez",
|
|
||||||
),
|
|
||||||
writers = emptyList(),
|
|
||||||
videoMetadata = VideoMetadata(
|
|
||||||
resolution = listOf(Resolution.UHD),
|
|
||||||
displayProfiles = listOf(DisplayProfile.HDR10),
|
|
||||||
audioChannels = listOf(AudioChannel.CH_5_1),
|
|
||||||
audioCodecs = listOf(AudioCodec.EAC3),
|
|
||||||
isAtmos = listOf(false),
|
|
||||||
),
|
|
||||||
writersString = "James Cameron, Laeta Kalogridis, Yukito Kishiro",
|
|
||||||
genresString = "Action, Science Fiction, Adventure",
|
|
||||||
videoString = "",
|
|
||||||
audioString = "",
|
|
||||||
subtitleString = "",
|
|
||||||
runTime = "121 min",
|
|
||||||
dateString = "2019",
|
|
||||||
),
|
),
|
||||||
onPlayClick = {},
|
writers = emptyList(),
|
||||||
onTrailerClick = {},
|
videoMetadata = VideoMetadata(
|
||||||
onPlayedClick = {},
|
resolution = listOf(Resolution.UHD),
|
||||||
onFavoriteClick = {},
|
displayProfiles = listOf(DisplayProfile.HDR10),
|
||||||
)
|
audioChannels = listOf(AudioChannel.CH_5_1),
|
||||||
}
|
audioCodecs = listOf(AudioCodec.EAC3),
|
||||||
|
isAtmos = listOf(false),
|
||||||
|
),
|
||||||
|
writersString = "James Cameron, Laeta Kalogridis, Yukito Kishiro",
|
||||||
|
genresString = "Action, Science Fiction, Adventure",
|
||||||
|
videoString = "",
|
||||||
|
audioString = "",
|
||||||
|
subtitleString = "",
|
||||||
|
runTime = "121 min",
|
||||||
|
dateString = "2019",
|
||||||
|
),
|
||||||
|
onPlayClick = {},
|
||||||
|
onTrailerClick = {},
|
||||||
|
onPlayedClick = {},
|
||||||
|
onFavoriteClick = {},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
@ -16,15 +14,12 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.tv.foundation.lazy.list.TvLazyColumn
|
import androidx.tv.foundation.lazy.list.TvLazyColumn
|
||||||
import androidx.tv.foundation.lazy.list.items
|
import androidx.tv.foundation.lazy.list.items
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -95,57 +90,51 @@ private fun SeasonScreenLayout(
|
||||||
is SeasonViewModel.UiState.Loading -> Text(text = "LOADING")
|
is SeasonViewModel.UiState.Loading -> Text(text = "LOADING")
|
||||||
is SeasonViewModel.UiState.Normal -> {
|
is SeasonViewModel.UiState.Normal -> {
|
||||||
val episodes = uiState.episodes
|
val episodes = uiState.episodes
|
||||||
Box(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier.fillMaxSize(),
|
||||||
.fillMaxSize()
|
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721)))),
|
|
||||||
) {
|
) {
|
||||||
Row(
|
Column(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier
|
||||||
) {
|
.weight(1f)
|
||||||
Column(
|
.padding(
|
||||||
modifier = Modifier
|
start = MaterialTheme.spacings.extraLarge,
|
||||||
.weight(1f)
|
|
||||||
.padding(
|
|
||||||
start = MaterialTheme.spacings.extraLarge,
|
|
||||||
top = MaterialTheme.spacings.large,
|
|
||||||
end = MaterialTheme.spacings.large,
|
|
||||||
),
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = seasonName,
|
|
||||||
style = MaterialTheme.typography.displayMedium,
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = seriesName,
|
|
||||||
style = MaterialTheme.typography.headlineMedium,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
TvLazyColumn(
|
|
||||||
contentPadding = PaddingValues(
|
|
||||||
top = MaterialTheme.spacings.large,
|
top = MaterialTheme.spacings.large,
|
||||||
bottom = MaterialTheme.spacings.large,
|
end = MaterialTheme.spacings.large,
|
||||||
),
|
),
|
||||||
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacings.medium),
|
) {
|
||||||
modifier = Modifier
|
Text(
|
||||||
.weight(2f)
|
text = seasonName,
|
||||||
.padding(end = MaterialTheme.spacings.extraLarge)
|
style = MaterialTheme.typography.displayMedium,
|
||||||
.focusRequester(focusRequester),
|
)
|
||||||
) {
|
Text(
|
||||||
items(episodes) { episodeItem ->
|
text = seriesName,
|
||||||
when (episodeItem) {
|
style = MaterialTheme.typography.headlineMedium,
|
||||||
is EpisodeItem.Episode -> {
|
)
|
||||||
EpisodeCard(episode = episodeItem.episode, onClick = { onClick(episodeItem.episode) })
|
}
|
||||||
}
|
TvLazyColumn(
|
||||||
|
contentPadding = PaddingValues(
|
||||||
else -> Unit
|
top = MaterialTheme.spacings.large,
|
||||||
|
bottom = MaterialTheme.spacings.large,
|
||||||
|
),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(MaterialTheme.spacings.medium),
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(2f)
|
||||||
|
.padding(end = MaterialTheme.spacings.extraLarge)
|
||||||
|
.focusRequester(focusRequester),
|
||||||
|
) {
|
||||||
|
items(episodes) { episodeItem ->
|
||||||
|
when (episodeItem) {
|
||||||
|
is EpisodeItem.Episode -> {
|
||||||
|
EpisodeCard(episode = episodeItem.episode, onClick = { onClick(episodeItem.episode) })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else -> Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LaunchedEffect(true) {
|
LaunchedEffect(true) {
|
||||||
focusRequester.requestFocus()
|
focusRequester.requestFocus()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,18 +142,15 @@ private fun SeasonScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun SeasonScreenLayoutPreview() {
|
private fun SeasonScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SeasonScreenLayout(
|
||||||
SeasonScreenLayout(
|
seriesName = "86 EIGHTY-SIX",
|
||||||
seriesName = "86 EIGHTY-SIX",
|
seasonName = "Season 1",
|
||||||
seasonName = "Season 1",
|
uiState = SeasonViewModel.UiState.Normal(dummyEpisodeItems),
|
||||||
uiState = SeasonViewModel.UiState.Normal(dummyEpisodeItems),
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
@ -24,7 +23,6 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.pluralStringResource
|
import androidx.compose.ui.res.pluralStringResource
|
||||||
|
@ -136,8 +134,7 @@ private fun ServerSelectScreenLayout(
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize(),
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721)))),
|
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
@ -204,57 +201,48 @@ private fun ServerSelectScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ServerSelectScreenLayoutPreview() {
|
private fun ServerSelectScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ServerSelectScreenLayout(
|
||||||
ServerSelectScreenLayout(
|
uiState = ServerSelectViewModel.UiState.Normal(dummyServers),
|
||||||
uiState = ServerSelectViewModel.UiState.Normal(dummyServers),
|
discoveredServersState = ServerSelectViewModel.DiscoveredServersState.Servers(
|
||||||
discoveredServersState = ServerSelectViewModel.DiscoveredServersState.Servers(
|
dummyDiscoveredServers,
|
||||||
dummyDiscoveredServers,
|
),
|
||||||
),
|
onServerClick = {},
|
||||||
onServerClick = {},
|
onAddServerClick = {},
|
||||||
onAddServerClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ServerSelectScreenLayoutPreviewNoDiscovered() {
|
private fun ServerSelectScreenLayoutPreviewNoDiscovered() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ServerSelectScreenLayout(
|
||||||
ServerSelectScreenLayout(
|
uiState = ServerSelectViewModel.UiState.Normal(dummyServers),
|
||||||
uiState = ServerSelectViewModel.UiState.Normal(dummyServers),
|
discoveredServersState = ServerSelectViewModel.DiscoveredServersState.Servers(
|
||||||
discoveredServersState = ServerSelectViewModel.DiscoveredServersState.Servers(
|
emptyList(),
|
||||||
emptyList(),
|
),
|
||||||
),
|
onServerClick = {},
|
||||||
onServerClick = {},
|
onAddServerClick = {},
|
||||||
onAddServerClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ServerSelectScreenLayoutPreviewNoServers() {
|
private fun ServerSelectScreenLayoutPreviewNoServers() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ServerSelectScreenLayout(
|
||||||
ServerSelectScreenLayout(
|
uiState = ServerSelectViewModel.UiState.Normal(emptyList()),
|
||||||
uiState = ServerSelectViewModel.UiState.Normal(emptyList()),
|
discoveredServersState = ServerSelectViewModel.DiscoveredServersState.Servers(
|
||||||
discoveredServersState = ServerSelectViewModel.DiscoveredServersState.Servers(
|
emptyList(),
|
||||||
emptyList(),
|
),
|
||||||
),
|
onServerClick = {},
|
||||||
onServerClick = {},
|
onAddServerClick = {},
|
||||||
onAddServerClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,27 +312,21 @@ private fun ServerComponent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ServerComponentPreview() {
|
private fun ServerComponentPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ServerComponent(dummyDiscoveredServer)
|
||||||
ServerComponent(dummyDiscoveredServer)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ServerComponentPreviewDiscovered() {
|
private fun ServerComponentPreviewDiscovered() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ServerComponent(
|
||||||
ServerComponent(
|
server = dummyDiscoveredServer,
|
||||||
server = dummyDiscoveredServer,
|
discovered = true,
|
||||||
discovered = true,
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
@ -12,8 +11,6 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.res.stringArrayResource
|
import androidx.compose.ui.res.stringArrayResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
@ -24,7 +21,6 @@ import androidx.tv.foundation.lazy.grid.TvLazyVerticalGrid
|
||||||
import androidx.tv.foundation.lazy.grid.items
|
import androidx.tv.foundation.lazy.grid.items
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -101,7 +97,6 @@ private fun SettingsScreenLayout(
|
||||||
contentPadding = PaddingValues(horizontal = MaterialTheme.spacings.default * 2, vertical = MaterialTheme.spacings.large),
|
contentPadding = PaddingValues(horizontal = MaterialTheme.spacings.default * 2, vertical = MaterialTheme.spacings.large),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721))))
|
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
) {
|
) {
|
||||||
item(span = { TvGridItemSpan(this.maxLineSpan) }) {
|
item(span = { TvGridItemSpan(this.maxLineSpan) }) {
|
||||||
|
@ -143,27 +138,24 @@ private fun SettingsScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsScreenLayoutPreview() {
|
private fun SettingsScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsScreenLayout(
|
||||||
SettingsScreenLayout(
|
uiState = SettingsViewModel.UiState.Normal(
|
||||||
uiState = SettingsViewModel.UiState.Normal(
|
listOf(
|
||||||
listOf(
|
PreferenceCategory(
|
||||||
PreferenceCategory(
|
nameStringResource = CoreR.string.settings_category_language,
|
||||||
nameStringResource = CoreR.string.settings_category_language,
|
iconDrawableId = CoreR.drawable.ic_languages,
|
||||||
iconDrawableId = CoreR.drawable.ic_languages,
|
),
|
||||||
),
|
PreferenceCategory(
|
||||||
PreferenceCategory(
|
nameStringResource = CoreR.string.settings_category_appearance,
|
||||||
nameStringResource = CoreR.string.settings_category_appearance,
|
iconDrawableId = CoreR.drawable.ic_palette,
|
||||||
iconDrawableId = CoreR.drawable.ic_palette,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onUpdate = {},
|
),
|
||||||
)
|
onUpdate = {},
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
@ -20,8 +19,6 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.focus.onFocusChanged
|
import androidx.compose.ui.focus.onFocusChanged
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.res.stringArrayResource
|
import androidx.compose.ui.res.stringArrayResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
@ -30,7 +27,6 @@ import androidx.tv.foundation.lazy.list.TvLazyColumn
|
||||||
import androidx.tv.foundation.lazy.list.items
|
import androidx.tv.foundation.lazy.list.items
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
|
@ -111,7 +107,6 @@ private fun SettingsSubScreenLayout(
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721))))
|
|
||||||
.padding(
|
.padding(
|
||||||
start = MaterialTheme.spacings.large,
|
start = MaterialTheme.spacings.large,
|
||||||
top = MaterialTheme.spacings.default * 2,
|
top = MaterialTheme.spacings.default * 2,
|
||||||
|
@ -223,27 +218,24 @@ private fun SettingsSubScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsSubScreenLayoutPreview() {
|
private fun SettingsSubScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsSubScreenLayout(
|
||||||
SettingsSubScreenLayout(
|
uiState = SettingsViewModel.UiState.Normal(
|
||||||
uiState = SettingsViewModel.UiState.Normal(
|
listOf(
|
||||||
listOf(
|
PreferenceSelect(
|
||||||
PreferenceSelect(
|
nameStringResource = CoreR.string.pref_player_mpv_hwdec,
|
||||||
nameStringResource = CoreR.string.pref_player_mpv_hwdec,
|
backendName = Constants.PREF_PLAYER_MPV_HWDEC,
|
||||||
backendName = Constants.PREF_PLAYER_MPV_HWDEC,
|
backendDefaultValue = "mediacodec",
|
||||||
backendDefaultValue = "mediacodec",
|
options = CoreR.array.mpv_hwdec,
|
||||||
options = CoreR.array.mpv_hwdec,
|
optionValues = CoreR.array.mpv_hwdec,
|
||||||
optionValues = CoreR.array.mpv_hwdec,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title = CoreR.string.settings_category_player,
|
),
|
||||||
onUpdate = {},
|
title = CoreR.string.settings_category_player,
|
||||||
)
|
onUpdate = {},
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,6 @@ import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.Icon
|
import androidx.tv.material3.Icon
|
||||||
import androidx.tv.material3.LocalContentColor
|
import androidx.tv.material3.LocalContentColor
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
|
@ -394,31 +393,28 @@ private fun ShowScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ShowScreenLayoutPreview() {
|
private fun ShowScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ShowScreenLayout(
|
||||||
ShowScreenLayout(
|
uiState = ShowViewModel.UiState.Normal(
|
||||||
uiState = ShowViewModel.UiState.Normal(
|
item = dummyShow,
|
||||||
item = dummyShow,
|
actors = emptyList(),
|
||||||
actors = emptyList(),
|
director = null,
|
||||||
director = null,
|
writers = emptyList(),
|
||||||
writers = emptyList(),
|
writersString = "Hiroshi Seko, Hajime Isayama",
|
||||||
writersString = "Hiroshi Seko, Hajime Isayama",
|
genresString = "Action, Science Fiction, Adventure",
|
||||||
genresString = "Action, Science Fiction, Adventure",
|
runTime = "0 min",
|
||||||
runTime = "0 min",
|
dateString = "2013 - 2023",
|
||||||
dateString = "2013 - 2023",
|
nextUp = null,
|
||||||
nextUp = null,
|
seasons = emptyList(),
|
||||||
seasons = emptyList(),
|
),
|
||||||
),
|
onPlayClick = {},
|
||||||
onPlayClick = {},
|
onTrailerClick = {},
|
||||||
onTrailerClick = {},
|
onPlayedClick = {},
|
||||||
onPlayedClick = {},
|
onFavoriteClick = {},
|
||||||
onFavoriteClick = {},
|
onSeasonClick = {},
|
||||||
onSeasonClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package dev.jdtech.jellyfin.ui
|
package dev.jdtech.jellyfin.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
@ -22,7 +21,6 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
@ -124,8 +122,7 @@ private fun UserSelectScreenLayout(
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize(),
|
||||||
.background(Brush.linearGradient(listOf(Color.Black, Color(0xFF001721)))),
|
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
@ -181,35 +178,29 @@ private fun UserSelectScreenLayout(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun UserSelectScreenLayoutPreview() {
|
private fun UserSelectScreenLayoutPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
UserSelectScreenLayout(
|
||||||
UserSelectScreenLayout(
|
uiState = UserSelectViewModel.UiState.Normal(dummyServer, dummyUsers),
|
||||||
uiState = UserSelectViewModel.UiState.Normal(dummyServer, dummyUsers),
|
baseUrl = "https://demo.jellyfin.org/stable",
|
||||||
baseUrl = "https://demo.jellyfin.org/stable",
|
onUserClick = {},
|
||||||
onUserClick = {},
|
onAddUserClick = {},
|
||||||
onAddUserClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@Preview(device = "id:tv_1080p")
|
||||||
@Preview(widthDp = 960, heightDp = 540)
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun UserSelectScreenLayoutPreviewNoUsers() {
|
private fun UserSelectScreenLayoutPreviewNoUsers() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
UserSelectScreenLayout(
|
||||||
UserSelectScreenLayout(
|
uiState = UserSelectViewModel.UiState.Normal(dummyServer, emptyList()),
|
||||||
uiState = UserSelectViewModel.UiState.Normal(dummyServer, emptyList()),
|
baseUrl = "https://demo.jellyfin.org/stable",
|
||||||
baseUrl = "https://demo.jellyfin.org/stable",
|
onUserClick = {},
|
||||||
onUserClick = {},
|
onAddUserClick = {},
|
||||||
onAddUserClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,16 +264,13 @@ private fun UserComponent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun UserComponentPreview() {
|
private fun UserComponentPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
UserComponent(
|
||||||
UserComponent(
|
user = dummyUser,
|
||||||
user = dummyUser,
|
baseUrl = "https://demo.jellyfin.org/stable",
|
||||||
baseUrl = "https://demo.jellyfin.org/stable",
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,16 +98,13 @@ fun EpisodeCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ItemCardPreviewEpisode() {
|
private fun ItemCardPreviewEpisode() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
EpisodeCard(
|
||||||
EpisodeCard(
|
episode = dummyEpisode,
|
||||||
episode = dummyEpisode,
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,47 +127,38 @@ fun ItemCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ItemCardPreviewMovie() {
|
private fun ItemCardPreviewMovie() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ItemCard(
|
||||||
ItemCard(
|
item = dummyMovie,
|
||||||
item = dummyMovie,
|
direction = Direction.HORIZONTAL,
|
||||||
direction = Direction.HORIZONTAL,
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ItemCardPreviewMovieVertical() {
|
private fun ItemCardPreviewMovieVertical() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ItemCard(
|
||||||
ItemCard(
|
item = dummyMovie,
|
||||||
item = dummyMovie,
|
direction = Direction.VERTICAL,
|
||||||
direction = Direction.VERTICAL,
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ItemCardPreviewEpisode() {
|
private fun ItemCardPreviewEpisode() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ItemCard(
|
||||||
ItemCard(
|
item = dummyEpisode,
|
||||||
item = dummyEpisode,
|
direction = Direction.HORIZONTAL,
|
||||||
direction = Direction.HORIZONTAL,
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,16 +81,13 @@ fun ProfileButton(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ProfileButtonPreview() {
|
private fun ProfileButtonPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ProfileButton(
|
||||||
ProfileButton(
|
user = dummyUser,
|
||||||
user = dummyUser,
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
import androidx.tv.material3.Icon
|
import androidx.tv.material3.Icon
|
||||||
import androidx.tv.material3.MaterialTheme
|
import androidx.tv.material3.MaterialTheme
|
||||||
import androidx.tv.material3.Surface
|
|
||||||
import androidx.tv.material3.Text
|
import androidx.tv.material3.Text
|
||||||
import dev.jdtech.jellyfin.models.FindroidItem
|
import dev.jdtech.jellyfin.models.FindroidItem
|
||||||
import dev.jdtech.jellyfin.ui.dummy.dummyEpisode
|
import dev.jdtech.jellyfin.ui.dummy.dummyEpisode
|
||||||
|
@ -67,28 +66,22 @@ fun ProgressBadge(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ProgressBadgePreviewWatched() {
|
private fun ProgressBadgePreviewWatched() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ProgressBadge(
|
||||||
ProgressBadge(
|
item = dummyEpisode,
|
||||||
item = dummyEpisode,
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun ProgressBadgePreviewItemRemaining() {
|
private fun ProgressBadgePreviewItemRemaining() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
ProgressBadge(
|
||||||
ProgressBadge(
|
item = dummyShow,
|
||||||
item = dummyShow,
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,18 +93,15 @@ fun SettingsCategoryCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsCategoryCardPreview() {
|
private fun SettingsCategoryCardPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsCategoryCard(
|
||||||
SettingsCategoryCard(
|
preference = PreferenceCategory(
|
||||||
preference = PreferenceCategory(
|
nameStringResource = CoreR.string.settings_category_player,
|
||||||
nameStringResource = CoreR.string.settings_category_player,
|
iconDrawableId = CoreR.drawable.ic_play,
|
||||||
iconDrawableId = CoreR.drawable.ic_play,
|
),
|
||||||
),
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,23 +102,20 @@ fun SettingsSelectCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsSelectCardPreview() {
|
private fun SettingsSelectCardPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsSelectCard(
|
||||||
SettingsSelectCard(
|
preference = PreferenceSelect(
|
||||||
preference = PreferenceSelect(
|
nameStringResource = CoreR.string.settings_preferred_audio_language,
|
||||||
nameStringResource = CoreR.string.settings_preferred_audio_language,
|
iconDrawableId = CoreR.drawable.ic_speaker,
|
||||||
iconDrawableId = CoreR.drawable.ic_speaker,
|
backendName = Constants.PREF_AUDIO_LANGUAGE,
|
||||||
backendName = Constants.PREF_AUDIO_LANGUAGE,
|
backendDefaultValue = null,
|
||||||
backendDefaultValue = null,
|
options = CoreR.array.languages,
|
||||||
options = CoreR.array.languages,
|
optionValues = CoreR.array.languages_values,
|
||||||
optionValues = CoreR.array.languages_values,
|
),
|
||||||
),
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,64 +96,55 @@ fun SettingsSwitchCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsSwitchCardPreview() {
|
private fun SettingsSwitchCardPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsSwitchCard(
|
||||||
SettingsSwitchCard(
|
preference = PreferenceSwitch(
|
||||||
preference = PreferenceSwitch(
|
nameStringResource = R.string.settings_use_cache_title,
|
||||||
nameStringResource = R.string.settings_use_cache_title,
|
iconDrawableId = null,
|
||||||
iconDrawableId = null,
|
backendName = "image-cache",
|
||||||
backendName = "image-cache",
|
backendDefaultValue = false,
|
||||||
backendDefaultValue = false,
|
value = false,
|
||||||
value = false,
|
),
|
||||||
),
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsSwitchCardDisabledPreview() {
|
private fun SettingsSwitchCardDisabledPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsSwitchCard(
|
||||||
SettingsSwitchCard(
|
preference = PreferenceSwitch(
|
||||||
preference = PreferenceSwitch(
|
nameStringResource = R.string.settings_use_cache_title,
|
||||||
nameStringResource = R.string.settings_use_cache_title,
|
iconDrawableId = null,
|
||||||
iconDrawableId = null,
|
enabled = false,
|
||||||
enabled = false,
|
backendName = "image-cache",
|
||||||
backendName = "image-cache",
|
backendDefaultValue = false,
|
||||||
backendDefaultValue = false,
|
value = false,
|
||||||
value = false,
|
),
|
||||||
),
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
private fun SettingsSwitchCardDescriptionPreview() {
|
private fun SettingsSwitchCardDescriptionPreview() {
|
||||||
FindroidTheme {
|
FindroidTheme {
|
||||||
Surface {
|
SettingsSwitchCard(
|
||||||
SettingsSwitchCard(
|
preference = PreferenceSwitch(
|
||||||
preference = PreferenceSwitch(
|
nameStringResource = R.string.settings_use_cache_title,
|
||||||
nameStringResource = R.string.settings_use_cache_title,
|
descriptionStringRes = R.string.settings_use_cache_summary,
|
||||||
descriptionStringRes = R.string.settings_use_cache_summary,
|
iconDrawableId = null,
|
||||||
iconDrawableId = null,
|
backendName = "image-cache",
|
||||||
backendName = "image-cache",
|
backendDefaultValue = true,
|
||||||
backendDefaultValue = true,
|
value = true,
|
||||||
value = true,
|
),
|
||||||
),
|
onClick = {},
|
||||||
onClick = {},
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,24 @@
|
||||||
package dev.jdtech.jellyfin.ui.theme
|
package dev.jdtech.jellyfin.ui.theme
|
||||||
|
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.BoxScope
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.RectangleShape
|
||||||
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
import androidx.tv.material3.ExperimentalTvMaterial3Api
|
||||||
|
import androidx.tv.material3.NonInteractiveSurfaceDefaults
|
||||||
|
import androidx.tv.material3.Surface
|
||||||
import androidx.tv.material3.MaterialTheme as MaterialThemeTv
|
import androidx.tv.material3.MaterialTheme as MaterialThemeTv
|
||||||
|
|
||||||
@OptIn(ExperimentalTvMaterial3Api::class)
|
@OptIn(ExperimentalTvMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun FindroidTheme(
|
fun FindroidTheme(
|
||||||
content: @Composable () -> Unit,
|
content: @Composable BoxScope.() -> Unit,
|
||||||
) {
|
) {
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = ColorScheme,
|
colorScheme = ColorScheme,
|
||||||
|
@ -23,7 +32,26 @@ fun FindroidTheme(
|
||||||
colorScheme = ColorSchemeTv,
|
colorScheme = ColorSchemeTv,
|
||||||
typography = TypographyTv,
|
typography = TypographyTv,
|
||||||
shapes = shapesTv,
|
shapes = shapesTv,
|
||||||
content = content,
|
content = {
|
||||||
|
Surface(
|
||||||
|
colors = NonInteractiveSurfaceDefaults.colors(
|
||||||
|
containerColor = androidx.tv.material3.MaterialTheme.colorScheme.background,
|
||||||
|
),
|
||||||
|
shape = RectangleShape,
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.background(
|
||||||
|
Brush.linearGradient(
|
||||||
|
listOf(
|
||||||
|
Color.Black,
|
||||||
|
Color(0xFF001721),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
content = content,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue