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) {
|
} else if (viewHolder.getItemViewType() == STATUS_ART) {
|
||||||
StatusViewHolder holder = (StatusViewHolder) viewHolder;
|
StatusViewHolder holder = (StatusViewHolder) viewHolder;
|
||||||
MastodonHelper.loadPPMastodon(holder.bindingArt.artPp, status.account);
|
MastodonHelper.loadPPMastodon(holder.bindingArt.artPp, status.account);
|
||||||
Glide.with(holder.bindingArt.artMedia.getContext())
|
if (status.art_attachment != null) {
|
||||||
.load(status.art_attachment.preview_url)
|
Glide.with(holder.bindingArt.artMedia.getContext())
|
||||||
.apply(new RequestOptions().transform(new RoundedCorners((int) Helper.convertDpToPixel(3, context))))
|
.load(status.art_attachment.preview_url)
|
||||||
.into(holder.bindingArt.artMedia);
|
.apply(new RequestOptions().transform(new RoundedCorners((int) Helper.convertDpToPixel(3, context))))
|
||||||
|
.into(holder.bindingArt.artMedia);
|
||||||
|
}
|
||||||
holder.bindingArt.artAcct.setText(
|
holder.bindingArt.artAcct.setText(
|
||||||
status.account.getSpanDisplayName(context,
|
status.account.getSpanDisplayName(context,
|
||||||
new WeakReference<>(holder.bindingArt.artAcct)),
|
new WeakReference<>(holder.bindingArt.artAcct)),
|
||||||
|
|
|
@ -142,6 +142,9 @@ public class FragmentMedia extends Fragment {
|
||||||
binding.mediaPicture.setVisibility(View.VISIBLE);
|
binding.mediaPicture.setVisibility(View.VISIBLE);
|
||||||
binding.pbarInf.setIndeterminate(true);
|
binding.pbarInf.setIndeterminate(true);
|
||||||
binding.loader.setVisibility(View.VISIBLE);
|
binding.loader.setVisibility(View.VISIBLE);
|
||||||
|
if (binding == null || !isAdded() || getActivity() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) {
|
if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) {
|
||||||
Glide.with(requireActivity())
|
Glide.with(requireActivity())
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
|
@ -250,6 +253,9 @@ public class FragmentMedia extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadVideo(String url, String type) {
|
private void loadVideo(String url, String type) {
|
||||||
|
if (binding == null || !isAdded() || getActivity() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
binding.pbarInf.setIndeterminate(false);
|
binding.pbarInf.setIndeterminate(false);
|
||||||
binding.pbarInf.setScaleY(3f);
|
binding.pbarInf.setScaleY(3f);
|
||||||
binding.mediaVideo.setVisibility(View.VISIBLE);
|
binding.mediaVideo.setVisibility(View.VISIBLE);
|
||||||
|
|
Loading…
Reference in a new issue