From db0c1b26341582020abd6f0e1142c7763adb02b1 Mon Sep 17 00:00:00 2001 From: FourTOne5 <59261191+FourTOne5@users.noreply.github.com> Date: Sat, 3 Jul 2021 19:43:29 +0600 Subject: [PATCH] Sort Installed, Update, Untrusted Extenion by Name in Extensions Tab (#5486) * Update ExtensionPresenter.kt * Update ExtensionPresenter.kt * Update ExtensionPresenter.kt --- .../tachiyomi/ui/browse/extension/ExtensionPresenter.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt index e2f3b45cf..725693a7c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionPresenter.kt @@ -61,9 +61,9 @@ open class ExtensionPresenter( val items = mutableListOf() - val updatesSorted = installed.filter { it.hasUpdate && (showNsfwExtensions || !it.isNsfw) }.sortedBy { it.pkgName } - val installedSorted = installed.filter { !it.hasUpdate && (showNsfwExtensions || !it.isNsfw) }.sortedWith(compareBy({ !it.isObsolete }, { it.pkgName })) - val untrustedSorted = untrusted.sortedBy { it.pkgName } + val updatesSorted = installed.filter { it.hasUpdate && (showNsfwExtensions || !it.isNsfw) }.sortedBy { it.name } + val installedSorted = installed.filter { !it.hasUpdate && (showNsfwExtensions || !it.isNsfw) }.sortedWith(compareBy({ !it.isObsolete }, { it.name })) + val untrustedSorted = untrusted.sortedBy { it.name } val availableSorted = available // Filter out already installed extensions and disabled languages .filter { avail -> @@ -82,9 +82,11 @@ open class ExtensionPresenter( } if (installedSorted.isNotEmpty() || untrustedSorted.isNotEmpty()) { val header = ExtensionGroupItem(context.getString(R.string.ext_installed), installedSorted.size + untrustedSorted.size) + items += installedSorted.map { extension -> ExtensionItem(extension, header, currentDownloads[extension.pkgName]) } + items += untrustedSorted.map { extension -> ExtensionItem(extension, header) }