feat: Added video thumb placehoder for loading and errors

This commit is contained in:
Stefan Schueller 2021-02-13 21:09:41 +01:00
parent 06ace0d021
commit 830b19765e
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ package net.schueller.peertube.adapter;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -74,9 +75,10 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoViewHol
Picasso.get() Picasso.get()
.load(baseUrl + videoList.get(position).getPreviewPath()) .load(baseUrl + videoList.get(position).getPreviewPath())
.placeholder(R.drawable.test_image)
.error(R.drawable.test_image)
.into(holder.thumb); .into(holder.thumb);
Avatar avatar = videoList.get(position).getAccount().getAvatar(); Avatar avatar = videoList.get(position).getAccount().getAvatar();
if (avatar != null) { if (avatar != null) {
String avatarPath = avatar.getPath(); String avatarPath = avatar.getPath();

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB