mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Implementation of song/album/artist page list
This commit is contained in:
parent
051ba23b58
commit
b5eaa1e523
17 changed files with 550 additions and 40 deletions
|
|
@ -107,6 +107,8 @@ public class AlbumHorizontalAdapter extends RecyclerView.Adapter<AlbumHorizontal
|
||||||
|
|
||||||
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.homeFragment) {
|
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.homeFragment) {
|
||||||
Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_albumPageFragment, bundle);
|
Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_albumPageFragment, bundle);
|
||||||
|
} else if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.albumListPageFragment) {
|
||||||
|
Navigation.findNavController(view).navigate(R.id.action_albumListPageFragment_to_albumPageFragment, bundle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,8 @@ public class ArtistHorizontalAdapter extends RecyclerView.Adapter<ArtistHorizont
|
||||||
|
|
||||||
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.homeFragment) {
|
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.homeFragment) {
|
||||||
Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_artistPageFragment, bundle);
|
Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_artistPageFragment, bundle);
|
||||||
|
} else if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.artistListPageFragment) {
|
||||||
|
Navigation.findNavController(view).navigate(R.id.action_artistListPageFragment_to_artistPageFragment, bundle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||||
@Dao
|
@Dao
|
||||||
public interface DownloadDao {
|
public interface DownloadDao {
|
||||||
@Query("SELECT * FROM download")
|
@Query("SELECT * FROM download")
|
||||||
LiveData<List<Download>> getAll();
|
List<Download> getAll();
|
||||||
|
|
||||||
@Query("SELECT * FROM download LIMIT :size")
|
@Query("SELECT * FROM download LIMIT :size")
|
||||||
LiveData<List<Download>> getSample(int size);
|
LiveData<List<Download>> getSample(int size);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
||||||
public class Album implements Parcelable {
|
public class Album implements Parcelable {
|
||||||
private static final String TAG = "Album";
|
private static final String TAG = "Album";
|
||||||
|
|
||||||
|
public static final String RECENTLY_PLAYED = "RECENTLY_PLAYED";
|
||||||
|
public static final String MOST_PLAYED = "MOST_PLAYED";
|
||||||
|
public static final String RECENTLY_ADDED = "RECENTLY_ADDED";
|
||||||
|
public static final String STARRED = "STARRED";
|
||||||
|
|
||||||
public String id;
|
public String id;
|
||||||
public String title;
|
public String title;
|
||||||
public int year;
|
public int year;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ import java.util.List;
|
||||||
public class Artist implements Parcelable {
|
public class Artist implements Parcelable {
|
||||||
private static final String TAG = "Artist";
|
private static final String TAG = "Artist";
|
||||||
|
|
||||||
|
public static final String STARRED = "STARRED";
|
||||||
|
|
||||||
public List<Genre> genres;
|
public List<Genre> genres;
|
||||||
public List<Album> albums;
|
public List<Album> albums;
|
||||||
public List<Song> songs;
|
public List<Song> songs;
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,8 @@ public class Song implements Parcelable {
|
||||||
public static final String BY_GENRES = "BY_GENRES";
|
public static final String BY_GENRES = "BY_GENRES";
|
||||||
public static final String BY_ARTIST = "BY_ARTIST";
|
public static final String BY_ARTIST = "BY_ARTIST";
|
||||||
public static final String BY_YEAR = "BY_YEAR";
|
public static final String BY_YEAR = "BY_YEAR";
|
||||||
public static final String IS_FAVORITE = "IS_FAVORITE";
|
public static final String STARRED = "STARRED";
|
||||||
public static final String DOWNLOADED = "DOWNLOADED";
|
public static final String DOWNLOADED = "DOWNLOADED";
|
||||||
public static final String RADIO = "RADIO";
|
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String title;
|
private String title;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.cappielloantonio.play.repository;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import com.cappielloantonio.play.database.AppDatabase;
|
import com.cappielloantonio.play.database.AppDatabase;
|
||||||
import com.cappielloantonio.play.database.dao.DownloadDao;
|
import com.cappielloantonio.play.database.dao.DownloadDao;
|
||||||
|
|
@ -20,7 +21,7 @@ public class DownloadRepository {
|
||||||
private static final String TAG = "QueueRepository";
|
private static final String TAG = "QueueRepository";
|
||||||
|
|
||||||
private DownloadDao downloadDao;
|
private DownloadDao downloadDao;
|
||||||
private LiveData<List<Download>> listLiveDownload;
|
private MutableLiveData<List<Download>> listLiveDownload = new MutableLiveData<>(new ArrayList<>());
|
||||||
private LiveData<List<Download>> listLiveDownloadSample;
|
private LiveData<List<Download>> listLiveDownloadSample;
|
||||||
|
|
||||||
public DownloadRepository(Application application) {
|
public DownloadRepository(Application application) {
|
||||||
|
|
@ -28,9 +29,39 @@ public class DownloadRepository {
|
||||||
downloadDao = database.downloadDao();
|
downloadDao = database.downloadDao();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<List<Download>> getLiveDownload() {
|
public List<Download> getLiveDownload() {
|
||||||
listLiveDownload = downloadDao.getAll();
|
List<Download> downloads = new ArrayList<>();
|
||||||
return listLiveDownload;
|
|
||||||
|
GetDownloadThreadSafe getDownloads = new GetDownloadThreadSafe(downloadDao);
|
||||||
|
Thread thread = new Thread(getDownloads);
|
||||||
|
thread.start();
|
||||||
|
|
||||||
|
try {
|
||||||
|
thread.join();
|
||||||
|
downloads = getDownloads.getDownloads();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return downloads;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class GetDownloadThreadSafe implements Runnable {
|
||||||
|
private DownloadDao downloadDao;
|
||||||
|
private List<Download> downloads;
|
||||||
|
|
||||||
|
public GetDownloadThreadSafe(DownloadDao downloadDao) {
|
||||||
|
this.downloadDao = downloadDao;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
downloads = downloadDao.getAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Download> getDownloads() {
|
||||||
|
return downloads;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<List<Download>> getLiveDownloadSample(int size) {
|
public LiveData<List<Download>> getLiveDownloadSample(int size) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
package com.cappielloantonio.play.ui.fragment;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.cappielloantonio.play.App;
|
||||||
|
import com.cappielloantonio.play.adapter.AlbumHorizontalAdapter;
|
||||||
|
import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
||||||
|
import com.cappielloantonio.play.databinding.FragmentAlbumListPageBinding;
|
||||||
|
import com.cappielloantonio.play.databinding.FragmentSongListPageBinding;
|
||||||
|
import com.cappielloantonio.play.model.Album;
|
||||||
|
import com.cappielloantonio.play.model.Song;
|
||||||
|
import com.cappielloantonio.play.repository.QueueRepository;
|
||||||
|
import com.cappielloantonio.play.service.MusicPlayerRemote;
|
||||||
|
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||||
|
import com.cappielloantonio.play.viewmodel.AlbumListPageViewModel;
|
||||||
|
import com.cappielloantonio.play.viewmodel.SongListPageViewModel;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
public class AlbumListPageFragment extends Fragment {
|
||||||
|
private FragmentAlbumListPageBinding bind;
|
||||||
|
|
||||||
|
private MainActivity activity;
|
||||||
|
private AlbumListPageViewModel albumListPageViewModel;
|
||||||
|
|
||||||
|
private AlbumHorizontalAdapter albumHorizontalAdapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
activity = (MainActivity) getActivity();
|
||||||
|
|
||||||
|
bind = FragmentAlbumListPageBinding.inflate(inflater, container, false);
|
||||||
|
View view = bind.getRoot();
|
||||||
|
albumListPageViewModel = new ViewModelProvider(requireActivity()).get(AlbumListPageViewModel.class);
|
||||||
|
|
||||||
|
init();
|
||||||
|
initAppBar();
|
||||||
|
initAlbumListView();
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
activity.setBottomNavigationBarVisibility(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
bind = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
if(getArguments().getString(Album.RECENTLY_PLAYED) != null) {
|
||||||
|
albumListPageViewModel.title = Album.RECENTLY_PLAYED;
|
||||||
|
bind.pageTitleLabel.setText("Recently played albums");
|
||||||
|
}
|
||||||
|
else if(getArguments().getString(Album.MOST_PLAYED) != null) {
|
||||||
|
albumListPageViewModel.title = Album.MOST_PLAYED;
|
||||||
|
bind.pageTitleLabel.setText("Most played albums");
|
||||||
|
}
|
||||||
|
else if(getArguments().getString(Album.RECENTLY_ADDED) != null) {
|
||||||
|
albumListPageViewModel.title = Album.RECENTLY_ADDED;
|
||||||
|
bind.pageTitleLabel.setText("Recently added albums");
|
||||||
|
}
|
||||||
|
else if(getArguments().getString(Album.STARRED) != null) {
|
||||||
|
albumListPageViewModel.title = Album.STARRED;
|
||||||
|
bind.pageTitleLabel.setText("Starred albums");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initAppBar() {
|
||||||
|
activity.setSupportActionBar(bind.toolbar);
|
||||||
|
|
||||||
|
if (activity.getSupportActionBar() != null) {
|
||||||
|
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
activity.getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bind.toolbar.setNavigationOnClickListener(v -> {
|
||||||
|
activity.navController.navigateUp();
|
||||||
|
});
|
||||||
|
|
||||||
|
bind.appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
|
||||||
|
if ((bind.albumInfoSector.getHeight() + verticalOffset) < (2 * ViewCompat.getMinimumHeight(bind.toolbar))) {
|
||||||
|
bind.toolbar.setTitle("Albums");
|
||||||
|
} else {
|
||||||
|
bind.toolbar.setTitle("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initAlbumListView() {
|
||||||
|
bind.albumListRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||||
|
bind.albumListRecyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
albumHorizontalAdapter = new AlbumHorizontalAdapter(activity, requireContext(), getChildFragmentManager());
|
||||||
|
bind.albumListRecyclerView.setAdapter(albumHorizontalAdapter);
|
||||||
|
albumListPageViewModel.getAlbumList(requireActivity()).observe(requireActivity(), albums -> albumHorizontalAdapter.setItems(albums));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.cappielloantonio.play.ui.fragment;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.cappielloantonio.play.adapter.AlbumHorizontalAdapter;
|
||||||
|
import com.cappielloantonio.play.adapter.ArtistHorizontalAdapter;
|
||||||
|
import com.cappielloantonio.play.databinding.FragmentAlbumListPageBinding;
|
||||||
|
import com.cappielloantonio.play.databinding.FragmentArtistListPageBinding;
|
||||||
|
import com.cappielloantonio.play.model.Album;
|
||||||
|
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||||
|
import com.cappielloantonio.play.viewmodel.AlbumListPageViewModel;
|
||||||
|
import com.cappielloantonio.play.viewmodel.ArtistListPageViewModel;
|
||||||
|
|
||||||
|
public class ArtistListPageFragment extends Fragment {
|
||||||
|
private FragmentArtistListPageBinding bind;
|
||||||
|
|
||||||
|
private MainActivity activity;
|
||||||
|
private ArtistListPageViewModel artistListPageViewModel;
|
||||||
|
|
||||||
|
private ArtistHorizontalAdapter artistHorizontalAdapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
activity = (MainActivity) getActivity();
|
||||||
|
|
||||||
|
bind = FragmentArtistListPageBinding.inflate(inflater, container, false);
|
||||||
|
View view = bind.getRoot();
|
||||||
|
artistListPageViewModel = new ViewModelProvider(requireActivity()).get(ArtistListPageViewModel.class);
|
||||||
|
|
||||||
|
init();
|
||||||
|
initAppBar();
|
||||||
|
initArtistListView();
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
activity.setBottomNavigationBarVisibility(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
bind = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
if(getArguments().getString(Album.STARRED) != null) {
|
||||||
|
artistListPageViewModel.title = Album.STARRED;
|
||||||
|
bind.pageTitleLabel.setText("Starred artists");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initAppBar() {
|
||||||
|
activity.setSupportActionBar(bind.toolbar);
|
||||||
|
|
||||||
|
if (activity.getSupportActionBar() != null) {
|
||||||
|
activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
activity.getSupportActionBar().setDisplayShowHomeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bind.toolbar.setNavigationOnClickListener(v -> {
|
||||||
|
activity.navController.navigateUp();
|
||||||
|
});
|
||||||
|
|
||||||
|
bind.appBarLayout.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> {
|
||||||
|
if ((bind.artistInfoSector.getHeight() + verticalOffset) < (2 * ViewCompat.getMinimumHeight(bind.toolbar))) {
|
||||||
|
bind.toolbar.setTitle("Artists");
|
||||||
|
} else {
|
||||||
|
bind.toolbar.setTitle("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initArtistListView() {
|
||||||
|
bind.artistListRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||||
|
bind.artistListRecyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
artistHorizontalAdapter = new ArtistHorizontalAdapter(activity, requireContext(), getChildFragmentManager());
|
||||||
|
bind.artistListRecyclerView.setAdapter(artistHorizontalAdapter);
|
||||||
|
artistListPageViewModel.getArtistList().observe(requireActivity(), artists -> artistHorizontalAdapter.setItems(artists));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,6 @@ import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
@ -25,15 +24,14 @@ import com.cappielloantonio.play.adapter.RecentMusicAdapter;
|
||||||
import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
import com.cappielloantonio.play.adapter.SongHorizontalAdapter;
|
||||||
import com.cappielloantonio.play.adapter.YearAdapter;
|
import com.cappielloantonio.play.adapter.YearAdapter;
|
||||||
import com.cappielloantonio.play.databinding.FragmentHomeBinding;
|
import com.cappielloantonio.play.databinding.FragmentHomeBinding;
|
||||||
import com.cappielloantonio.play.interfaces.MediaCallback;
|
import com.cappielloantonio.play.model.Album;
|
||||||
|
import com.cappielloantonio.play.model.Artist;
|
||||||
import com.cappielloantonio.play.model.Song;
|
import com.cappielloantonio.play.model.Song;
|
||||||
import com.cappielloantonio.play.ui.activity.MainActivity;
|
import com.cappielloantonio.play.ui.activity.MainActivity;
|
||||||
import com.cappielloantonio.play.util.MappingUtil;
|
import com.cappielloantonio.play.util.MappingUtil;
|
||||||
import com.cappielloantonio.play.util.UIUtil;
|
import com.cappielloantonio.play.util.UIUtil;
|
||||||
import com.cappielloantonio.play.viewmodel.HomeViewModel;
|
import com.cappielloantonio.play.viewmodel.HomeViewModel;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment {
|
||||||
private static final String TAG = "CategoriesFragment";
|
private static final String TAG = "CategoriesFragment";
|
||||||
|
|
||||||
|
|
@ -98,38 +96,38 @@ public class HomeFragment extends Fragment {
|
||||||
private void init() {
|
private void init() {
|
||||||
bind.recentlyAddedAlbumsTextViewClickable.setOnClickListener(v -> {
|
bind.recentlyAddedAlbumsTextViewClickable.setOnClickListener(v -> {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(Song.RECENTLY_ADDED, Song.RECENTLY_ADDED);
|
bundle.putString(Album.RECENTLY_ADDED, Album.RECENTLY_ADDED);
|
||||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
activity.navController.navigate(R.id.action_homeFragment_to_albumListPageFragment, bundle);
|
||||||
});
|
});
|
||||||
|
|
||||||
bind.recentlyPlayedAlbumsTextViewClickable.setOnClickListener(v -> {
|
bind.recentlyPlayedAlbumsTextViewClickable.setOnClickListener(v -> {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(Song.RECENTLY_PLAYED, Song.RECENTLY_PLAYED);
|
bundle.putString(Album.RECENTLY_PLAYED, Album.RECENTLY_PLAYED);
|
||||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
activity.navController.navigate(R.id.action_homeFragment_to_albumListPageFragment, bundle);
|
||||||
});
|
});
|
||||||
|
|
||||||
bind.mostPlayedAlbumsTextViewClickable.setOnClickListener(v -> {
|
bind.mostPlayedAlbumsTextViewClickable.setOnClickListener(v -> {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(Song.MOST_PLAYED, Song.MOST_PLAYED);
|
bundle.putString(Album.MOST_PLAYED, Album.MOST_PLAYED);
|
||||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
activity.navController.navigate(R.id.action_homeFragment_to_albumListPageFragment, bundle);
|
||||||
});
|
});
|
||||||
|
|
||||||
bind.starredTracksTextViewClickable.setOnClickListener(v -> {
|
bind.starredTracksTextViewClickable.setOnClickListener(v -> {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(Song.IS_FAVORITE, Song.IS_FAVORITE);
|
bundle.putString(Song.STARRED, Song.STARRED);
|
||||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
||||||
});
|
});
|
||||||
|
|
||||||
bind.starredAlbumsTextViewClickable.setOnClickListener(v -> {
|
bind.starredAlbumsTextViewClickable.setOnClickListener(v -> {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(Song.IS_FAVORITE, Song.IS_FAVORITE);
|
bundle.putString(Album.STARRED, Album.STARRED);
|
||||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
activity.navController.navigate(R.id.action_homeFragment_to_albumListPageFragment, bundle);
|
||||||
});
|
});
|
||||||
|
|
||||||
bind.starredArtistsTextViewClickable.setOnClickListener(v -> {
|
bind.starredArtistsTextViewClickable.setOnClickListener(v -> {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString(Song.IS_FAVORITE, Song.IS_FAVORITE);
|
bundle.putString(Artist.STARRED, Artist.STARRED);
|
||||||
activity.navController.navigate(R.id.action_homeFragment_to_songListPageFragment, bundle);
|
activity.navController.navigate(R.id.action_homeFragment_to_artistListPageFragment, bundle);
|
||||||
});
|
});
|
||||||
|
|
||||||
bind.downloadedTracksTextViewClickable.setOnClickListener(v -> {
|
bind.downloadedTracksTextViewClickable.setOnClickListener(v -> {
|
||||||
|
|
@ -180,6 +178,8 @@ public class HomeFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initYearSongView() {
|
private void initYearSongView() {
|
||||||
|
if(bind != null) bind.homeFlashbackSector.setVisibility(!homeViewModel.getYearList().isEmpty() ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
bind.yearsRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false));
|
bind.yearsRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||||
bind.yearsRecyclerView.setHasFixedSize(true);
|
bind.yearsRecyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,25 +60,25 @@ public class SongListPageFragment extends Fragment {
|
||||||
private void init() {
|
private void init() {
|
||||||
if(getArguments().getString(Song.RECENTLY_PLAYED) != null) {
|
if(getArguments().getString(Song.RECENTLY_PLAYED) != null) {
|
||||||
songListPageViewModel.title = Song.RECENTLY_PLAYED;
|
songListPageViewModel.title = Song.RECENTLY_PLAYED;
|
||||||
bind.pageTitleLabel.setText("Recently played songs");
|
bind.pageTitleLabel.setText("Recently played tracks");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.MOST_PLAYED) != null) {
|
else if(getArguments().getString(Song.MOST_PLAYED) != null) {
|
||||||
songListPageViewModel.title = Song.MOST_PLAYED;
|
songListPageViewModel.title = Song.MOST_PLAYED;
|
||||||
bind.pageTitleLabel.setText("Most played songs");
|
bind.pageTitleLabel.setText("Most played tracks");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.RECENTLY_ADDED) != null) {
|
else if(getArguments().getString(Song.RECENTLY_ADDED) != null) {
|
||||||
songListPageViewModel.title = Song.RECENTLY_ADDED;
|
songListPageViewModel.title = Song.RECENTLY_ADDED;
|
||||||
bind.pageTitleLabel.setText("Recently added song");
|
bind.pageTitleLabel.setText("Recently added tracks");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.BY_GENRE) != null) {
|
else if(getArguments().getString(Song.BY_GENRE) != null) {
|
||||||
songListPageViewModel.title = Song.BY_GENRE;
|
songListPageViewModel.title = Song.BY_GENRE;
|
||||||
songListPageViewModel.genre = getArguments().getParcelable("genre_object");
|
songListPageViewModel.genre = getArguments().getParcelable("genre_object");
|
||||||
bind.pageTitleLabel.setText(songListPageViewModel.genre.getName() + ": all songs");
|
bind.pageTitleLabel.setText(songListPageViewModel.genre.getName() + ": all tracks");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.BY_ARTIST) != null) {
|
else if(getArguments().getString(Song.BY_ARTIST) != null) {
|
||||||
songListPageViewModel.title = Song.BY_ARTIST;
|
songListPageViewModel.title = Song.BY_ARTIST;
|
||||||
songListPageViewModel.artist = getArguments().getParcelable("artist_object");
|
songListPageViewModel.artist = getArguments().getParcelable("artist_object");
|
||||||
bind.pageTitleLabel.setText(songListPageViewModel.artist.getName() + "'s top songs");
|
bind.pageTitleLabel.setText(songListPageViewModel.artist.getName() + "'s top tracks");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.BY_GENRES) != null) {
|
else if(getArguments().getString(Song.BY_GENRES) != null) {
|
||||||
songListPageViewModel.title = Song.BY_GENRES;
|
songListPageViewModel.title = Song.BY_GENRES;
|
||||||
|
|
@ -91,19 +91,14 @@ public class SongListPageFragment extends Fragment {
|
||||||
songListPageViewModel.year = getArguments().getInt("year_object");
|
songListPageViewModel.year = getArguments().getInt("year_object");
|
||||||
bind.pageTitleLabel.setText("Year " + songListPageViewModel.year);
|
bind.pageTitleLabel.setText("Year " + songListPageViewModel.year);
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.IS_FAVORITE) != null) {
|
else if(getArguments().getString(Song.STARRED) != null) {
|
||||||
songListPageViewModel.title = Song.IS_FAVORITE;
|
songListPageViewModel.title = Song.STARRED;
|
||||||
bind.pageTitleLabel.setText("Favourite song");
|
bind.pageTitleLabel.setText("Starred tracks");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.DOWNLOADED) != null) {
|
else if(getArguments().getString(Song.DOWNLOADED) != null) {
|
||||||
songListPageViewModel.title = Song.DOWNLOADED;
|
songListPageViewModel.title = Song.DOWNLOADED;
|
||||||
bind.pageTitleLabel.setText("Downloaded");
|
bind.pageTitleLabel.setText("Downloaded");
|
||||||
}
|
}
|
||||||
else if(getArguments().getString(Song.RADIO) != null) {
|
|
||||||
songListPageViewModel.title = Song.IS_FAVORITE;
|
|
||||||
songListPageViewModel.year = getArguments().getInt("radio_object");
|
|
||||||
bind.pageTitleLabel.setText("Radio");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initAppBar() {
|
private void initAppBar() {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.cappielloantonio.play.viewmodel;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.lifecycle.AndroidViewModel;
|
||||||
|
import androidx.lifecycle.LiveData;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.cappielloantonio.play.model.Album;
|
||||||
|
import com.cappielloantonio.play.model.Artist;
|
||||||
|
import com.cappielloantonio.play.model.Genre;
|
||||||
|
import com.cappielloantonio.play.model.Song;
|
||||||
|
import com.cappielloantonio.play.repository.AlbumRepository;
|
||||||
|
import com.cappielloantonio.play.repository.DownloadRepository;
|
||||||
|
import com.cappielloantonio.play.repository.SongRepository;
|
||||||
|
import com.cappielloantonio.play.util.MappingUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AlbumListPageViewModel extends AndroidViewModel {
|
||||||
|
private AlbumRepository albumRepository;
|
||||||
|
|
||||||
|
public String title;
|
||||||
|
|
||||||
|
private MutableLiveData<List<Album>> albumList;
|
||||||
|
|
||||||
|
public AlbumListPageViewModel(@NonNull Application application) {
|
||||||
|
super(application);
|
||||||
|
|
||||||
|
albumRepository = new AlbumRepository(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveData<List<Album>> getAlbumList(FragmentActivity activity) {
|
||||||
|
albumList = new MutableLiveData<>(new ArrayList<>());
|
||||||
|
|
||||||
|
switch (title) {
|
||||||
|
case Song.RECENTLY_PLAYED:
|
||||||
|
albumRepository.getAlbums("recent", 500).observe(activity, albums -> {
|
||||||
|
albumList.setValue(albums);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case Song.MOST_PLAYED:
|
||||||
|
albumRepository.getAlbums("frequent", 500).observe(activity, albums -> {
|
||||||
|
albumList.setValue(albums);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case Song.RECENTLY_ADDED:
|
||||||
|
albumRepository.getAlbums("newest", 500).observe(activity, albums -> {
|
||||||
|
albumList.setValue(albums);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case Song.STARRED:
|
||||||
|
albumList = albumRepository.getStarredAlbums();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return albumList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.cappielloantonio.play.viewmodel;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.lifecycle.AndroidViewModel;
|
||||||
|
import androidx.lifecycle.LiveData;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.cappielloantonio.play.model.Album;
|
||||||
|
import com.cappielloantonio.play.model.Artist;
|
||||||
|
import com.cappielloantonio.play.model.Song;
|
||||||
|
import com.cappielloantonio.play.repository.AlbumRepository;
|
||||||
|
import com.cappielloantonio.play.repository.ArtistRepository;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ArtistListPageViewModel extends AndroidViewModel {
|
||||||
|
private ArtistRepository artistRepository;
|
||||||
|
|
||||||
|
public String title;
|
||||||
|
|
||||||
|
private MutableLiveData<List<Artist>> artistList;
|
||||||
|
|
||||||
|
public ArtistListPageViewModel(@NonNull Application application) {
|
||||||
|
super(application);
|
||||||
|
|
||||||
|
artistRepository = new ArtistRepository(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveData<List<Artist>> getArtistList() {
|
||||||
|
artistList = new MutableLiveData<>(new ArrayList<>());
|
||||||
|
|
||||||
|
switch (title) {
|
||||||
|
case Song.STARRED:
|
||||||
|
artistList = artistRepository.getStarredArtists();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return artistList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,37 +1,52 @@
|
||||||
package com.cappielloantonio.play.viewmodel;
|
package com.cappielloantonio.play.viewmodel;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.lifecycle.AndroidViewModel;
|
import androidx.lifecycle.AndroidViewModel;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.cappielloantonio.play.App;
|
||||||
import com.cappielloantonio.play.model.Artist;
|
import com.cappielloantonio.play.model.Artist;
|
||||||
|
import com.cappielloantonio.play.model.Download;
|
||||||
import com.cappielloantonio.play.model.Genre;
|
import com.cappielloantonio.play.model.Genre;
|
||||||
import com.cappielloantonio.play.model.Song;
|
import com.cappielloantonio.play.model.Song;
|
||||||
|
import com.cappielloantonio.play.repository.DownloadRepository;
|
||||||
import com.cappielloantonio.play.repository.SongRepository;
|
import com.cappielloantonio.play.repository.SongRepository;
|
||||||
|
import com.cappielloantonio.play.util.MappingUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SongListPageViewModel extends AndroidViewModel {
|
public class SongListPageViewModel extends AndroidViewModel {
|
||||||
|
private SongRepository songRepository;
|
||||||
|
private DownloadRepository downloadRepository;
|
||||||
|
|
||||||
public String title;
|
public String title;
|
||||||
public Genre genre;
|
public Genre genre;
|
||||||
public Artist artist;
|
public Artist artist;
|
||||||
|
|
||||||
public ArrayList<String> filters = new ArrayList<>();
|
public ArrayList<String> filters = new ArrayList<>();
|
||||||
public ArrayList<String> filterNames = new ArrayList<>();
|
public ArrayList<String> filterNames = new ArrayList<>();
|
||||||
|
|
||||||
public int year = 0;
|
public int year = 0;
|
||||||
private SongRepository songRepository;
|
|
||||||
private LiveData<List<Song>> songList;
|
private MutableLiveData<List<Song>> songList;
|
||||||
|
|
||||||
public SongListPageViewModel(@NonNull Application application) {
|
public SongListPageViewModel(@NonNull Application application) {
|
||||||
super(application);
|
super(application);
|
||||||
|
|
||||||
songRepository = new SongRepository(application);
|
songRepository = new SongRepository(application);
|
||||||
|
downloadRepository = new DownloadRepository(application);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<List<Song>> getSongList() {
|
public LiveData<List<Song>> getSongList() {
|
||||||
|
songList = new MutableLiveData<>(new ArrayList<>());
|
||||||
|
|
||||||
switch (title) {
|
switch (title) {
|
||||||
case Song.RECENTLY_PLAYED:
|
case Song.RECENTLY_PLAYED:
|
||||||
// songList = songRepository.getListLiveRecentlyPlayedSampleSong(100);
|
// songList = songRepository.getListLiveRecentlyPlayedSampleSong(100);
|
||||||
|
|
@ -54,11 +69,11 @@ public class SongListPageViewModel extends AndroidViewModel {
|
||||||
case Song.BY_YEAR:
|
case Song.BY_YEAR:
|
||||||
// songList = songRepository.getSongByYearListLive(year);
|
// songList = songRepository.getSongByYearListLive(year);
|
||||||
break;
|
break;
|
||||||
case Song.IS_FAVORITE:
|
case Song.STARRED:
|
||||||
// songList = songRepository.getListLiveFavoritesSong();
|
songList = songRepository.getStarredSongs();
|
||||||
break;
|
break;
|
||||||
case Song.DOWNLOADED:
|
case Song.DOWNLOADED:
|
||||||
// songList = songRepository.getListLiveDownloadedSong();
|
songList.setValue(MappingUtil.mapDownload(downloadRepository.getLiveDownload()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
62
app/src/main/res/layout/fragment_album_list_page.xml
Normal file
62
app/src/main/res/layout/fragment_album_list_page.xml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:theme="@style/SearchViewStyle"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:navigationIcon="@drawable/ic_arrow_back" />
|
||||||
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/album_info_sector"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="172dp"
|
||||||
|
android:clipChildren="false"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/page_title_label"
|
||||||
|
style="@style/HeadlineTextView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:text="@string/label_placeholder"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/album_list_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="@dimen/global_padding_bottom"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
62
app/src/main/res/layout/fragment_artist_list_page.xml
Normal file
62
app/src/main/res/layout/fragment_artist_list_page.xml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:theme="@style/SearchViewStyle"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:navigationIcon="@drawable/ic_arrow_back" />
|
||||||
|
|
||||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/app_bar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/artist_info_sector"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="172dp"
|
||||||
|
android:clipChildren="false"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/page_title_label"
|
||||||
|
style="@style/HeadlineTextView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:text="@string/label_placeholder"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/artist_list_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="@dimen/global_padding_bottom"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -42,6 +42,12 @@
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_homeFragment_to_songListPageFragment"
|
android:id="@+id/action_homeFragment_to_songListPageFragment"
|
||||||
app:destination="@id/songListPageFragment" />
|
app:destination="@id/songListPageFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_homeFragment_to_albumListPageFragment"
|
||||||
|
app:destination="@id/albumListPageFragment" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_homeFragment_to_artistListPageFragment"
|
||||||
|
app:destination="@id/artistListPageFragment" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_homeFragment_to_settingsFragment"
|
android:id="@+id/action_homeFragment_to_settingsFragment"
|
||||||
app:destination="@id/settingsFragment" />
|
app:destination="@id/settingsFragment" />
|
||||||
|
|
@ -181,6 +187,24 @@
|
||||||
android:name="com.cappielloantonio.play.ui.fragment.SongListPageFragment"
|
android:name="com.cappielloantonio.play.ui.fragment.SongListPageFragment"
|
||||||
android:label="SongListPageFragment"
|
android:label="SongListPageFragment"
|
||||||
tools:layout="@layout/fragment_song_list_page" />
|
tools:layout="@layout/fragment_song_list_page" />
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/albumListPageFragment"
|
||||||
|
android:name="com.cappielloantonio.play.ui.fragment.AlbumListPageFragment"
|
||||||
|
android:label="AlbumListPageFragment"
|
||||||
|
tools:layout="@layout/fragment_album_list_page">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_albumListPageFragment_to_albumPageFragment"
|
||||||
|
app:destination="@id/albumPageFragment" />
|
||||||
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/artistListPageFragment"
|
||||||
|
android:name="com.cappielloantonio.play.ui.fragment.ArtistListPageFragment"
|
||||||
|
android:label="ArtistListPageFragment"
|
||||||
|
tools:layout="@layout/fragment_artist_list_page">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_artistListPageFragment_to_artistPageFragment"
|
||||||
|
app:destination="@id/artistPageFragment" />
|
||||||
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/playlistPageFragment"
|
android:id="@+id/playlistPageFragment"
|
||||||
android:name="com.cappielloantonio.play.ui.fragment.PlaylistPageFragment"
|
android:name="com.cappielloantonio.play.ui.fragment.PlaylistPageFragment"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue