Skip to content

Commit

Permalink
Version 0.3: fixed crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidius20 committed Jan 20, 2020
1 parent af2bfd7 commit 53f9725
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import kotlin.Comparator
internal object AdapterFactory {

fun getFileAdapter(context: Context, directory: File): SimpleAdapter {
val unsortedFiles = directory.listFiles()

val sortedFiles = sortedSetOf<File>(Comparator { file1, file2 ->
if (file1.isDirectory && !file2.isDirectory) -1
else if (!file1.isDirectory && file2.isDirectory) 1
else file1.name.toLowerCase().compareTo(file2.name.toLowerCase())
}, *unsortedFiles!!)
}, *directory.listFiles()!!)

val data = ArrayList<Map<String, Any>>()
var map: MutableMap<String, Any>
Expand Down

0 comments on commit 53f9725

Please sign in to comment.