File tree Expand file tree Collapse file tree 7 files changed +25
-8
lines changed
Jetcaster/tv/src/main/java/com/example/jetcaster/tv Expand file tree Collapse file tree 7 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ class MainActivity : ComponentActivity() {
3737 override fun onCreate (savedInstanceState : Bundle ? ) {
3838 super .onCreate(savedInstanceState)
3939 setContent {
40- JetcasterTheme {
40+ // TV is hardcoded to dark mode to match TV ui
41+ JetcasterTheme (isInDarkTheme = true ) {
4142 Surface (
4243 modifier = Modifier .fillMaxSize(),
4344 shape = RectangleShape
Original file line number Diff line number Diff line change @@ -217,13 +217,15 @@ private fun Route(jetcasterAppState: JetcasterAppState) {
217217 composable(Screen .Profile .route) {
218218 ProfileScreen (
219219 modifier = Modifier
220+ .fillMaxSize()
220221 .padding(JetcasterAppDefaults .overScanMargin.default.intoPaddingValues())
221222 )
222223 }
223224
224225 composable(Screen .Settings .route) {
225226 SettingsScreen (
226227 modifier = Modifier
228+ .fillMaxSize()
227229 .padding(JetcasterAppDefaults .overScanMargin.default.intoPaddingValues())
228230 )
229231 }
Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ import androidx.compose.foundation.layout.height
2323import androidx.compose.foundation.layout.padding
2424import androidx.compose.foundation.layout.size
2525import androidx.compose.foundation.layout.width
26+ import androidx.compose.foundation.shape.RoundedCornerShape
2627import androidx.compose.runtime.Composable
2728import androidx.compose.runtime.remember
2829import androidx.compose.ui.Modifier
2930import androidx.compose.ui.text.style.TextOverflow
3031import androidx.compose.ui.unit.DpSize
3132import androidx.compose.ui.unit.dp
3233import androidx.tv.material3.Card
34+ import androidx.tv.material3.CardDefaults
3335import androidx.tv.material3.CardScale
3436import androidx.tv.material3.ExperimentalTvMaterial3Api
3537import androidx.tv.material3.MaterialTheme
@@ -73,6 +75,7 @@ private fun EpisodeThumbnail(
7375 onClick = onClick,
7476 interactionSource = interactionSource,
7577 scale = CardScale .None ,
78+ shape = CardDefaults .shape(RoundedCornerShape (12 .dp)),
7679 modifier = modifier,
7780 ) {
7881 Thumbnail (episode = playerEpisode, size = JetcasterAppDefaults .thumbnailSize.episode)
Original file line number Diff line number Diff line change 1717package com.example.jetcaster.tv.ui.component
1818
1919import androidx.compose.foundation.layout.padding
20+ import androidx.compose.foundation.shape.RoundedCornerShape
2021import androidx.compose.runtime.Composable
2122import androidx.compose.ui.Modifier
2223import androidx.compose.ui.unit.dp
2324import androidx.tv.material3.Card
25+ import androidx.tv.material3.CardDefaults
2426import androidx.tv.material3.CardScale
2527import androidx.tv.material3.StandardCardContainer
2628import androidx.tv.material3.Text
@@ -39,6 +41,7 @@ internal fun PodcastCard(
3941 onClick = onClick,
4042 interactionSource = it,
4143 scale = CardScale .None ,
44+ shape = CardDefaults .shape(RoundedCornerShape (12 .dp))
4245 ) {
4346 Thumbnail (
4447 podcastInfo = podcastInfo,
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.Arrangement
2020import androidx.compose.foundation.layout.Column
2121import androidx.compose.foundation.layout.Row
2222import androidx.compose.foundation.layout.Spacer
23+ import androidx.compose.foundation.layout.fillMaxSize
2324import androidx.compose.foundation.layout.height
2425import androidx.compose.foundation.layout.padding
2526import androidx.compose.runtime.Composable
@@ -52,16 +53,18 @@ fun EpisodeScreen(
5253
5354 val uiState by episodeScreenViewModel.uiStateFlow.collectAsState()
5455
56+ val screenModifier = modifier.fillMaxSize()
5557 when (val s = uiState) {
56- EpisodeScreenUiState .Loading -> Loading (modifier = modifier )
57- EpisodeScreenUiState .Error -> ErrorState (backToHome = backToHome, modifier = modifier )
58+ EpisodeScreenUiState .Loading -> Loading (modifier = screenModifier )
59+ EpisodeScreenUiState .Error -> ErrorState (backToHome = backToHome, modifier = screenModifier )
5860 is EpisodeScreenUiState .Ready -> EpisodeDetailsWithBackground (
5961 playerEpisode = s.playerEpisode,
6062 playEpisode = {
6163 episodeScreenViewModel.play(it)
6264 playEpisode()
6365 },
64- addPlayList = episodeScreenViewModel::addPlayList
66+ addPlayList = episodeScreenViewModel::addPlayList,
67+ modifier = screenModifier
6568 )
6669 }
6770}
Original file line number Diff line number Diff line change @@ -128,7 +128,6 @@ private fun PodcastDetailsWithBackground(
128128 enqueue = enqueue,
129129 modifier = Modifier
130130 .fillMaxSize()
131- .padding(JetcasterAppDefaults .overScanMargin.podcast.intoPaddingValues())
132131 )
133132 }
134133}
@@ -157,7 +156,12 @@ private fun PodcastDetails(
157156 isSubscribed = isSubscribed,
158157 subscribe = subscribe,
159158 unsubscribe = unsubscribe,
160- modifier = Modifier .weight(0.3f ),
159+ modifier = Modifier
160+ .weight(0.3f )
161+ .padding(
162+ JetcasterAppDefaults .overScanMargin.podcast.copy(end = 0 .dp)
163+ .intoPaddingValues()
164+ ),
161165 )
162166 },
163167 second = {
@@ -258,7 +262,8 @@ private fun PodcastEpisodeList(
258262) {
259263 TvLazyColumn (
260264 verticalArrangement = Arrangement .spacedBy(JetcasterAppDefaults .gap.podcastRow),
261- modifier = modifier
265+ modifier = modifier,
266+ contentPadding = JetcasterAppDefaults .overScanMargin.podcast.intoPaddingValues()
262267 ) {
263268 items(episodeList) {
264269 EpisodeListItem (
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ internal data class OverScanMarginSettings(
3434 val default : OverScanMargin = OverScanMargin (),
3535 val catalog : OverScanMargin = OverScanMargin (end = 0.dp),
3636 val episode : OverScanMargin = OverScanMargin (start = 80.dp, end = 80.dp),
37- val drawer : OverScanMargin = OverScanMargin (start = 0 .dp, end = 0 .dp),
37+ val drawer : OverScanMargin = OverScanMargin (start = 16 .dp, end = 16 .dp),
3838 val podcast : OverScanMargin = OverScanMargin (
3939 top = 40.dp,
4040 bottom = 40.dp,
You can’t perform that action at this time.
0 commit comments