From 2a289e0000eded18e6c41332a5cb454476389478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Wed, 8 Nov 2023 10:32:13 +0100 Subject: [PATCH 1/2] Add navigation bar on TV demo --- pillarbox-demo-shared/build.gradle.kts | 2 + .../demo/shared}/ui/HomeDestination.kt | 6 +- .../demo/shared}/ui/NavigationRoutes.kt | 4 +- .../src/main/res/values/strings.xml | 11 ++ pillarbox-demo-tv/build.gradle.kts | 1 + .../src/main/AndroidManifest.xml | 1 - .../pillarbox/demo/tv/DemoTvApplication.kt | 14 -- .../srgssr/pillarbox/demo/tv/MainActivity.kt | 100 +++++++----- .../pillarbox/demo/tv/examples/Examples.kt | 15 -- .../demo/tv/player/PlayerActivity.kt | 4 +- .../pillarbox/demo/tv/ui/TVDemoNavigation.kt | 52 +++++++ .../pillarbox/demo/tv/ui/TVDemoTopBar.kt | 144 ++++++++++++++++++ .../demo/tv/ui/theme/PillarboxTheme.kt | 32 ++++ .../pillarbox/demo/ui/MainNavigation.kt | 2 + .../ui/integrationLayer/ContentListsView.kt | 6 +- .../demo/ui/showcases/ShowCaseList.kt | 5 +- .../demo/ui/showcases/ShowCaseNavigation.kt | 2 +- .../src/main/res/values/strings.xml | 5 - 18 files changed, 321 insertions(+), 85 deletions(-) rename {pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo => pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared}/ui/HomeDestination.kt (91%) rename {pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo => pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared}/ui/NavigationRoutes.kt (89%) create mode 100644 pillarbox-demo-shared/src/main/res/values/strings.xml delete mode 100644 pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/DemoTvApplication.kt create mode 100644 pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt create mode 100644 pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoTopBar.kt create mode 100644 pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/theme/PillarboxTheme.kt diff --git a/pillarbox-demo-shared/build.gradle.kts b/pillarbox-demo-shared/build.gradle.kts index 1a781ce1f..ed371e61a 100644 --- a/pillarbox-demo-shared/build.gradle.kts +++ b/pillarbox-demo-shared/build.gradle.kts @@ -37,4 +37,6 @@ android { dependencies { compileOnly(project(mapOf("path" to ":pillarbox-core-business"))) implementation(libs.androidx.ktx) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.material.icons.extended) } diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/HomeDestination.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/HomeDestination.kt similarity index 91% rename from pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/HomeDestination.kt rename to pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/HomeDestination.kt index d596cbd65..6dc30e8a6 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/HomeDestination.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/HomeDestination.kt @@ -1,8 +1,8 @@ /* - * Copyright (c) 2022. SRG SSR. All rights reserved. + * Copyright (c) 2023. SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.ui +package ch.srgssr.pillarbox.demo.shared.ui import androidx.annotation.StringRes import androidx.compose.material.icons.Icons @@ -12,7 +12,7 @@ import androidx.compose.material.icons.filled.Movie import androidx.compose.material.icons.filled.Search import androidx.compose.material.icons.filled.ViewList import androidx.compose.ui.graphics.vector.ImageVector -import ch.srgssr.pillarbox.demo.R +import ch.srgssr.pillarbox.demo.shared.R /** * Home destinations diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/NavigationRoutes.kt b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/NavigationRoutes.kt similarity index 89% rename from pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/NavigationRoutes.kt rename to pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/NavigationRoutes.kt index 9e633caaa..260700f4a 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/NavigationRoutes.kt +++ b/pillarbox-demo-shared/src/main/java/ch/srgssr/pillarbox/demo/shared/ui/NavigationRoutes.kt @@ -1,8 +1,8 @@ /* - * Copyright (c) 2022. SRG SSR. All rights reserved. + * Copyright (c) 2023. SRG SSR. All rights reserved. * License information is available from the LICENSE file. */ -package ch.srgssr.pillarbox.demo.ui +package ch.srgssr.pillarbox.demo.shared.ui /** * Navigation stores all routes available diff --git a/pillarbox-demo-shared/src/main/res/values/strings.xml b/pillarbox-demo-shared/src/main/res/values/strings.xml new file mode 100644 index 000000000..b36cc6cf4 --- /dev/null +++ b/pillarbox-demo-shared/src/main/res/values/strings.xml @@ -0,0 +1,11 @@ + + + Examples + Information + Lists + Search + Showcases + diff --git a/pillarbox-demo-tv/build.gradle.kts b/pillarbox-demo-tv/build.gradle.kts index fe0bbad6b..45d7f93ff 100644 --- a/pillarbox-demo-tv/build.gradle.kts +++ b/pillarbox-demo-tv/build.gradle.kts @@ -70,6 +70,7 @@ dependencies { implementation(libs.androidx.compose.material.icons.extended) implementation(libs.androidx.compose.ui) implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.navigation.compose) // Compose for TV dependencies implementation(libs.androidx.tv.foundation) diff --git a/pillarbox-demo-tv/src/main/AndroidManifest.xml b/pillarbox-demo-tv/src/main/AndroidManifest.xml index bd6184d16..2edacf2db 100644 --- a/pillarbox-demo-tv/src/main/AndroidManifest.xml +++ b/pillarbox-demo-tv/src/main/AndroidManifest.xml @@ -12,7 +12,6 @@ android:required="false" /> Unit - ) { - ExamplesHome(modifier = modifier, onItemSelected = onItemSelected) - } - - companion object { - private val HorizontalPadding = 32.dp + private companion object { + private val HorizontalPadding = 58.dp private val VerticalPadding = 16.dp } } 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/examples/Examples.kt index 12d7376f4..e5660494f 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/examples/Examples.kt @@ -4,9 +4,7 @@ */ package ch.srgssr.pillarbox.demo.tv.examples -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable @@ -14,14 +12,12 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import androidx.tv.foundation.ExperimentalTvFoundationApi import androidx.tv.foundation.PivotOffsets import androidx.tv.foundation.lazy.list.TvLazyColumn import androidx.tv.foundation.lazy.list.items import androidx.tv.material3.ExperimentalTvMaterial3Api import androidx.tv.material3.MaterialTheme import androidx.tv.material3.Surface -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.tv.item.DemoItemView @@ -34,7 +30,6 @@ import ch.srgssr.pillarbox.demo.tv.item.PlaylistHeader * @param onItemSelected * @receiver */ -@OptIn(ExperimentalTvFoundationApi::class, ExperimentalTvMaterial3Api::class) @Composable fun ExamplesHome( modifier: Modifier = Modifier, @@ -57,16 +52,6 @@ fun ExamplesHome( pivotOffsets = PivotOffsets(0.5f, 0f), verticalArrangement = Arrangement.spacedBy(16.dp) ) { - stickyHeader { - Box( - modifier = Modifier - .fillMaxWidth() - .padding(bottom = 12.dp) - .background(color = MaterialTheme.colorScheme.surface) - ) { - Text(text = "Samples", style = MaterialTheme.typography.displayMedium) - } - } for (playlist in listItems) { item { PlaylistHeader( 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/player/PlayerActivity.kt index a0f50d762..7cad80056 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/player/PlayerActivity.kt @@ -4,7 +4,7 @@ */ package ch.srgssr.pillarbox.demo.tv.player -import android.app.Activity +import android.content.Context import android.content.Intent import android.os.Build import android.os.Bundle @@ -85,7 +85,7 @@ class PlayerActivity : ComponentActivity() { * @param context * @param demoItem The item to play. */ - fun startPlayer(context: Activity, demoItem: DemoItem) { + fun startPlayer(context: Context, demoItem: DemoItem) { val intent = Intent(context, PlayerActivity::class.java) intent.putExtra(ARG_ITEM, demoItem) context.startActivity(intent) 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/ui/TVDemoNavigation.kt new file mode 100644 index 000000000..fc6920512 --- /dev/null +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023. SRG SSR. All rights reserved. + * License information is available from the LICENSE file. + */ +package ch.srgssr.pillarbox.demo.tv.ui + +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.tv.material3.ExperimentalTvMaterial3Api +import androidx.tv.material3.Text +import ch.srgssr.pillarbox.demo.shared.ui.HomeDestination +import ch.srgssr.pillarbox.demo.tv.examples.ExamplesHome +import ch.srgssr.pillarbox.demo.tv.player.PlayerActivity + +/** + * The nav host of the demo app on TV. + * + * @param navController The [NavHostController] uses to navigate between screens. + * @param startDestination The start destination to display. + * @param modifier The [Modifier] to apply to the [NavHost]. + */ +@Composable +@OptIn(ExperimentalTvMaterial3Api::class) +fun TVDemoNavigation( + navController: NavHostController, + startDestination: HomeDestination, + modifier: Modifier = Modifier, +) { + NavHost( + navController = navController, + startDestination = startDestination.route, + modifier = modifier + ) { + composable(HomeDestination.Examples.route) { + val context = LocalContext.current + + ExamplesHome( + onItemSelected = { PlayerActivity.startPlayer(context, it) } + ) + } + + composable(HomeDestination.Lists.route) { + // TODO Proper content will be created in https://github.com/SRGSSR/pillarbox-android/issues/293 + Text(text = stringResource(HomeDestination.Lists.labelResId)) + } + } +} 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/TVDemoTopBar.kt new file mode 100644 index 000000000..4aa765beb --- /dev/null +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoTopBar.kt @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2023. SRG SSR. All rights reserved. + * License information is available from the LICENSE file. + */ +package ch.srgssr.pillarbox.demo.tv.ui + +import androidx.compose.animation.animateColorAsState +import androidx.compose.animation.core.animateDpAsState +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.key +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.Modifier +import androidx.compose.ui.focus.focusRestorer +import androidx.compose.ui.focus.onFocusChanged +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.DpRect +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.height +import androidx.compose.ui.unit.width +import androidx.compose.ui.zIndex +import androidx.tv.material3.ExperimentalTvMaterial3Api +import androidx.tv.material3.MaterialTheme +import androidx.tv.material3.Tab +import androidx.tv.material3.TabRow +import androidx.tv.material3.TabRowScope +import androidx.tv.material3.Text +import ch.srgssr.pillarbox.demo.shared.ui.HomeDestination + +/** + * Top bar displayed in the demo app on TV. + * + * @param destinations The list of destinations to display. + * @param selectedDestination The currently selected destination. + * @param modifier The [Modifier] to apply to the top bar. + * @param onDestinationSelected The action to perform the selected a destination. + */ +@Composable +@OptIn(ExperimentalComposeUiApi::class, ExperimentalTvMaterial3Api::class) +fun TVDemoTopBar( + destinations: List, + selectedDestination: HomeDestination, + modifier: Modifier = Modifier, + onDestinationSelected: (destination: HomeDestination) -> Unit +) { + Row( + modifier = modifier + .fillMaxWidth() + .padding(top = 16.dp) + .focusRestorer(), + verticalAlignment = Alignment.CenterVertically + ) { + var isTabRowFocused by remember { mutableStateOf(false) } + val selectedDestinationIndex = destinations.indexOf(selectedDestination) + + TabRow( + modifier = Modifier.onFocusChanged { isTabRowFocused = it.isFocused || it.hasFocus }, + selectedTabIndex = selectedDestinationIndex, + indicator = { tabPositions, _ -> + TopBarItemIndicator( + currentTabPosition = tabPositions[selectedDestinationIndex], + isTabRowFocused = isTabRowFocused + ) + } + ) { + destinations.forEachIndexed { index, destination -> + key(index) { + TabItem( + destination = destination, + selected = index == selectedDestinationIndex, + modifier = Modifier.height(32.dp), + onDestinationSelected = { onDestinationSelected(destination) } + ) + } + } + } + } +} + +@Composable +@OptIn(ExperimentalTvMaterial3Api::class) +private fun TopBarItemIndicator( + currentTabPosition: DpRect, + modifier: Modifier = Modifier, + activeColor: Color = MaterialTheme.colorScheme.primaryContainer.copy(alpha = 0.4f), + inactiveColor: Color = MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.4f), + isTabRowFocused: Boolean +) { + val width by animateDpAsState(targetValue = currentTabPosition.width, label = "width") + val height = currentTabPosition.height + val leftOffset by animateDpAsState(targetValue = currentTabPosition.left, label = "leftOffset") + val topOffset = currentTabPosition.top + val pillColor by animateColorAsState(targetValue = if (isTabRowFocused) activeColor else inactiveColor, label = "pillColor") + + Box( + modifier + .fillMaxWidth() + .wrapContentSize(Alignment.BottomStart) + .offset(x = leftOffset, y = topOffset) + .size(width = width, height = height) + .background(color = pillColor) + .zIndex(-1f) + ) +} + +@Composable +@OptIn(ExperimentalTvMaterial3Api::class) +private fun TabRowScope.TabItem( + destination: HomeDestination, + selected: Boolean, + modifier: Modifier = Modifier, + onDestinationSelected: () -> Unit +) { + Tab( + modifier = modifier, + selected = selected, + onFocus = onDestinationSelected + ) { + Text( + modifier = Modifier + .fillMaxSize() + .wrapContentSize() + .padding(horizontal = 16.dp), + text = stringResource(destination.labelResId), + style = MaterialTheme.typography.titleSmall + .copy(color = MaterialTheme.colorScheme.onPrimaryContainer) + ) + } +} diff --git a/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/theme/PillarboxTheme.kt b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/theme/PillarboxTheme.kt new file mode 100644 index 000000000..007b4cc80 --- /dev/null +++ b/pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/theme/PillarboxTheme.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023. SRG SSR. All rights reserved. + * License information is available from the LICENSE file. + */ +package ch.srgssr.pillarbox.demo.tv.ui.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.runtime.Composable +import androidx.tv.material3.ExperimentalTvMaterial3Api +import androidx.tv.material3.MaterialTheme +import androidx.tv.material3.darkColorScheme +import androidx.tv.material3.lightColorScheme + +/** + * Pillarbox theme. + * + * @param darkTheme `true` if the app uses a dark theme, `false` otherwise. + * @param content The content to display on the screen. + */ +@Composable +@OptIn(ExperimentalTvMaterial3Api::class) +fun PillarboxTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + content: @Composable () -> Unit +) { + val colorScheme = if (darkTheme) darkColorScheme() else lightColorScheme() + + MaterialTheme( + colorScheme = colorScheme, + content = content + ) +} diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt index bfea55d94..0645fa442 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/MainNavigation.kt @@ -40,6 +40,8 @@ import ch.srgssr.pillarbox.analytics.SRGAnalytics import ch.srgssr.pillarbox.demo.DemoPageView import ch.srgssr.pillarbox.demo.R import ch.srgssr.pillarbox.demo.shared.data.DemoItem +import ch.srgssr.pillarbox.demo.shared.ui.HomeDestination +import ch.srgssr.pillarbox.demo.shared.ui.NavigationRoutes import ch.srgssr.pillarbox.demo.trackPagView import ch.srgssr.pillarbox.demo.ui.examples.ExamplesHome import ch.srgssr.pillarbox.demo.ui.integrationLayer.SearchView diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/integrationLayer/ContentListsView.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/integrationLayer/ContentListsView.kt index 9dc91bdcc..dc86194c9 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/integrationLayer/ContentListsView.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/integrationLayer/ContentListsView.kt @@ -24,7 +24,7 @@ import androidx.navigation.NavGraphBuilder import ch.srg.dataProvider.integrationlayer.request.parameters.Bu import ch.srgssr.pillarbox.demo.DemoPageView import ch.srgssr.pillarbox.demo.shared.data.DemoItem -import ch.srgssr.pillarbox.demo.ui.NavigationRoutes +import ch.srgssr.pillarbox.demo.shared.ui.NavigationRoutes import ch.srgssr.pillarbox.demo.ui.composable import ch.srgssr.pillarbox.demo.ui.integrationLayer.data.Content import ch.srgssr.pillarbox.demo.ui.integrationLayer.data.ILRepository @@ -44,8 +44,8 @@ private val sections = listOf( SectionItem("TV Live center", bus.map { ContentList.TVLiveCenter(it) }), SectionItem("TV Live web", bus.map { ContentList.TVLiveWeb(it) }), SectionItem("Radio livestream", bus.map { ContentList.RadioLiveStreams(it) }), - SectionItem("Radio Latest medias", RadioChannel.values().map { ContentList.RadioLatestMedias(it) }), - SectionItem("Radio Shows", RadioChannel.values().map { ContentList.RadioShows(it) }), + SectionItem("Radio Latest medias", RadioChannel.entries.map { ContentList.RadioLatestMedias(it) }), + SectionItem("Radio Shows", RadioChannel.entries.map { ContentList.RadioShows(it) }), ) private val defaultListsLevels = listOf("app", "pillarbox", "lists") diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseList.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseList.kt index ead4fbd4b..33bf9f5e3 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseList.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseList.kt @@ -20,9 +20,9 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavController import ch.srgssr.pillarbox.demo.R import ch.srgssr.pillarbox.demo.shared.data.Playlist +import ch.srgssr.pillarbox.demo.shared.ui.NavigationRoutes import ch.srgssr.pillarbox.demo.ui.DemoItemView import ch.srgssr.pillarbox.demo.ui.DemoListHeaderView -import ch.srgssr.pillarbox.demo.ui.NavigationRoutes import ch.srgssr.pillarbox.demo.ui.player.SimplePlayerActivity import ch.srgssr.pillarbox.demo.ui.player.mediacontroller.MediaControllerActivity @@ -46,7 +46,8 @@ fun ShowCaseList(navController: NavController) { } val scrollState = rememberScrollState() Column( - modifier = Modifier.verticalScroll(state = scrollState) + modifier = Modifier + .verticalScroll(state = scrollState) .padding(horizontal = 8.dp), verticalArrangement = Arrangement.spacedBy(8.dp) ) { diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseNavigation.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseNavigation.kt index 84b591476..2121afe65 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseNavigation.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/showcases/ShowCaseNavigation.kt @@ -7,7 +7,7 @@ package ch.srgssr.pillarbox.demo.ui.showcases import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import ch.srgssr.pillarbox.demo.DemoPageView -import ch.srgssr.pillarbox.demo.ui.NavigationRoutes +import ch.srgssr.pillarbox.demo.shared.ui.NavigationRoutes import ch.srgssr.pillarbox.demo.ui.composable import ch.srgssr.pillarbox.demo.ui.showcases.adaptive.AdaptivePlayerHome import ch.srgssr.pillarbox.demo.ui.showcases.multiplayer.MultiPlayer diff --git a/pillarbox-demo/src/main/res/values/strings.xml b/pillarbox-demo/src/main/res/values/strings.xml index bd20da7f0..f2a6842ea 100644 --- a/pillarbox-demo/src/main/res/values/strings.xml +++ b/pillarbox-demo/src/main/res/values/strings.xml @@ -4,13 +4,10 @@ --> Pillarbox Demo - Examples Playlists Layouts Story Simple - Information - Showcases MediaController (Android Auto) Resizable player Multi player @@ -20,6 +17,4 @@ Tracking Tracking toggle sample Exoplayer View - Lists - Search From 16cd1cdd4d4a93babc0a8ac93ebe3cec8b0249b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Wed, 8 Nov 2023 16:10:54 +0100 Subject: [PATCH 2/2] Update pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Samuel Défago --- .../java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/ui/TVDemoNavigation.kt index fc6920512..6b6a7805c 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/ui/TVDemoNavigation.kt @@ -20,7 +20,7 @@ import ch.srgssr.pillarbox.demo.tv.player.PlayerActivity /** * The nav host of the demo app on TV. * - * @param navController The [NavHostController] uses to navigate between screens. + * @param navController The [NavHostController] used to navigate between screens. * @param startDestination The start destination to display. * @param modifier The [Modifier] to apply to the [NavHost]. */