refactor: removed old podcast section

This commit is contained in:
antonio 2023-05-07 23:41:51 +02:00
parent 5623569667
commit 87cd843a3f
2 changed files with 0 additions and 68 deletions

View file

@ -40,7 +40,6 @@ import com.cappielloantonio.play.ui.adapter.ArtistAdapter;
import com.cappielloantonio.play.ui.adapter.ArtistHorizontalAdapter;
import com.cappielloantonio.play.ui.adapter.DiscoverSongAdapter;
import com.cappielloantonio.play.ui.adapter.GridTrackAdapter;
import com.cappielloantonio.play.ui.adapter.PodcastEpisodeAdapter;
import com.cappielloantonio.play.ui.adapter.SimilarTrackAdapter;
import com.cappielloantonio.play.ui.adapter.SongHorizontalAdapter;
import com.cappielloantonio.play.ui.adapter.YearAdapter;
@ -76,7 +75,6 @@ public class HomeTabMusicFragment extends Fragment implements ClickCallback {
private AlbumAdapter mostPlayedAlbumAdapter;
private AlbumHorizontalAdapter newReleasesAlbumAdapter;
private YearAdapter yearAdapter;
private PodcastEpisodeAdapter podcastEpisodeAdapter;
private GridTrackAdapter gridTrackAdapter;
private ListenableFuture<MediaBrowser> mediaBrowserListenableFuture;
@ -112,7 +110,6 @@ public class HomeTabMusicFragment extends Fragment implements ClickCallback {
initNewReleasesView();
initYearSongView();
initRecentAddedAlbumView();
initNewestPodcastsView();
initGridView();
}
@ -615,26 +612,6 @@ public class HomeTabMusicFragment extends Fragment implements ClickCallback {
recentAddedAlbumSnapHelper.attachToRecyclerView(bind.recentlyAddedAlbumsRecyclerView);
}
private void initNewestPodcastsView() {
bind.newestPodcastsViewPager.setOrientation(ViewPager2.ORIENTATION_HORIZONTAL);
podcastEpisodeAdapter = new PodcastEpisodeAdapter(this);
bind.newestPodcastsViewPager.setAdapter(podcastEpisodeAdapter);
bind.newestPodcastsViewPager.setOffscreenPageLimit(1);
homeViewModel.getNewestPodcastEpisodes(getViewLifecycleOwner()).observe(getViewLifecycleOwner(), podcastEpisodes -> {
if (podcastEpisodes == null) {
if (bind != null) bind.homeNewestPodcastsSector.setVisibility(View.GONE);
} else {
if (bind != null)
bind.homeNewestPodcastsSector.setVisibility(!podcastEpisodes.isEmpty() ? View.VISIBLE : View.GONE);
podcastEpisodeAdapter.setItems(podcastEpisodes);
}
});
setSlideViewOffset(bind.newestPodcastsViewPager, 20, 16);
}
private void initGridView() {
bind.gridTracksRecyclerView.setLayoutManager(new GridLayoutManager(requireContext(), 3));
bind.gridTracksRecyclerView.addItemDecoration(new GridItemDecoration(3, 8, false));
@ -686,7 +663,6 @@ public class HomeTabMusicFragment extends Fragment implements ClickCallback {
// bind.homeLinearLayoutContainer.addView(bind.homeFlashbackSector);
// bind.homeLinearLayoutContainer.addView(bind.homeMostPlayedAlbumsSector);
// bind.homeLinearLayoutContainer.addView(bind.homeRecentlyPlayedAlbumsSector);
// bind.homeLinearLayoutContainer.addView(bind.homeNewestPodcastsSector);
}
}
@ -774,15 +750,4 @@ public class HomeTabMusicFragment extends Fragment implements ClickCallback {
public void onYearClick(Bundle bundle) {
Navigation.findNavController(requireView()).navigate(R.id.songListPageFragment, bundle);
}
@Override
public void onPodcastClick(Bundle bundle) {
MediaManager.startQueue(mediaBrowserListenableFuture, bundle.getParcelable(Constants.PODCAST_OBJECT));
activity.setBottomSheetInPeek(true);
}
@Override
public void onPodcastLongClick(Bundle bundle) {
Navigation.findNavController(requireView()).navigate(R.id.podcastBottomSheetDialog, bundle);
}
}

View file

@ -732,39 +732,6 @@
android:id="@+id/home_recently_added_albums_placeholder"
layout="@layout/item_placeholder_album"
android:visibility="gone" />
<!-- Podcasts -->
<LinearLayout
android:id="@+id/home_newest_podcasts_sector"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
style="@style/Divider"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp" />
<TextView
style="@style/TitleLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:text="@string/home_title_newest_podcasts" />
<!-- slideview -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/newest_podcasts_view_pager"
android:layout_width="match_parent"
android:layout_height="258dp"
android:clipToPadding="false"
android:paddingBottom="8dp" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>