do not attempt loading thumbnails after being loaded from cache

This commit is contained in:
tibbi 2017-04-03 18:29:30 +02:00
parent 8545ab8430
commit 152a56c32b
3 changed files with 6 additions and 3 deletions

View file

@ -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'

View file

@ -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) {

View file

@ -217,15 +217,17 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
return
mIsGettingMedia = true
mLoadedInitialPhotos = true
val token = object : TypeToken<List<Medium>>() {}.type
val media = Gson().fromJson<ArrayList<Medium>>(config.loadFolderMedia(mPath), token) ?: ArrayList<Medium>(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)