Advertisement
Guest User

kotlin sorting

a guest
Sep 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.31 KB | None | 0 0
  1. fun sortBySubtitle(list: List<MediaBrowserCompat.MediaItem>) : List<MediaBrowserCompat.MediaItem> {
  2.  
  3.     return list.sortedWith(compareByDescending <MediaBrowserCompat.MediaItem>
  4.     { it.description.subtitle.toString() }
  5.             .thenBy (String.CASE_INSENSITIVE_ORDER) { it.description.title.toString() })
  6.  
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement