From 4af0c613d99ed66ca424efe485f0a95dc9c60efb Mon Sep 17 00:00:00 2001 From: madbulls Date: Thu, 5 Aug 2021 23:08:47 +0700 Subject: [PATCH] sort channels by name --- app/src/main/java/net/harimurti/tv/adapter/CategoryAdapter.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/net/harimurti/tv/adapter/CategoryAdapter.kt b/app/src/main/java/net/harimurti/tv/adapter/CategoryAdapter.kt index 6e01282..8f6534e 100644 --- a/app/src/main/java/net/harimurti/tv/adapter/CategoryAdapter.kt +++ b/app/src/main/java/net/harimurti/tv/adapter/CategoryAdapter.kt @@ -40,6 +40,8 @@ class CategoryAdapter (private val categories: ArrayList?) : RecyclerV .putExtra(MainActivity.MAIN_CALLBACK, MainActivity.OPEN_SETTINGS)) } } + //sort channels by name before add to adapter + category?.channels?.sortBy { channels -> channels.name?.lowercase() } viewHolder.recyclerView.adapter = ChannelAdapter(category?.channels, position) }