Skip to content

Instantly share code, notes, and snippets.

@DawnImpulse
Created September 20, 2018 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DawnImpulse/69449e4b4d017d84603f043193d99d4d to your computer and use it in GitHub Desktop.
Save DawnImpulse/69449e4b4d017d84603f043193d99d4d to your computer and use it in GitHub Desktop.
sort custom collections
// this will be a descending sort
fun sortLabels(labels: List<FirebaseVisionLabel>): List<FirebaseVisionLabel> {
Collections.sort(labels) { o1, o2 ->
o2.confidence.compareTo(o1.confidence)
}
return labels
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment