Search page renewed

This commit is contained in:
CappielloAntonio 2021-04-20 11:53:51 +02:00
parent a4dc5f643d
commit a7fd7688ab
13 changed files with 358 additions and 174 deletions

View file

@ -17,6 +17,7 @@ import com.cappielloantonio.play.model.Album;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder> {
private static final String TAG = "AlbumAdapter";
@ -75,7 +76,16 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
public void onClick(View view) {
Bundle bundle = new Bundle();
bundle.putParcelable("album_object", albums.get(getBindingAdapterPosition()));
Navigation.findNavController(view).navigate(R.id.action_libraryFragment_to_albumPageFragment, bundle);
if (Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.searchFragment) {
Navigation.findNavController(view).navigate(R.id.action_searchFragment_to_albumPageFragment, bundle);
}
else if(Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.libraryFragment) {
Navigation.findNavController(view).navigate(R.id.action_libraryFragment_to_albumPageFragment, bundle);
}
else if(Objects.requireNonNull(Navigation.findNavController(view).getCurrentDestination()).getId() == R.id.albumCatalogueFragment) {
Navigation.findNavController(view).navigate(R.id.action_albumCatalogueFragment_to_albumPageFragment, bundle);
}
}
@Override