From 7007e61879bf33c09115b5d8bc16f27af2731045 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 19 Oct 2019 22:30:16 -0700 Subject: Convert java math to kotlin math --- .../src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mediapicker') 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( 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() -- cgit v1.2.3