removing a redundant function

This commit is contained in:
tibbi 2018-05-23 23:30:00 +02:00
parent ff13f59d47
commit 519df9e8a1

View file

@ -29,7 +29,7 @@ class MediaFetcher(val context: Context) {
val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia) val newMedia = getMediaOnOTG(curPath, isPickImage, isPickVideo, filterMedia)
curMedia.addAll(newMedia) curMedia.addAll(newMedia)
} else { } else {
val newMedia = fetchFolderContent(curPath, isPickImage, isPickVideo, filterMedia) val newMedia = getMediaInFolder(curPath, isPickImage, isPickVideo, filterMedia)
curMedia.addAll(newMedia) curMedia.addAll(newMedia)
} }
@ -163,14 +163,6 @@ class MediaFetcher(val context: Context) {
} }
} }
private fun fetchFolderContent(path: String, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int): ArrayList<Medium> {
return if (path.startsWith(OTG_PATH)) {
getMediaOnOTG(path, isPickImage, isPickVideo, filterMedia)
} else {
getMediaInFolder(path, isPickImage, isPickVideo, filterMedia)
}
}
private fun getMediaInFolder(folder: String, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int): ArrayList<Medium> { private fun getMediaInFolder(folder: String, isPickImage: Boolean, isPickVideo: Boolean, filterMedia: Int): ArrayList<Medium> {
val media = ArrayList<Medium>() val media = ArrayList<Medium>()
val files = File(folder).listFiles() ?: return media val files = File(folder).listFiles() ?: return media