diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesViewModel.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/examples/ExamplesViewModel.kt similarity index 94% rename from pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesViewModel.kt rename to pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/examples/ExamplesViewModel.kt index fd684d9a7..1fe061e30 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesViewModel.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/examples/ExamplesViewModel.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.ui.examples +package ch.srgssr.pillarbox.demo.shared.ui.examples import android.app.Application import androidx.lifecycle.AndroidViewModel @@ -40,6 +40,7 @@ class ExamplesViewModel(application: Application) : AndroidViewModel(application item.title }, description = "DRM-protected video", + imageUrl = item.imageUrl.rawUrl, uri = item.urn ) } @@ -48,6 +49,7 @@ class ExamplesViewModel(application: Application) : AndroidViewModel(application DemoItem( title = item.title, description = "Token-protected video", + imageUrl = item.imageUrl.rawUrl, uri = item.urn ) } diff --git a/pillarbox-demo-tv/src/main/AndroidManifest.xml b/pillarbox-demo-tv/src/main/AndroidManifest.xml index 98eade572..d937ec405 100644 --- a/pillarbox-demo-tv/src/main/AndroidManifest.xml +++ b/pillarbox-demo-tv/src/main/AndroidManifest.xml @@ -27,7 +27,7 @@ diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainActivity.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainActivity.kt index d2fac2a28..728b72012 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainActivity.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainActivity.kt @@ -28,8 +28,7 @@ import androidx.tv.material3.LocalContentColor import androidx.tv.material3.MaterialTheme import ch.srgssr.pillarbox.demo.shared.ui.HomeDestination import ch.srgssr.pillarbox.demo.shared.ui.navigate -import ch.srgssr.pillarbox.demo.tv.ui.TVDemoNavigation -import ch.srgssr.pillarbox.demo.tv.ui.TVDemoTopBar +import ch.srgssr.pillarbox.demo.tv.ui.components.TVDemoTopBar import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings @@ -74,7 +73,7 @@ class MainActivity : ComponentActivity() { } ) - TVDemoNavigation( + MainNavigation( navController = navController, startDestination = startDestination, modifier = Modifier.fillMaxSize() diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainNavigation.kt similarity index 87% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainNavigation.kt index d51e96994..e06d2a8bb 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/MainNavigation.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.ui +package ch.srgssr.pillarbox.demo.tv import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable @@ -21,10 +21,10 @@ import ch.srgssr.pillarbox.demo.shared.di.PlayerModule import ch.srgssr.pillarbox.demo.shared.ui.HomeDestination import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.SearchViewModel import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data.contentListSections -import ch.srgssr.pillarbox.demo.tv.examples.ExamplesHome -import ch.srgssr.pillarbox.demo.tv.player.PlayerActivity -import ch.srgssr.pillarbox.demo.tv.ui.integrationLayer.ListsHome -import ch.srgssr.pillarbox.demo.tv.ui.integrationLayer.SearchView +import ch.srgssr.pillarbox.demo.tv.ui.examples.ExamplesHome +import ch.srgssr.pillarbox.demo.tv.ui.lists.ListsHome +import ch.srgssr.pillarbox.demo.tv.ui.player.PlayerActivity +import ch.srgssr.pillarbox.demo.tv.ui.search.SearchHome import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings @@ -37,7 +37,7 @@ import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings */ @Composable @OptIn(ExperimentalTvMaterial3Api::class) -fun TVDemoNavigation( +fun MainNavigation( navController: NavHostController, startDestination: HomeDestination, modifier: Modifier = Modifier, @@ -71,7 +71,7 @@ fun TVDemoNavigation( factory = SearchViewModel.Factory(ilRepository) ) - SearchView( + SearchHome( searchViewModel = searchViewModel, modifier = Modifier.padding(top = MaterialTheme.paddings.baseline) ) @@ -81,9 +81,9 @@ fun TVDemoNavigation( @Preview @Composable -private fun TVDemoNavigationPreview() { +private fun MainNavigationPreview() { PillarboxTheme { - TVDemoNavigation( + MainNavigation( navController = rememberNavController(), startDestination = HomeDestination.Examples ) diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoTopBar.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/components/TVDemoTopBar.kt similarity index 98% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoTopBar.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/components/TVDemoTopBar.kt index 711486d5e..316d6dc2d 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoTopBar.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/components/TVDemoTopBar.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.ui +package ch.srgssr.pillarbox.demo.tv.ui.components import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/examples/Examples.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/examples/ExamplesHome.kt similarity index 96% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/examples/Examples.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/examples/ExamplesHome.kt index 4aefa284b..35fbfc68b 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/examples/Examples.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/examples/ExamplesHome.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.examples +package ch.srgssr.pillarbox.demo.tv.ui.examples import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf @@ -37,6 +38,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview +import androidx.lifecycle.viewmodel.compose.viewModel import androidx.navigation.NavHostController import androidx.navigation.NavType import androidx.navigation.compose.NavHost @@ -52,8 +54,8 @@ import androidx.tv.material3.ExperimentalTvMaterial3Api import androidx.tv.material3.MaterialTheme import androidx.tv.material3.Text import ch.srgssr.pillarbox.demo.shared.data.DemoItem -import ch.srgssr.pillarbox.demo.shared.data.Playlist import ch.srgssr.pillarbox.demo.shared.ui.NavigationRoutes +import ch.srgssr.pillarbox.demo.shared.ui.examples.ExamplesViewModel import ch.srgssr.pillarbox.demo.tv.extension.onDpadEvent import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings @@ -73,8 +75,9 @@ fun ExamplesHome( modifier: Modifier = Modifier, onItemSelected: (DemoItem) -> Unit = {}, ) { + val examplesViewModel: ExamplesViewModel = viewModel() val navController = rememberNavController() - val playlists = Playlist.examplesPlaylists + val playlists by examplesViewModel.contents.collectAsState() NavHost( navController = navController, @@ -268,7 +271,7 @@ private fun ExamplesSection( @Preview @Composable -private fun ExamplesPreview() { +private fun ExamplesHomePreview() { PillarboxTheme { ExamplesHome() } diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/integrationLayer/ListsHome.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/lists/ListsHome.kt similarity index 99% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/integrationLayer/ListsHome.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/lists/ListsHome.kt index d48234a01..d395ea343 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/integrationLayer/ListsHome.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/lists/ListsHome.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.ui.integrationLayer +package ch.srgssr.pillarbox.demo.tv.ui.lists import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -89,7 +89,7 @@ import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data.contentListFacto import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data.contentListSections import ch.srgssr.pillarbox.demo.tv.R import ch.srgssr.pillarbox.demo.tv.extension.onDpadEvent -import ch.srgssr.pillarbox.demo.tv.player.PlayerActivity +import ch.srgssr.pillarbox.demo.tv.ui.player.PlayerActivity import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings import coil.compose.AsyncImage @@ -701,7 +701,7 @@ private fun ListsSectionError( @Preview @Composable -private fun ContentListsViewPreview() { +private fun ListsHomePreview() { PillarboxTheme { ListsHome(sections = contentListSections) } diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/PlayerActivity.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/PlayerActivity.kt similarity index 94% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/PlayerActivity.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/PlayerActivity.kt index ab68ff43f..041f7406e 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/PlayerActivity.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/PlayerActivity.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player +package ch.srgssr.pillarbox.demo.tv.ui.player import android.content.Context import android.content.Intent @@ -15,7 +15,7 @@ import androidx.compose.ui.Modifier import androidx.media3.session.MediaSession import ch.srgssr.pillarbox.demo.shared.data.DemoItem import ch.srgssr.pillarbox.demo.shared.di.PlayerModule -import ch.srgssr.pillarbox.demo.tv.player.compose.TvPlayerView +import ch.srgssr.pillarbox.demo.tv.ui.player.compose.PlayerView import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme import ch.srgssr.pillarbox.player.PillarboxPlayer @@ -49,7 +49,7 @@ class PlayerActivity : ComponentActivity() { setContent { PillarboxTheme { - TvPlayerView( + PlayerView( player = player, modifier = Modifier.fillMaxSize() ) diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/TvPlayerView.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/PlayerView.kt similarity index 91% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/TvPlayerView.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/PlayerView.kt index 565dd5e32..7c2e18ca8 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/TvPlayerView.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/PlayerView.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player.compose +package ch.srgssr.pillarbox.demo.tv.ui.player.compose import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedVisibility @@ -29,6 +29,9 @@ import androidx.tv.material3.MaterialTheme import androidx.tv.material3.rememberDrawerState import ch.srgssr.pillarbox.demo.shared.R import ch.srgssr.pillarbox.demo.tv.extension.onDpadEvent +import ch.srgssr.pillarbox.demo.tv.ui.player.compose.controls.PlayerError +import ch.srgssr.pillarbox.demo.tv.ui.player.compose.controls.PlayerPlaybackRow +import ch.srgssr.pillarbox.demo.tv.ui.player.compose.settings.PlaybackSettingsDrawer import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings import ch.srgssr.pillarbox.ui.extension.playerErrorAsState import ch.srgssr.pillarbox.ui.widget.maintainVisibleOnFocus @@ -43,7 +46,7 @@ import ch.srgssr.pillarbox.ui.widget.rememberDelayedVisibilityState */ @Composable @OptIn(ExperimentalTvMaterial3Api::class) -fun TvPlayerView( +fun PlayerView( player: Player, modifier: Modifier = Modifier ) { @@ -57,7 +60,7 @@ fun TvPlayerView( } } - PlayerSettingDrawer( + PlaybackSettingsDrawer( player = player, drawerState = drawerState, modifier = modifier @@ -89,7 +92,7 @@ fun TvPlayerView( .maintainVisibleOnFocus(delayedVisibilityState = visibilityState), contentAlignment = Alignment.Center ) { - TvPlaybackRow( + PlayerPlaybackRow( player = player, state = visibilityState ) diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/ErrorView.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/controls/PlayerError.kt similarity index 96% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/ErrorView.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/controls/PlayerError.kt index 564c749e0..9d336e875 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/ErrorView.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/controls/PlayerError.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player.compose +package ch.srgssr.pillarbox.demo.tv.ui.player.compose.controls import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/TVPlaybackRow.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/controls/PlayerPlaybackRow.kt similarity index 97% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/TVPlaybackRow.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/controls/PlayerPlaybackRow.kt index 426c52662..71fb7e5db 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/TVPlaybackRow.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/controls/PlayerPlaybackRow.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player.compose +package ch.srgssr.pillarbox.demo.tv.ui.player.compose.controls import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row @@ -43,7 +43,7 @@ import ch.srgssr.pillarbox.ui.widget.DelayedVisibilityState */ @OptIn(ExperimentalTvMaterial3Api::class) @Composable -fun TvPlaybackRow( +fun PlayerPlaybackRow( player: Player, state: DelayedVisibilityState, modifier: Modifier = Modifier, diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/PlayerSettingDrawer.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/settings/PlaybackSettingsDrawer.kt similarity index 99% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/PlayerSettingDrawer.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/settings/PlaybackSettingsDrawer.kt index d4c0b8b33..fb7298c72 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/compose/PlayerSettingDrawer.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/compose/settings/PlaybackSettingsDrawer.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player.compose +package ch.srgssr.pillarbox.demo.tv.ui.player.compose.settings import android.app.Application import androidx.activity.compose.BackHandler @@ -69,7 +69,7 @@ import ch.srgssr.pillarbox.player.extension.hasAccessibilityRoles */ @Composable @OptIn(ExperimentalTvMaterial3Api::class) -fun PlayerSettingDrawer( +fun PlaybackSettingsDrawer( player: Player, drawerState: DrawerState, modifier: Modifier = Modifier, diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/leanback/LeanbackPlayerActivity.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/leanback/LeanbackPlayerActivity.kt similarity index 93% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/leanback/LeanbackPlayerActivity.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/leanback/LeanbackPlayerActivity.kt index 0b6b40b74..87c2e9189 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/leanback/LeanbackPlayerActivity.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/leanback/LeanbackPlayerActivity.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player.leanback +package ch.srgssr.pillarbox.demo.tv.ui.player.leanback import android.app.Activity import android.content.Intent @@ -24,7 +24,7 @@ class LeanbackPlayerActivity : FragmentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_player) + setContentView(R.layout.activity_leanback_player) leanbackPlayerFragment = supportFragmentManager.findFragmentById(R.id.fragment_container) as LeanbackPlayerFragment val demoItem = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { intent.getSerializableExtra(ARG_ITEM, DemoItem::class.java) diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/leanback/LeanbackPlayerFragment.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/leanback/LeanbackPlayerFragment.kt similarity index 98% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/leanback/LeanbackPlayerFragment.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/leanback/LeanbackPlayerFragment.kt index 34b57c591..d91d209df 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/player/leanback/LeanbackPlayerFragment.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/player/leanback/LeanbackPlayerFragment.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.player.leanback +package ch.srgssr.pillarbox.demo.tv.ui.player.leanback import android.os.Bundle import androidx.leanback.app.VideoSupportFragment diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/integrationLayer/SearchView.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/search/SearchHome.kt similarity index 97% rename from pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/integrationLayer/SearchView.kt rename to pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/search/SearchHome.kt index 7d45113c1..b2216e8de 100644 --- a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/integrationLayer/SearchView.kt +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/search/SearchHome.kt @@ -2,7 +2,7 @@ * Copyright (c) SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.tv.ui.integrationLayer +package ch.srgssr.pillarbox.demo.tv.ui.search import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -48,7 +48,8 @@ import ch.srgssr.pillarbox.demo.shared.data.DemoItem import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.SearchViewModel import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data.bus import ch.srgssr.pillarbox.demo.tv.extension.onDpadEvent -import ch.srgssr.pillarbox.demo.tv.player.PlayerActivity +import ch.srgssr.pillarbox.demo.tv.ui.lists.ListsSection +import ch.srgssr.pillarbox.demo.tv.ui.player.PlayerActivity import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings @@ -60,7 +61,7 @@ import ch.srgssr.pillarbox.demo.tv.ui.theme.paddings */ @Composable @OptIn(ExperimentalTvMaterial3Api::class) -fun SearchView( +fun SearchHome( searchViewModel: SearchViewModel, modifier: Modifier = Modifier ) { diff --git a/pillarbox-demo-tv/src/main/res/layout/activity_player.xml b/pillarbox-demo-tv/src/main/res/layout/activity_leanback_player.xml similarity index 81% rename from pillarbox-demo-tv/src/main/res/layout/activity_player.xml rename to pillarbox-demo-tv/src/main/res/layout/activity_leanback_player.xml index a806708ab..ea9125ddb 100644 --- a/pillarbox-demo-tv/src/main/res/layout/activity_player.xml +++ b/pillarbox-demo-tv/src/main/res/layout/activity_leanback_player.xml @@ -4,6 +4,6 @@ --> diff --git a/pillarbox-demo-tv/src/main/res/mipmap-anydpi-v26/ic_launcher_pillarbox.xml b/pillarbox-demo-tv/src/main/res/mipmap-anydpi-v26/ic_launcher_pillarbox.xml index 497ba3a3c..b4f89b1ef 100644 --- a/pillarbox-demo-tv/src/main/res/mipmap-anydpi-v26/ic_launcher_pillarbox.xml +++ b/pillarbox-demo-tv/src/main/res/mipmap-anydpi-v26/ic_launcher_pillarbox.xml @@ -3,7 +3,9 @@ ~ Copyright (c) SRG SSR. All rights reserved. ~ License information is available from the LICENSE file. --> - - - + + + diff --git a/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner.png b/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner.png deleted file mode 100644 index c99e9d337..000000000 Binary files a/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner.png and /dev/null differ diff --git a/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner.webp b/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner.webp new file mode 100644 index 000000000..9c428301f Binary files /dev/null and b/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner.webp differ diff --git a/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner_foreground.png b/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner_foreground.png deleted file mode 100644 index f0959091c..000000000 Binary files a/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner_foreground.png and /dev/null differ diff --git a/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner_foreground.webp b/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner_foreground.webp new file mode 100644 index 000000000..30ae556c1 Binary files /dev/null and b/pillarbox-demo-tv/src/main/res/mipmap-xhdpi/ic_pillarbox_banner_foreground.webp differ diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesHome.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesHome.kt index d95e30e5c..a68686953 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesHome.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/examples/ExamplesHome.kt @@ -25,6 +25,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel import ch.srgssr.pillarbox.demo.BuildConfig import ch.srgssr.pillarbox.demo.shared.data.DemoItem import ch.srgssr.pillarbox.demo.shared.data.Playlist +import ch.srgssr.pillarbox.demo.shared.ui.examples.ExamplesViewModel import ch.srgssr.pillarbox.demo.ui.components.DemoListHeaderView import ch.srgssr.pillarbox.demo.ui.components.DemoListItemView import ch.srgssr.pillarbox.demo.ui.components.DemoListSectionView diff --git a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox.png b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox.png deleted file mode 100644 index 2ee42e546..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox.webp b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox.webp new file mode 100644 index 000000000..296c2d192 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_foreground.png b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_foreground.png deleted file mode 100644 index e15861dc1..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_foreground.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_foreground.webp b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_foreground.webp new file mode 100644 index 000000000..d21c24e63 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_foreground.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_round.png b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_round.png deleted file mode 100644 index 0758d38f8..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_round.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_round.webp b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_round.webp new file mode 100644 index 000000000..f3e3ebd6d Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-hdpi/ic_launcher_pillarbox_round.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox.png b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox.png deleted file mode 100644 index 85784681a..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox.webp b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox.webp new file mode 100644 index 000000000..f85c81309 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_foreground.png b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_foreground.png deleted file mode 100644 index 1791e32dd..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_foreground.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_foreground.webp b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_foreground.webp new file mode 100644 index 000000000..5a99ce3bc Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_foreground.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_round.png b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_round.png deleted file mode 100644 index 35e40271d..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_round.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_round.webp b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_round.webp new file mode 100644 index 000000000..ec9c385ef Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-mdpi/ic_launcher_pillarbox_round.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox.png b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox.png deleted file mode 100644 index 7d9d781f8..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox.webp b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox.webp new file mode 100644 index 000000000..0afd025ba Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_foreground.png b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_foreground.png deleted file mode 100644 index f393a5117..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_foreground.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_foreground.webp b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_foreground.webp new file mode 100644 index 000000000..22df068bf Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_foreground.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_round.png b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_round.png deleted file mode 100644 index 44038287c..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_round.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_round.webp b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_round.webp new file mode 100644 index 000000000..a2c21bfb8 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xhdpi/ic_launcher_pillarbox_round.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox.png b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox.png deleted file mode 100644 index cafad035a..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox.webp b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox.webp new file mode 100644 index 000000000..ac167f7cd Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_foreground.png b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_foreground.png deleted file mode 100644 index 4768cad2f..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_foreground.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_foreground.webp b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_foreground.webp new file mode 100644 index 000000000..79766ca2e Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_foreground.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_round.png b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_round.png deleted file mode 100644 index ec90582c2..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_round.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_round.webp b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_round.webp new file mode 100644 index 000000000..8125178f2 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xxhdpi/ic_launcher_pillarbox_round.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox.png b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox.png deleted file mode 100644 index 044be27c6..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox.webp b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox.webp new file mode 100644 index 000000000..65aa96f36 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_foreground.png b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_foreground.png deleted file mode 100644 index fcd90cafb..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_foreground.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_foreground.webp b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_foreground.webp new file mode 100644 index 000000000..fdc00db74 Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_foreground.webp differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_round.png b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_round.png deleted file mode 100644 index 3d4b3a455..000000000 Binary files a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_round.png and /dev/null differ diff --git a/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_round.webp b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_round.webp new file mode 100644 index 000000000..bea2f363b Binary files /dev/null and b/pillarbox-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_pillarbox_round.webp differ