mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 09:53:33 +00:00
Refactor Song to Media
This commit is contained in:
parent
62f2723014
commit
d1d341ff9b
43 changed files with 242 additions and 274 deletions
|
|
@ -3,8 +3,6 @@ package com.cappielloantonio.play.ui.fragment;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.graphics.BlendMode;
|
||||
import android.graphics.BlendModeColorFilter;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
|
@ -14,7 +12,6 @@ import android.view.ViewGroup;
|
|||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.media3.session.MediaBrowser;
|
||||
|
|
@ -30,7 +27,7 @@ import com.cappielloantonio.play.databinding.FragmentArtistPageBinding;
|
|||
import com.cappielloantonio.play.glide.CustomGlideRequest;
|
||||
import com.cappielloantonio.play.helper.recyclerview.CustomLinearSnapHelper;
|
||||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.repository.ArtistRepository;
|
||||
import com.cappielloantonio.play.service.MediaManager;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
|
|
@ -41,7 +38,6 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ArtistPageFragment extends Fragment {
|
||||
private static final String TAG = "ArtistPageFragment";
|
||||
|
|
@ -102,7 +98,7 @@ public class ArtistPageFragment extends Fragment {
|
|||
|
||||
bind.mostStreamedSongTextViewClickable.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.BY_ARTIST, Song.BY_ARTIST);
|
||||
bundle.putString(Media.BY_ARTIST, Media.BY_ARTIST);
|
||||
bundle.putParcelable("artist_object", artistPageViewModel.getArtist());
|
||||
activity.navController.navigate(R.id.action_artistPageFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
|
|
@ -170,7 +166,7 @@ public class ArtistPageFragment extends Fragment {
|
|||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
if (media.size() > 0) {
|
||||
MediaManager.startQueue(mediaBrowserListenableFuture, requireContext(), (ArrayList<Song>) media, 0);
|
||||
MediaManager.startQueue(mediaBrowserListenableFuture, requireContext(), (ArrayList<Media>) media, 0);
|
||||
activity.setBottomSheetInPeek(true);
|
||||
} else {
|
||||
Toast.makeText(requireContext(), getString(R.string.artist_error_retrieving_radio), Toast.LENGTH_SHORT).show();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import android.view.ViewGroup;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.media3.session.MediaBrowser;
|
||||
|
|
@ -21,12 +20,10 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||
import androidx.recyclerview.widget.SnapHelper;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.adapter.AlbumHorizontalAdapter;
|
||||
import com.cappielloantonio.play.adapter.ArtistHorizontalAdapter;
|
||||
import com.cappielloantonio.play.adapter.PlaylistAdapter;
|
||||
import com.cappielloantonio.play.adapter.PlaylistHorizontalAdapter;
|
||||
import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
||||
import com.cappielloantonio.play.databinding.FragmentDownloadBinding;
|
||||
|
|
@ -34,7 +31,7 @@ import com.cappielloantonio.play.helper.recyclerview.DotsIndicatorDecoration;
|
|||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Artist;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.UIUtil;
|
||||
|
|
@ -153,7 +150,7 @@ public class DownloadFragment extends Fragment {
|
|||
|
||||
bind.downloadedTracksTextViewClickable.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.DOWNLOADED, Song.DOWNLOADED);
|
||||
bundle.putString(Media.DOWNLOADED, Media.DOWNLOADED);
|
||||
activity.navController.navigate(R.id.action_downloadFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import androidx.lifecycle.ViewModelProvider;
|
|||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.databinding.FragmentFilterBinding;
|
||||
import com.cappielloantonio.play.model.Genre;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.MusicUtil;
|
||||
import com.cappielloantonio.play.viewmodel.FilterViewModel;
|
||||
|
|
@ -57,7 +57,7 @@ public class FilterFragment extends Fragment {
|
|||
|
||||
private void init() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.BY_GENRES, Song.BY_GENRES);
|
||||
bundle.putString(Media.BY_GENRES, Media.BY_GENRES);
|
||||
bundle.putStringArrayList("filters_list", filterViewModel.getFilters());
|
||||
bundle.putStringArrayList("filter_name_list", filterViewModel.getFilterNames());
|
||||
bind.finishFilteringTextViewClickable.setOnClickListener(v -> {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import com.cappielloantonio.play.R;
|
|||
import com.cappielloantonio.play.adapter.GenreCatalogueAdapter;
|
||||
import com.cappielloantonio.play.databinding.FragmentGenreCatalogueBinding;
|
||||
import com.cappielloantonio.play.helper.recyclerview.GridItemDecoration;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.viewmodel.GenreCatalogueViewModel;
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ public class GenreCatalogueFragment extends Fragment {
|
|||
bind.genreCatalogueRecyclerView.setAdapter(genreCatalogueAdapter);
|
||||
genreCatalogueAdapter.setClickListener((view, position) -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.BY_GENRE, Song.BY_GENRE);
|
||||
bundle.putString(Media.BY_GENRE, Media.BY_GENRE);
|
||||
bundle.putParcelable("genre_object", genreCatalogueAdapter.getItem(position));
|
||||
activity.navController.navigate(R.id.action_genreCatalogueFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.cappielloantonio.play.ui.fragment;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
|
@ -42,7 +41,7 @@ import com.cappielloantonio.play.helper.recyclerview.DotsIndicatorDecoration;
|
|||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Artist;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.MusicUtil;
|
||||
|
|
@ -181,7 +180,7 @@ public class HomeFragment extends Fragment {
|
|||
|
||||
bind.starredTracksTextViewClickable.setOnClickListener(v -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.STARRED, Song.STARRED);
|
||||
bundle.putString(Media.STARRED, Media.STARRED);
|
||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
|
||||
|
|
@ -451,7 +450,7 @@ public class HomeFragment extends Fragment {
|
|||
yearAdapter = new YearAdapter(requireContext());
|
||||
yearAdapter.setClickListener((view, position) -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.BY_YEAR, Song.BY_YEAR);
|
||||
bundle.putString(Media.BY_YEAR, Media.BY_YEAR);
|
||||
bundle.putInt("year_object", yearAdapter.getItem(position));
|
||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,32 +10,21 @@ import android.view.ViewGroup;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||
import androidx.recyclerview.widget.SnapHelper;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.adapter.AlbumAdapter;
|
||||
import com.cappielloantonio.play.adapter.AlbumHorizontalAdapter;
|
||||
import com.cappielloantonio.play.adapter.ArtistAdapter;
|
||||
import com.cappielloantonio.play.adapter.GenreAdapter;
|
||||
import com.cappielloantonio.play.adapter.PlaylistAdapter;
|
||||
import com.cappielloantonio.play.adapter.PlaylistDialogHorizontalAdapter;
|
||||
import com.cappielloantonio.play.adapter.PlaylistHorizontalAdapter;
|
||||
import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
||||
import com.cappielloantonio.play.databinding.FragmentLibraryBinding;
|
||||
import com.cappielloantonio.play.helper.recyclerview.CustomLinearSnapHelper;
|
||||
import com.cappielloantonio.play.helper.recyclerview.DotsIndicatorDecoration;
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Playlist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
import com.cappielloantonio.play.util.UIUtil;
|
||||
import com.cappielloantonio.play.viewmodel.LibraryViewModel;
|
||||
import com.google.android.gms.cast.framework.CastButtonFactory;
|
||||
|
||||
|
|
@ -201,7 +190,7 @@ public class LibraryFragment extends Fragment {
|
|||
genreAdapter = new GenreAdapter(requireContext());
|
||||
genreAdapter.setClickListener((view, position) -> {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Song.BY_GENRE, Song.BY_GENRE);
|
||||
bundle.putString(Media.BY_GENRE, Media.BY_GENRE);
|
||||
bundle.putParcelable("genre_object", genreAdapter.getItem(position));
|
||||
activity.navController.navigate(R.id.action_libraryFragment_to_songListPageFragment, bundle);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import com.cappielloantonio.play.App;
|
|||
import com.cappielloantonio.play.databinding.InnerFragmentPlayerCoverBinding;
|
||||
import com.cappielloantonio.play.glide.CustomGlideRequest;
|
||||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.service.MediaManager;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
|
|
@ -121,7 +121,7 @@ public class PlayerCoverFragment extends Fragment {
|
|||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
MediaManager.enqueue(mediaBrowserListenableFuture, requireContext(), (List<Song>) media, true);
|
||||
MediaManager.enqueue(mediaBrowserListenableFuture, requireContext(), (List<Media>) media, true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
||||
import com.cappielloantonio.play.databinding.FragmentSongListPageBinding;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.service.MediaManager;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||
|
|
@ -80,50 +80,50 @@ public class SongListPageFragment extends Fragment {
|
|||
}
|
||||
|
||||
private void init() {
|
||||
if (requireArguments().getString(Song.RECENTLY_PLAYED) != null) {
|
||||
songListPageViewModel.title = Song.RECENTLY_PLAYED;
|
||||
if (requireArguments().getString(Media.RECENTLY_PLAYED) != null) {
|
||||
songListPageViewModel.title = Media.RECENTLY_PLAYED;
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_recently_played);
|
||||
bind.pageTitleLabel.setText(R.string.song_list_page_recently_played);
|
||||
} else if (requireArguments().getString(Song.MOST_PLAYED) != null) {
|
||||
songListPageViewModel.title = Song.MOST_PLAYED;
|
||||
} else if (requireArguments().getString(Media.MOST_PLAYED) != null) {
|
||||
songListPageViewModel.title = Media.MOST_PLAYED;
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_most_played);
|
||||
bind.pageTitleLabel.setText(R.string.song_list_page_most_played);
|
||||
} else if (requireArguments().getString(Song.RECENTLY_ADDED) != null) {
|
||||
songListPageViewModel.title = Song.RECENTLY_ADDED;
|
||||
} else if (requireArguments().getString(Media.RECENTLY_ADDED) != null) {
|
||||
songListPageViewModel.title = Media.RECENTLY_ADDED;
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_recently_added);
|
||||
bind.pageTitleLabel.setText(R.string.song_list_page_recently_added);
|
||||
} else if (requireArguments().getString(Song.BY_GENRE) != null) {
|
||||
songListPageViewModel.title = Song.BY_GENRE;
|
||||
} else if (requireArguments().getString(Media.BY_GENRE) != null) {
|
||||
songListPageViewModel.title = Media.BY_GENRE;
|
||||
songListPageViewModel.genre = requireArguments().getParcelable("genre_object");
|
||||
songListPageViewModel.toolbarTitle = MusicUtil.getReadableString(songListPageViewModel.genre.getName());
|
||||
bind.pageTitleLabel.setText(MusicUtil.getReadableString(songListPageViewModel.genre.getName()));
|
||||
} else if (requireArguments().getString(Song.BY_ARTIST) != null) {
|
||||
songListPageViewModel.title = Song.BY_ARTIST;
|
||||
} else if (requireArguments().getString(Media.BY_ARTIST) != null) {
|
||||
songListPageViewModel.title = Media.BY_ARTIST;
|
||||
songListPageViewModel.artist = requireArguments().getParcelable("artist_object");
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_top, MusicUtil.getReadableString(songListPageViewModel.artist.getName()));
|
||||
bind.pageTitleLabel.setText(getString(R.string.song_list_page_top, MusicUtil.getReadableString(songListPageViewModel.artist.getName())));
|
||||
} else if (requireArguments().getString(Song.BY_GENRES) != null) {
|
||||
songListPageViewModel.title = Song.BY_GENRES;
|
||||
} else if (requireArguments().getString(Media.BY_GENRES) != null) {
|
||||
songListPageViewModel.title = Media.BY_GENRES;
|
||||
songListPageViewModel.filters = requireArguments().getStringArrayList("filters_list");
|
||||
songListPageViewModel.filterNames = requireArguments().getStringArrayList("filter_name_list");
|
||||
songListPageViewModel.toolbarTitle = songListPageViewModel.getFiltersTitle();
|
||||
bind.pageTitleLabel.setText(songListPageViewModel.getFiltersTitle());
|
||||
} else if (requireArguments().getString(Song.BY_YEAR) != null) {
|
||||
songListPageViewModel.title = Song.BY_YEAR;
|
||||
} else if (requireArguments().getString(Media.BY_YEAR) != null) {
|
||||
songListPageViewModel.title = Media.BY_YEAR;
|
||||
songListPageViewModel.year = requireArguments().getInt("year_object");
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_year, songListPageViewModel.year);
|
||||
bind.pageTitleLabel.setText(getString(R.string.song_list_page_year, songListPageViewModel.year));
|
||||
} else if (requireArguments().getString(Song.STARRED) != null) {
|
||||
songListPageViewModel.title = Song.STARRED;
|
||||
} else if (requireArguments().getString(Media.STARRED) != null) {
|
||||
songListPageViewModel.title = Media.STARRED;
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_starred);
|
||||
bind.pageTitleLabel.setText(R.string.song_list_page_starred);
|
||||
} else if (requireArguments().getString(Song.DOWNLOADED) != null) {
|
||||
songListPageViewModel.title = Song.DOWNLOADED;
|
||||
} else if (requireArguments().getString(Media.DOWNLOADED) != null) {
|
||||
songListPageViewModel.title = Media.DOWNLOADED;
|
||||
songListPageViewModel.toolbarTitle = getString(R.string.song_list_page_downloaded);
|
||||
bind.pageTitleLabel.setText(getString(R.string.song_list_page_downloaded));
|
||||
} else if (requireArguments().getParcelable("album_object") != null) {
|
||||
songListPageViewModel.album = requireArguments().getParcelable("album_object");
|
||||
songListPageViewModel.title = Song.FROM_ALBUM;
|
||||
songListPageViewModel.title = Media.FROM_ALBUM;
|
||||
songListPageViewModel.toolbarTitle = MusicUtil.getReadableString(songListPageViewModel.album.getTitle());
|
||||
bind.pageTitleLabel.setText(MusicUtil.getReadableString(songListPageViewModel.album.getTitle()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.cappielloantonio.play.glide.CustomGlideRequest;
|
|||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Album;
|
||||
import com.cappielloantonio.play.model.Download;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.repository.AlbumRepository;
|
||||
import com.cappielloantonio.play.service.MediaManager;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
|
|
@ -113,7 +113,7 @@ public class AlbumBottomSheetDialog extends BottomSheetDialogFragment implements
|
|||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
if (media.size() > 0) {
|
||||
MediaManager.startQueue(mediaBrowserListenableFuture, requireContext(), (ArrayList<Song>) media, 0);
|
||||
MediaManager.startQueue(mediaBrowserListenableFuture, requireContext(), (ArrayList<Media>) media, 0);
|
||||
((MainActivity) requireActivity()).setBottomSheetInPeek(true);
|
||||
} else {
|
||||
Toast.makeText(requireContext(), getString(R.string.album_error_retrieving_radio), Toast.LENGTH_SHORT).show();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import com.cappielloantonio.play.R;
|
|||
import com.cappielloantonio.play.glide.CustomGlideRequest;
|
||||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Artist;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.repository.ArtistRepository;
|
||||
import com.cappielloantonio.play.service.MediaManager;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
|
|
@ -104,7 +104,7 @@ public class ArtistBottomSheetDialog extends BottomSheetDialogFragment implement
|
|||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
if (media.size() > 0) {
|
||||
MediaManager.startQueue(mediaBrowserListenableFuture, requireContext(), (ArrayList<Song>) media, 0);
|
||||
MediaManager.startQueue(mediaBrowserListenableFuture, requireContext(), (ArrayList<Media>) media, 0);
|
||||
((MainActivity) requireActivity()).setBottomSheetInPeek(true);
|
||||
} else {
|
||||
Toast.makeText(requireContext(), getString(R.string.artist_error_retrieving_radio), Toast.LENGTH_SHORT).show();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import com.cappielloantonio.play.App;
|
|||
import com.cappielloantonio.play.R;
|
||||
import com.cappielloantonio.play.glide.CustomGlideRequest;
|
||||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
||||
import com.cappielloantonio.play.model.Song;
|
||||
import com.cappielloantonio.play.model.Media;
|
||||
import com.cappielloantonio.play.repository.SongRepository;
|
||||
import com.cappielloantonio.play.service.MediaManager;
|
||||
import com.cappielloantonio.play.service.MediaService;
|
||||
|
|
@ -43,7 +43,7 @@ public class SongBottomSheetDialog extends BottomSheetDialogFragment implements
|
|||
private static final String TAG = "SongBottomSheetDialog";
|
||||
|
||||
private SongBottomSheetViewModel songBottomSheetViewModel;
|
||||
private Song song;
|
||||
private Media song;
|
||||
|
||||
private ListenableFuture<MediaBrowser> mediaBrowserListenableFuture;
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ public class SongBottomSheetDialog extends BottomSheetDialogFragment implements
|
|||
|
||||
@Override
|
||||
public void onLoadMedia(List<?> media) {
|
||||
MediaManager.enqueue(mediaBrowserListenableFuture, requireContext(), (List<Song>) media, true);
|
||||
MediaManager.enqueue(mediaBrowserListenableFuture, requireContext(), (List<Media>) media, true);
|
||||
dismissBottomSheet();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue