forked from mirrors/Fedilab
Fix issue #272
This commit is contained in:
parent
1dc3d43669
commit
b6678bb645
2 changed files with 12 additions and 4 deletions
|
@ -1985,10 +1985,12 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
} else if (viewHolder.getItemViewType() == STATUS_ART) {
|
||||
StatusViewHolder holder = (StatusViewHolder) viewHolder;
|
||||
MastodonHelper.loadPPMastodon(holder.bindingArt.artPp, status.account);
|
||||
Glide.with(holder.bindingArt.artMedia.getContext())
|
||||
.load(status.art_attachment.preview_url)
|
||||
.apply(new RequestOptions().transform(new RoundedCorners((int) Helper.convertDpToPixel(3, context))))
|
||||
.into(holder.bindingArt.artMedia);
|
||||
if (status.art_attachment != null) {
|
||||
Glide.with(holder.bindingArt.artMedia.getContext())
|
||||
.load(status.art_attachment.preview_url)
|
||||
.apply(new RequestOptions().transform(new RoundedCorners((int) Helper.convertDpToPixel(3, context))))
|
||||
.into(holder.bindingArt.artMedia);
|
||||
}
|
||||
holder.bindingArt.artAcct.setText(
|
||||
status.account.getSpanDisplayName(context,
|
||||
new WeakReference<>(holder.bindingArt.artAcct)),
|
||||
|
|
|
@ -142,6 +142,9 @@ public class FragmentMedia extends Fragment {
|
|||
binding.mediaPicture.setVisibility(View.VISIBLE);
|
||||
binding.pbarInf.setIndeterminate(true);
|
||||
binding.loader.setVisibility(View.VISIBLE);
|
||||
if (binding == null || !isAdded() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) {
|
||||
Glide.with(requireActivity())
|
||||
.asBitmap()
|
||||
|
@ -250,6 +253,9 @@ public class FragmentMedia extends Fragment {
|
|||
}
|
||||
|
||||
private void loadVideo(String url, String type) {
|
||||
if (binding == null || !isAdded() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
binding.pbarInf.setIndeterminate(false);
|
||||
binding.pbarInf.setScaleY(3f);
|
||||
binding.mediaVideo.setVisibility(View.VISIBLE);
|
||||
|
|
Loading…
Reference in a new issue