mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 15:01:52 +01:00
Seperate pending updates for extensions into a seperate heading
Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
parent
cee7c30a02
commit
3f1869cab6
@ -152,8 +152,10 @@ class ExtensionBottomPresenter(
|
|||||||
|
|
||||||
val items = mutableListOf<ExtensionItem>()
|
val items = mutableListOf<ExtensionItem>()
|
||||||
|
|
||||||
val installedSorted = installed.filter { showNsfwExtensions || !it.isNsfw }
|
val updatesSorted = installed.filter { it.hasUpdate && (showNsfwExtensions || !it.isNsfw) }.sortedBy { it.pkgName }
|
||||||
.sortedWith(compareBy({ !it.hasUpdate }, { !it.isObsolete }, { it.pkgName }))
|
val installedSorted = installed
|
||||||
|
.filter { !it.hasUpdate && showNsfwExtensions || !it.isNsfw }
|
||||||
|
.sortedWith(compareBy({ !it.isObsolete }, { it.pkgName }))
|
||||||
val untrustedSorted = untrusted.sortedBy { it.pkgName }
|
val untrustedSorted = untrusted.sortedBy { it.pkgName }
|
||||||
val availableSorted = available
|
val availableSorted = available
|
||||||
// Filter out already installed extensions and disabled languages
|
// Filter out already installed extensions and disabled languages
|
||||||
@ -165,6 +167,19 @@ class ExtensionBottomPresenter(
|
|||||||
}
|
}
|
||||||
.sortedBy { it.pkgName }
|
.sortedBy { it.pkgName }
|
||||||
|
|
||||||
|
if (updatesSorted.isNotEmpty()) {
|
||||||
|
val header = ExtensionGroupItem(
|
||||||
|
context.resources.getQuantityString(
|
||||||
|
R.plurals._updates_pending,
|
||||||
|
updatesSorted.size,
|
||||||
|
updatesSorted.size
|
||||||
|
),
|
||||||
|
updatesSorted.size
|
||||||
|
)
|
||||||
|
items += updatesSorted.map { extension ->
|
||||||
|
ExtensionItem(extension, header, currentDownloads[extension.pkgName])
|
||||||
|
}
|
||||||
|
}
|
||||||
if (installedSorted.isNotEmpty() || untrustedSorted.isNotEmpty()) {
|
if (installedSorted.isNotEmpty() || untrustedSorted.isNotEmpty()) {
|
||||||
val header = ExtensionGroupItem(context.getString(R.string.installed), installedSorted.size + untrustedSorted.size)
|
val header = ExtensionGroupItem(context.getString(R.string.installed), installedSorted.size + untrustedSorted.size)
|
||||||
items += installedSorted.map { extension ->
|
items += installedSorted.map { extension ->
|
||||||
|
@ -302,6 +302,10 @@
|
|||||||
<string name="may_contain_nsfw">May contain NSFW (18+) content</string>
|
<string name="may_contain_nsfw">May contain NSFW (18+) content</string>
|
||||||
<string name="app_info">App info</string>
|
<string name="app_info">App info</string>
|
||||||
<string name="_must_be_enabled_first">%1$s must be enabled first</string>
|
<string name="_must_be_enabled_first">%1$s must be enabled first</string>
|
||||||
|
<plurals name="_updates_pending">
|
||||||
|
<item quantity="one">%d update pending</item>
|
||||||
|
<item quantity="other">%d updates pending</item>
|
||||||
|
</plurals>
|
||||||
<plurals name="extension_updates_available">
|
<plurals name="extension_updates_available">
|
||||||
<item quantity="one">Extension update available</item>
|
<item quantity="one">Extension update available</item>
|
||||||
<item quantity="other">%d extension updates available</item>
|
<item quantity="other">%d extension updates available</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user