Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -338,7 +337,7 @@ fun FollowedPodcasts(
lastEpisodeDateText = lastEpisodeDate?.let { lastUpdated(it) },
modifier = Modifier
.padding(4.dp)
.fillMaxHeight()
.fillMaxSize()
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.example.jetcaster.R
import com.example.jetcaster.data.Episode
import com.example.jetcaster.data.EpisodeToPodcast
import com.example.jetcaster.data.Podcast
import com.example.jetcaster.data.PodcastWithExtraInfo
import com.example.jetcaster.ui.home.PreviewEpisodes
Expand Down Expand Up @@ -106,9 +105,23 @@ fun PodcastCategory(
/**
* TODO: reset scroll position when category changes
*/
Column(modifier = modifier) {
CategoryPodcasts(viewState.topPodcasts, viewModel)
EpisodeList(viewState.episodes, navigateToPlayer)
LazyColumn(
contentPadding = PaddingValues(0.dp),
verticalArrangement = Arrangement.Center,
modifier = modifier
) {
item {
CategoryPodcasts(viewState.topPodcasts, viewModel)
}

items(viewState.episodes, key = { it.episode.uri }) { item ->
EpisodeListItem(
episode = item.episode,
podcast = item.podcast,
onClick = navigateToPlayer,
modifier = Modifier.fillParentMaxWidth()
)
}
}
}

Expand All @@ -124,27 +137,6 @@ private fun CategoryPodcasts(
)
}

@Composable
private fun EpisodeList(
episodes: List<EpisodeToPodcast>,
navigateToPlayer: (String) -> Unit
) {
LazyColumn(
contentPadding = PaddingValues(0.dp),
verticalArrangement = Arrangement.Center
) {

items(episodes, key = { it.episode.uri }) { item ->
EpisodeListItem(
episode = item.episode,
podcast = item.podcast,
onClick = navigateToPlayer,
modifier = Modifier.fillParentMaxWidth()
)
}
}
}

@Composable
fun EpisodeListItem(
episode: Episode,
Expand Down