diff --git a/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/category/PodcastCategory.kt b/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/category/PodcastCategory.kt index 0f6e021c82..e1ab2bb7bf 100644 --- a/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/category/PodcastCategory.kt +++ b/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/category/PodcastCategory.kt @@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width -import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.grid.LazyGridScope import androidx.compose.foundation.lazy.grid.items @@ -54,33 +53,6 @@ import com.example.jetcaster.ui.theme.JetcasterTheme import com.example.jetcaster.util.ToggleFollowPodcastIconButton import com.example.jetcaster.util.fullWidthItem -fun LazyListScope.podcastCategory( - podcastCategoryFilterResult: PodcastCategoryFilterResult, - navigateToPodcastDetails: (PodcastInfo) -> Unit, - navigateToPlayer: (EpisodeInfo) -> Unit, - onQueueEpisode: (PlayerEpisode) -> Unit, - onTogglePodcastFollowed: (PodcastInfo) -> Unit, -) { - item { - CategoryPodcasts( - topPodcasts = podcastCategoryFilterResult.topPodcasts, - navigateToPodcastDetails = navigateToPodcastDetails, - onTogglePodcastFollowed = onTogglePodcastFollowed - ) - } - - val episodes = podcastCategoryFilterResult.episodes - items(episodes, key = { it.episode.uri }) { item -> - EpisodeListItem( - episode = item.episode, - podcast = item.podcast, - onClick = navigateToPlayer, - onQueueEpisode = onQueueEpisode, - modifier = Modifier.fillParentMaxWidth() - ) - } -} - fun LazyGridScope.podcastCategory( podcastCategoryFilterResult: PodcastCategoryFilterResult, navigateToPodcastDetails: (PodcastInfo) -> Unit, diff --git a/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/discover/Discover.kt b/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/discover/Discover.kt index 4fafc7353d..1bf0d6017e 100644 --- a/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/discover/Discover.kt +++ b/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/discover/Discover.kt @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.grid.LazyGridScope import androidx.compose.foundation.lazy.itemsIndexed @@ -49,41 +48,6 @@ import com.example.jetcaster.designsystem.theme.Keyline1 import com.example.jetcaster.ui.home.category.podcastCategory import com.example.jetcaster.util.fullWidthItem -fun LazyListScope.discoverItems( - filterableCategoriesModel: FilterableCategoriesModel, - podcastCategoryFilterResult: PodcastCategoryFilterResult, - navigateToPodcastDetails: (PodcastInfo) -> Unit, - navigateToPlayer: (EpisodeInfo) -> Unit, - onCategorySelected: (CategoryInfo) -> Unit, - onTogglePodcastFollowed: (PodcastInfo) -> Unit, - onQueueEpisode: (PlayerEpisode) -> Unit, -) { - if (filterableCategoriesModel.isEmpty) { - // TODO: empty state - return - } - - item { - Spacer(Modifier.height(8.dp)) - - PodcastCategoryTabs( - filterableCategoriesModel = filterableCategoriesModel, - onCategorySelected = onCategorySelected, - modifier = Modifier.fillMaxWidth() - ) - - Spacer(Modifier.height(8.dp)) - } - - podcastCategory( - podcastCategoryFilterResult = podcastCategoryFilterResult, - navigateToPodcastDetails = navigateToPodcastDetails, - navigateToPlayer = navigateToPlayer, - onTogglePodcastFollowed = onTogglePodcastFollowed, - onQueueEpisode = onQueueEpisode, - ) -} - fun LazyGridScope.discoverItems( filterableCategoriesModel: FilterableCategoriesModel, podcastCategoryFilterResult: PodcastCategoryFilterResult, diff --git a/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/library/Library.kt b/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/library/Library.kt index 425f964d17..9d654dbdec 100644 --- a/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/library/Library.kt +++ b/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/library/Library.kt @@ -18,10 +18,8 @@ package com.example.jetcaster.ui.home.library import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.grid.LazyGridScope import androidx.compose.foundation.lazy.grid.items -import androidx.compose.foundation.lazy.items import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.ui.Modifier @@ -35,36 +33,6 @@ import com.example.jetcaster.designsystem.theme.Keyline1 import com.example.jetcaster.ui.shared.EpisodeListItem import com.example.jetcaster.util.fullWidthItem -fun LazyListScope.libraryItems( - library: LibraryInfo, - navigateToPlayer: (EpisodeInfo) -> Unit, - onQueueEpisode: (PlayerEpisode) -> Unit -) { - item { - Text( - text = stringResource(id = R.string.latest_episodes), - modifier = Modifier.padding( - start = Keyline1, - top = 16.dp, - ), - style = MaterialTheme.typography.titleLarge, - ) - } - - items( - library, - key = { it.episode.uri } - ) { item -> - EpisodeListItem( - episode = item.episode, - podcast = item.podcast, - onClick = navigateToPlayer, - onQueueEpisode = onQueueEpisode, - modifier = Modifier.fillParentMaxWidth(), - ) - } -} - fun LazyGridScope.libraryItems( library: LibraryInfo, navigateToPlayer: (EpisodeInfo) -> Unit,