Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create first levels in "Lists" #299

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ espresso = "3.5.1"
media3 = "1.1.1"
media = "1.6.0"
guava = "31.1-android"
navigationCompose = "2.7.4"
navigation = "2.7.4"
pagingCompose = "3.2.1"
okhttp = "4.10.0"
retrofit2KotlinxSerializationConverter = "1.0.0"
Expand All @@ -38,7 +38,8 @@ accompanist-navigation-material = { module = "com.google.accompanist:accompanist
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
androidx-navigation-common = { module = "androidx.navigation:navigation-common", version.ref = "navigation" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation" }
androidx-paging-compose = { module = "androidx.paging:paging-compose", version.ref = "pagingCompose" }
androidx-tv-foundation = { module = "androidx.tv:tv-foundation", version.ref = "tvCompose" }
androidx-tv-material = { module = "androidx.tv:tv-material", version.ref = "tvCompose" }
Expand Down
2 changes: 2 additions & 0 deletions pillarbox-demo-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ dependencies {
implementation(libs.androidx.ktx)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material.icons.extended)
implementation(libs.androidx.navigation.common)
implementation(libs.srg.dataprovider.retrofit)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* Copyright (c) SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
package ch.srgssr.pillarbox.demo.ui.integrationLayer
package ch.srgssr.pillarbox.demo.shared.ui.integrationLayer

import androidx.navigation.NavBackStackEntry
import ch.srg.dataProvider.integrationlayer.request.parameters.Bu
import ch.srgssr.pillarbox.demo.ui.integrationLayer.data.RadioChannel
import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data.RadioChannel

private const val RootRoute = "content"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2023. SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
package ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data

import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.ContentList

/**
* Represents a section in the "Lists" tab.
*
* @property title The title of the section.
* @property contentList The list of elements in the section.
*/
data class ContentListSection(
val title: String,
val contentList: List<ContentList>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2023. SRG SSR. All rights reserved.
* License information is available from the LICENSE file.
*/
package ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data

import ch.srg.dataProvider.integrationlayer.request.parameters.Bu
import ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.ContentList

private val bus = listOf(Bu.RTS, Bu.SRF, Bu.RSI, Bu.RTR, Bu.SWI)

/**
* All the sections available in the "Lists" tab.
*/
val contentListSections = listOf(
ContentListSection("TV Topics", bus.map { ContentList.TvTopics(it) }),
ContentListSection("TV Shows", bus.map { ContentList.TvShows(it) }),
ContentListSection("TV Latest medias", bus.map { ContentList.TVLatestMedias(it) }),
ContentListSection("TV Livestreams", bus.map { ContentList.TVLivestreams(it) }),
ContentListSection("TV Live center", bus.map { ContentList.TVLiveCenter(it) }),
ContentListSection("TV Live web", bus.map { ContentList.TVLiveWeb(it) }),
ContentListSection("Radio livestream", bus.map { ContentList.RadioLiveStreams(it) }),
ContentListSection("Radio Latest medias", RadioChannel.entries.map { ContentList.RadioLatestMedias(it) }),
ContentListSection("Radio Shows", RadioChannel.entries.map { ContentList.RadioShows(it) }),
)
Original file line number Diff line number Diff line change
Expand Up @@ -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.integrationLayer.data
package ch.srgssr.pillarbox.demo.shared.ui.integrationLayer.data

import ch.srg.dataProvider.integrationlayer.request.parameters.Bu

Expand Down
1 change: 1 addition & 0 deletions pillarbox-demo-tv/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies {
implementation(project(mapOf("path" to ":pillarbox-demo-shared")))
implementation(libs.androidx.ktx)
implementation(libs.leanback)
implementation(libs.srg.dataprovider.retrofit)

val composeBom = libs.androidx.compose.bom
implementation(platform(composeBom))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ 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.compose.ui.tooling.preview.Preview
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.Text
import ch.srgssr.pillarbox.demo.shared.ui.HomeDestination
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.theme.PillarboxTheme

/**
Expand All @@ -28,7 +27,6 @@ import ch.srgssr.pillarbox.demo.tv.ui.theme.PillarboxTheme
* @param modifier The [Modifier] to apply to the [NavHost].
*/
@Composable
@OptIn(ExperimentalTvMaterial3Api::class)
fun TVDemoNavigation(
navController: NavHostController,
startDestination: HomeDestination,
Expand All @@ -48,8 +46,9 @@ fun TVDemoNavigation(
}

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))
ListsHome(
sections = contentListSections
)
}
}
}
Expand Down
Loading
Loading