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