Fix a bug with media not available

This commit is contained in:
Thomas 2023-02-07 16:01:05 +01:00
parent 34a8a4ee85
commit a3a3d9350e

View file

@ -132,6 +132,7 @@ public class FragmentMedia extends Fragment {
binding.pbarInf.setScaleY(1f); binding.pbarInf.setScaleY(1f);
binding.pbarInf.setIndeterminate(true); binding.pbarInf.setIndeterminate(true);
binding.loader.setVisibility(View.VISIBLE); binding.loader.setVisibility(View.VISIBLE);
scheduleStartPostponedTransition(binding.mediaPicture);
if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) { if (Helper.isValidContextForGlide(requireActivity()) && isAdded()) {
Glide.with(requireActivity()) Glide.with(requireActivity())
.asBitmap() .asBitmap()
@ -144,7 +145,7 @@ public class FragmentMedia extends Fragment {
return; return;
} }
binding.mediaPicture.setImageBitmap(resource); binding.mediaPicture.setImageBitmap(resource);
scheduleStartPostponedTransition(binding.mediaPicture);
if (attachment.type.equalsIgnoreCase("image") && !attachment.url.toLowerCase().endsWith(".gif")) { if (attachment.type.equalsIgnoreCase("image") && !attachment.url.toLowerCase().endsWith(".gif")) {
binding.mediaPicture.setVisibility(View.VISIBLE); binding.mediaPicture.setVisibility(View.VISIBLE);
final Handler handler = new Handler(); final Handler handler = new Handler();