diff --git a/features/playlist/src/main/java/com/m3u/features/playlist/internal/TvPlaylistScreenImpl.kt b/features/playlist/src/main/java/com/m3u/features/playlist/internal/TvPlaylistScreenImpl.kt index 4d5af334c..237165065 100644 --- a/features/playlist/src/main/java/com/m3u/features/playlist/internal/TvPlaylistScreenImpl.kt +++ b/features/playlist/src/main/java/com/m3u/features/playlist/internal/TvPlaylistScreenImpl.kt @@ -29,8 +29,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.tv.foundation.lazy.list.TvLazyColumn import androidx.tv.material3.DenseListItem -import androidx.tv.material3.ImmersiveList -import androidx.tv.material3.ListItemDefaults as TvListItemDefaults import com.m3u.core.architecture.preferences.hiltPreferences import com.m3u.data.database.model.Programme import com.m3u.data.database.model.Stream @@ -50,6 +48,7 @@ import dev.chrisbanes.haze.HazeDefaults import dev.chrisbanes.haze.HazeStyle import dev.chrisbanes.haze.haze import dev.chrisbanes.haze.hazeChild +import androidx.tv.material3.ListItemDefaults as TvListItemDefaults import androidx.tv.material3.MaterialTheme as TvMaterialTheme import androidx.tv.material3.Text as TvText @@ -95,44 +94,42 @@ internal fun TvPlaylistScreenImpl( var focus: Stream? by remember { mutableStateOf(null) } val content = @Composable { - ImmersiveList( - modifier = modifier.fillMaxWidth(), - background = { _, _ -> - ImmersiveBackground( - title = title, - stream = focus, - maxBrowserHeight = maxBrowserHeight, - onRefresh = onRefresh, - openSearchDrawer = {}, - openSortDrawer = { isSortSheetVisible = true }, - getProgrammeCurrently = getProgrammeCurrently, - modifier = Modifier.haze( + Box( + modifier = modifier.fillMaxWidth() + ) { + ImmersiveBackground( + title = title, + stream = focus, + maxBrowserHeight = maxBrowserHeight, + onRefresh = onRefresh, + openSearchDrawer = {}, + openSortDrawer = { isSortSheetVisible = true }, + getProgrammeCurrently = getProgrammeCurrently, + modifier = Modifier.haze( + LocalHazeState.current, + HazeDefaults.style(TvMaterialTheme.colorScheme.background) + ) + ) + TvStreamGallery( + channels = channels, + maxBrowserHeight = maxBrowserHeight, + isSpecifiedSort = useGridLayout, + isVodOrSeriesPlaylist = isVodOrSeriesPlaylist, + onClick = onStream, + onLongClick = { stream -> press = stream }, + onFocus = { stream -> focus = stream }, + modifier = Modifier + .hazeChild( LocalHazeState.current, - HazeDefaults.style(TvMaterialTheme.colorScheme.background) + style = HazeStyle(blurRadius = 4.dp) ) - ) - }, - list = { - TvStreamGallery( - channels = channels, - maxBrowserHeight = maxBrowserHeight, - isSpecifiedSort = useGridLayout, - isVodOrSeriesPlaylist = isVodOrSeriesPlaylist, - onClick = onStream, - onLongClick = { stream -> press = stream }, - onFocus = { stream -> focus = stream }, - modifier = Modifier - .hazeChild( - LocalHazeState.current, - style = HazeStyle(blurRadius = 4.dp) - ) - .blurEdge( - color = TvMaterialTheme.colorScheme.background, - edge = Edge.Top - ) - ) - } - ) + .blurEdge( + color = TvMaterialTheme.colorScheme.background, + edge = Edge.Top + ) + .align(Alignment.BottomCenter) + ) + } } Background { @@ -199,18 +196,24 @@ private fun MenuFullScreenDialog( item { DenseListItem( selected = false, + headlineContent = { + TvText( + text = stream?.title.orEmpty(), + maxLines = 1, + style = TvMaterialTheme.typography.titleLarge + ) + }, onClick = {} - ) { - TvText( - text = stream?.title.orEmpty(), - maxLines = 1, - style = TvMaterialTheme.typography.titleLarge - ) - } + ) } item { DenseListItem( selected = false, + headlineContent = { + TvText( + text = favouriteTitle + ) + }, onClick = { stream?.let { stream -> favorite(stream.id) @@ -224,11 +227,7 @@ private fun MenuFullScreenDialog( ) }, scale = TvListItemDefaults.scale(0.95f, 1f) - ) { - TvText( - text = favouriteTitle - ) - } + ) } item { DenseListItem( @@ -239,6 +238,11 @@ private fun MenuFullScreenDialog( onDismissRequest() } }, + headlineContent = { + TvText( + text = hideTitle + ) + }, leadingContent = { Icon( imageVector = Icons.Rounded.Delete, @@ -246,11 +250,7 @@ private fun MenuFullScreenDialog( ) }, scale = TvListItemDefaults.scale(0.95f, 1f) - ) { - TvText( - text = hideTitle - ) - } + ) } item { DenseListItem( @@ -261,6 +261,11 @@ private fun MenuFullScreenDialog( onDismissRequest() } }, + headlineContent = { + TvText( + text = createShortcutTitle + ) + }, leadingContent = { Icon( imageVector = Icons.AutoMirrored.Rounded.Shortcut, @@ -268,11 +273,7 @@ private fun MenuFullScreenDialog( ) }, scale = TvListItemDefaults.scale(0.95f, 1f) - ) { - TvText( - text = createShortcutTitle - ) - } + ) } item { DenseListItem( @@ -283,6 +284,11 @@ private fun MenuFullScreenDialog( onDismissRequest() } }, + headlineContent = { + TvText( + text = savePictureTitle + ) + }, leadingContent = { Icon( imageVector = Icons.Rounded.Image, @@ -290,11 +296,7 @@ private fun MenuFullScreenDialog( ) }, scale = TvListItemDefaults.scale(0.95f, 1f) - ) { - TvText( - text = savePictureTitle - ) - } + ) } } BackHandler { diff --git a/features/stream/src/main/java/com/m3u/features/stream/components/ProgrammeGuide.kt b/features/stream/src/main/java/com/m3u/features/stream/components/ProgrammeGuide.kt index ded76570b..441768f27 100644 --- a/features/stream/src/main/java/com/m3u/features/stream/components/ProgrammeGuide.kt +++ b/features/stream/src/main/java/com/m3u/features/stream/components/ProgrammeGuide.kt @@ -47,7 +47,6 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.zIndex import androidx.constraintlayout.compose.ConstraintLayout import androidx.paging.compose.LazyPagingItems -import androidx.tv.material3.NonInteractiveSurfaceDefaults import coil.compose.AsyncImage import com.m3u.core.architecture.preferences.hiltPreferences import com.m3u.data.database.model.Programme @@ -78,6 +77,7 @@ import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds import androidx.tv.material3.MaterialTheme as TvMaterialTheme import androidx.tv.material3.Surface as TvSurface +import androidx.tv.material3.SurfaceDefaults as TvSurfaceDefaults private enum class Zoom(val time: Float) { DEFAULT(1f), ZOOM_1_5(1.5f), ZOOM_2(2f), ZOOM_5(5f) @@ -357,7 +357,7 @@ private fun ProgrammeCell( ) } else { TvSurface( - colors = NonInteractiveSurfaceDefaults.colors(TvMaterialTheme.colorScheme.tertiaryContainer), + colors = TvSurfaceDefaults.colors(TvMaterialTheme.colorScheme.tertiaryContainer), shape = AbsoluteRoundedCornerShape(4.dp), modifier = modifier, content = { content() } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3b32d9cea..4ea023767 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ androidx-compose-material3-adaptive = "1.0.0-beta02" androidx-constraintlayout-compose = "1.0.1" androidx-navigation = "2.7.7" androidx-hilt = "1.2.0" -androidx-tv = "1.0.0-alpha10" +androidx-tv = "1.0.0-SNAPSHOT" androidx-media3 = "1.3.1" androidx-work = "2.9.0" androidx-room = "2.6.1" diff --git a/settings.gradle.kts b/settings.gradle.kts index 471c4fec2..09980a12e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,6 +12,7 @@ dependencyResolutionManagement { mavenCentral() maven("https://jitpack.io") maven("https://plugins.gradle.org/m2/") + maven("https://androidx.dev/snapshots/builds/11911046/artifacts/repository") } } rootProject.name = "M3U" diff --git a/ui/src/main/java/com/m3u/ui/SortBottomSheet.kt b/ui/src/main/java/com/m3u/ui/SortBottomSheet.kt index 838548ab2..6a523f22e 100644 --- a/ui/src/main/java/com/m3u/ui/SortBottomSheet.kt +++ b/ui/src/main/java/com/m3u/ui/SortBottomSheet.kt @@ -161,6 +161,9 @@ fun TvSortFullScreenDialog( selected = currentSort == sort, onClick = { onChanged(currentSort) }, leadingContent = {}, + headlineContent = { + TvText(currentSort.name) + }, trailingContent = { if (currentSort == sort) { Icon( @@ -170,9 +173,7 @@ fun TvSortFullScreenDialog( } }, scale = TvListItemDefaults.scale(0.95f, 1f) - ) { - TvText(currentSort.name) - } + ) } } BackHandler {