mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Fix showing local image if fetching thumbnail fails.
This commit is contained in:
parent
96f9526244
commit
5fc684fcc5
1 changed files with 4 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package fr.free.nrw.commons;
|
|||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
|
|
@ -61,6 +62,9 @@ public class MediaWikiImageView extends SimpleDraweeView {
|
|||
if (isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(result) && media.getLocalUri() != null) {
|
||||
result = media.getLocalUri().toString();
|
||||
}
|
||||
CommonsApplication.getInstance().getThumbnailUrlCache().put(media.getFilename(), result);
|
||||
setImageUrl(result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue