-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
321 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ssr/pillarbox/demo/ui/NavigationRoutes.kt → ...larbox/demo/shared/ui/NavigationRoutes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright (c) 2023. SRG SSR. All rights reserved. | ||
~ License information is available from the LICENSE file. | ||
--> | ||
<resources> | ||
<string name="examples">Examples</string> | ||
<string name="info">Information</string> | ||
<string name="lists">Lists</string> | ||
<string name="search">Search</string> | ||
<string name="showcases">Showcases</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/DemoTvApplication.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
pillarbox-demo-tv/src/main/java/ch/srgssr/pillarbox/demo/tv/ui/TVDemoNavigation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) | ||
} | ||
} | ||
} |
Oops, something went wrong.