Add cover image and backdrop integration

This commit is contained in:
Antonio Cappiello 2020-11-26 16:05:58 +01:00
parent 6c26c6d889
commit a0f417fa94
50 changed files with 385 additions and 204 deletions

View file

@ -4,13 +4,14 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.cappielloantonio.play.R;
import com.cappielloantonio.play.glide.CustomGlideRequest;
import com.cappielloantonio.play.model.Artist;
import com.cappielloantonio.play.util.Util;
import java.util.List;
@ -38,6 +39,11 @@ public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder
Artist artist = artists.get(position);
holder.textArtistName.setText(artist.getName());
CustomGlideRequest.Builder
.from(context, artist.getPrimary(), artist.getPrimaryBlurHash(), CustomGlideRequest.PRIMARY)
.build()
.into(holder.cover);
}
@Override
@ -47,11 +53,13 @@ public class ArtistAdapter extends RecyclerView.Adapter<ArtistAdapter.ViewHolder
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView textArtistName;
ImageView cover;
ViewHolder(View itemView) {
super(itemView);
textArtistName = itemView.findViewById(R.id.artist_name_label);
cover = itemView.findViewById(R.id.artist_cover_image_view);
itemView.setOnClickListener(this);
}