From 152a56c32b9c26a7cbe472c92dd2513cc79ee7da Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 3 Apr 2017 18:29:30 +0200 Subject: [PATCH] do not attempt loading thumbnails after being loaded from cache --- app/build.gradle | 2 +- .../simplemobiletools/gallery/activities/MainActivity.kt | 1 + .../simplemobiletools/gallery/activities/MediaActivity.kt | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a527a8156..c794e1358 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.15.0' + compile 'com.simplemobiletools:commons:2.15.2' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 1f850a296..f1a8a0380 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -167,6 +167,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { directories_refresh_layout.isRefreshing = true } else { gotDirectories(dirs) + return } mCurrAsyncTask = GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index cbc1d5090..be252b463 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -217,15 +217,17 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { return mIsGettingMedia = true + mLoadedInitialPhotos = true val token = object : TypeToken>() {}.type val media = Gson().fromJson>(config.loadFolderMedia(mPath), token) ?: ArrayList(1) if (media.size == 0) { media_refresh_layout.isRefreshing = true } else { - if (!mLoadedInitialPhotos) + if (!mLoadedInitialPhotos) { gotMedia(media) + return + } } - mLoadedInitialPhotos = true mCurrAsyncTask = GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) { gotMedia(it)