Fixed image loading bug

This commit is contained in:
Pupil
2020-02-23 10:28:29 +09:00
parent a4336cd954
commit 994aa99797
4 changed files with 10 additions and 12 deletions

View File

@@ -119,8 +119,9 @@ class ReaderAdapter(private val context: Context,
holder.view.reader_index.text = (position+1).toString()
val images = Cache(context).getImage(galleryID, position)
val progress = DownloadWorker.getInstance(context).progress[galleryID]?.get(position)
if (images != null) {
if (progress?.isInfinite() == true && images != null) {
glide
.load(images)
.diskCacheStrategy(DiskCacheStrategy.NONE)
@@ -132,8 +133,6 @@ class ReaderAdapter(private val context: Context,
}
.into(holder.view.image)
} else {
val progress = DownloadWorker.getInstance(context).progress[galleryID]?.get(position)
if (progress?.isNaN() == true) {
if (Fabric.isInitialized())
Crashlytics.logException(DownloadWorker.getInstance(context).exception[galleryID]?.get(position))