Skip to content

Commit 8f05627

Browse files
committed
Fix transition animation showing a weird jump
1 parent 2d6161e commit 8f05627

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/MainActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/ui/JetcasterApp.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/ui/component/PodcastCard.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal fun PodcastCard(
4141
onClick = onClick,
4242
interactionSource = it,
4343
scale = CardScale.None,
44-
shape = CardDefaults.shape(RoundedCornerShape(16.dp))
44+
shape = CardDefaults.shape(RoundedCornerShape(12.dp))
4545
) {
4646
Thumbnail(
4747
podcastInfo = podcastInfo,

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/ui/episode/EpisodeScreen.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.Arrangement
2020
import androidx.compose.foundation.layout.Column
2121
import androidx.compose.foundation.layout.Row
2222
import androidx.compose.foundation.layout.Spacer
23+
import androidx.compose.foundation.layout.fillMaxSize
2324
import androidx.compose.foundation.layout.height
2425
import androidx.compose.foundation.layout.padding
2526
import 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
}

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/ui/podcast/PodcastDetailsScreen.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)