Ink
09/28/2021, 8:08 AMenum class ItemCategory {
ACCOUNT,
CARD,
OTHER,
INVESTMENTS,
LOAN
}
and then:
items = itemList.sortedBy { it.category.name }.groupBy { it.category }
Artur Schwarz
09/28/2021, 8:30 AMephemient
09/28/2021, 10:07 AMval comparator = compareBy<ItemCategory> { it == ItemCategory.OTHER }
.thenBy { it.name }
items = itemList.groupBy { it.category }
.toSortedMap(comparator)