fix thumbnail displaying

This commit is contained in:
tibbi 2018-01-08 20:48:52 +01:00
parent 03aa0afaca
commit cabf495b38
2 changed files with 9 additions and 8 deletions

View file

@ -42,7 +42,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:3.6.6'
implementation 'com.simplemobiletools:commons:3.6.12'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.google.code.gson:gson:2.8.2'

View file

@ -28,25 +28,26 @@ import java.util.*
class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>, val listener: MediaOperationsListener?, val isAGetIntent: Boolean,
val allowMultiplePicks: Boolean, recyclerView: MyRecyclerView, fastScroller: FastScroller? = null,
itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) {
init {
enableInstantLoad()
}
private val INSTANT_LOAD_DURATION = 1000L
private val IMAGE_LOAD_DELAY = 200L
private val INSTANT_LOAD_DURATION = 3000L
private val IMAGE_LOAD_DELAY = 100L
private val config = activity.config
private val isListViewType = config.viewTypeFiles == VIEW_TYPE_LIST
private var skipConfirmationDialog = false
private var visibleItemPaths = ArrayList<String>()
private var delayHandler = Handler(Looper.getMainLooper())
private var loadImageInstantly = false
private var delayHandler = Handler(Looper.getMainLooper())
private var scrollHorizontally = config.scrollHorizontally
private var animateGifs = config.animateGifs
private var cropThumbnails = config.cropThumbnails
private var displayFilenames = config.displayFileNames
init {
enableInstantLoad()
}
override fun getActionMenuId() = R.menu.cab_media
override fun prepareItemSelection(view: View) {
@ -274,7 +275,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
private fun enableInstantLoad() {
loadImageInstantly = true
Handler().postDelayed({
delayHandler.postDelayed({
loadImageInstantly = false
}, INSTANT_LOAD_DURATION)
}