From dd9bef298fd968d1b80b185c362d2c7d0f74fc0f Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 4 Oct 2017 19:03:43 +0200 Subject: [PATCH] minor code cleanup --- .../gallery/asynctasks/GetMediaAsynctask.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt index 2c99f54d6..a3b8a2b5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -10,14 +10,15 @@ import java.util.* class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo: Boolean = false, val isPickImage: Boolean = false, val showAll: Boolean, val callback: (media: ArrayList) -> Unit) : AsyncTask>() { - val mediaFetcher = MediaFetcher(context) + private val mediaFetcher = MediaFetcher(context) override fun doInBackground(vararg params: Void): ArrayList { return if (showAll) { val mediaMap = mediaFetcher.getMediaByDirectories(isPickVideo, isPickImage) val media = ArrayList() - for ((path, curMedia) in mediaMap) { - media.addAll(curMedia) + + mediaMap.values.forEach { + media.addAll(it) } Medium.sorting = context.config.getFileSorting("")