aboutsummaryrefslogtreecommitdiff
path: root/mediapicker
diff options
context:
space:
mode:
Diffstat (limited to 'mediapicker')
-rw-r--r--mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt
index 68d1121..5548812 100644
--- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt
+++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt
@@ -51,6 +51,7 @@ import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import kotlinx.coroutines.CancellationException
import java.io.File
+import kotlin.math.min
/**
* Created by Allan Wang on 2017-07-23.
@@ -204,7 +205,7 @@ abstract class MediaPickerCore<T : GenericItem>(
addItems(models.map { converter(it) })
if (!hasPreloaded && mediaType == MediaType.VIDEO) {
hasPreloaded = true
- val preloads = models.subList(0, Math.min(models.size, 50)).map {
+ val preloads = models.subList(0, min(models.size, 50)).map {
glide.load(it.data)
.applyMediaOptions(this@MediaPickerCore)
.preload()