I want to sort my ArrayList using a boolean type. Basically i want to show entries with true first. Here is my code below:
ArrayList
true
Abc.java
Using Kotlin you can do smth like this:
listOfABCElements.sortBy { it.isClickable }
output: true,true,true,false,false
in reverse order:
listOfABCElements.sortByDescending { it.isClickable }
output: false,false,true,true,true