mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 18:31:40 +00:00
AlbumPageFragment now correctly retrieves information locally or from the server
This commit is contained in:
parent
eeae6bbce5
commit
589c3289d4
10 changed files with 37 additions and 12 deletions
|
|
@ -93,6 +93,7 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
|||
public void onClick(View view) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("album_object", albums.get(getBindingAdapterPosition()));
|
||||
bundle.putBoolean("is_offline", false);
|
||||
|
||||
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.searchFragment) {
|
||||
Navigation.findNavController(view).navigate(R.id.action_searchFragment_to_albumPageFragment, bundle);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ public class AlbumArtistPageOrSimilarAdapter extends RecyclerView.Adapter<AlbumA
|
|||
public void onClick(View view) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("album_object", albums.get(getBindingAdapterPosition()));
|
||||
bundle.putBoolean("is_offline", false);
|
||||
Navigation.findNavController(view).navigate(R.id.albumPageFragment, bundle);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ public class AlbumCatalogueAdapter extends RecyclerView.Adapter<AlbumCatalogueAd
|
|||
public void onClick(View view) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("album_object", albums.get(getBindingAdapterPosition()));
|
||||
bundle.putBoolean("is_offline", false);
|
||||
|
||||
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.searchFragment) {
|
||||
Navigation.findNavController(view).navigate(R.id.action_searchFragment_to_albumPageFragment, bundle);
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@ public class AlbumHorizontalAdapter extends RecyclerView.Adapter<AlbumHorizontal
|
|||
private List<Album> albums;
|
||||
private final LayoutInflater mInflater;
|
||||
private final Context context;
|
||||
private final boolean isOffline;
|
||||
|
||||
public AlbumHorizontalAdapter(Context context) {
|
||||
public AlbumHorizontalAdapter(Context context, boolean isOffline) {
|
||||
this.context = context;
|
||||
this.mInflater = LayoutInflater.from(context);
|
||||
this.albums = new ArrayList<>();
|
||||
this.isOffline = isOffline;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
@ -96,6 +98,7 @@ public class AlbumHorizontalAdapter extends RecyclerView.Adapter<AlbumHorizontal
|
|||
public void onClick(View view) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("album_object", albums.get(getBindingAdapterPosition()));
|
||||
bundle.putBoolean("is_offline", isOffline);
|
||||
|
||||
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.homeFragment) {
|
||||
Navigation.findNavController(view).navigate(R.id.action_homeFragment_to_albumPageFragment, bundle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue