mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
minor code cleanup
This commit is contained in:
parent
c2ea3ad4bb
commit
dd9bef298f
1 changed files with 4 additions and 3 deletions
|
@ -10,14 +10,15 @@ import java.util.*
|
||||||
class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo: Boolean = false, val isPickImage: Boolean = false,
|
class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo: Boolean = false, val isPickImage: Boolean = false,
|
||||||
val showAll: Boolean, val callback: (media: ArrayList<Medium>) -> Unit) :
|
val showAll: Boolean, val callback: (media: ArrayList<Medium>) -> Unit) :
|
||||||
AsyncTask<Void, Void, ArrayList<Medium>>() {
|
AsyncTask<Void, Void, ArrayList<Medium>>() {
|
||||||
val mediaFetcher = MediaFetcher(context)
|
private val mediaFetcher = MediaFetcher(context)
|
||||||
|
|
||||||
override fun doInBackground(vararg params: Void): ArrayList<Medium> {
|
override fun doInBackground(vararg params: Void): ArrayList<Medium> {
|
||||||
return if (showAll) {
|
return if (showAll) {
|
||||||
val mediaMap = mediaFetcher.getMediaByDirectories(isPickVideo, isPickImage)
|
val mediaMap = mediaFetcher.getMediaByDirectories(isPickVideo, isPickImage)
|
||||||
val media = ArrayList<Medium>()
|
val media = ArrayList<Medium>()
|
||||||
for ((path, curMedia) in mediaMap) {
|
|
||||||
media.addAll(curMedia)
|
mediaMap.values.forEach {
|
||||||
|
media.addAll(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
Medium.sorting = context.config.getFileSorting("")
|
Medium.sorting = context.config.getFileSorting("")
|
||||||
|
|
Loading…
Reference in a new issue