Mass Migration now shows progress and total manga in the title

(cherry picked from commit 68c3d28b4bc7b5cc4038648d5f187fe4da9a42a9)
This commit is contained in:
jobobby04 2020-04-17 01:13:18 -04:00 committed by Jobobby04
parent 2e0102d689
commit 3d0dc64de1
2 changed files with 10 additions and 1 deletions

View File

@ -78,7 +78,8 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
} }
override fun getTitle(): String? { override fun getTitle(): String? {
return resources?.getString(R.string.migration) return resources?.getString(R.string.migration) + " (${adapter?.items?.count { it.manga
.migrationStatus != MigrationStatus.RUNNUNG }}/${adapter?.itemCount ?: 0})"
} }
override fun onViewCreated(view: View) { override fun onViewCreated(view: View) {
@ -243,6 +244,12 @@ class MigrationListController(bundle: Bundle? = null) : BaseController(bundle),
} }
} }
override fun updateCount() {
launchUI {
setTitle()
}
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()

View File

@ -36,9 +36,11 @@ class MigrationProcessAdapter(
fun enableButtons() fun enableButtons()
fun removeManga(item: MigrationProcessItem) fun removeManga(item: MigrationProcessItem)
fun noMigration() fun noMigration()
fun updateCount()
} }
fun sourceFinished() { fun sourceFinished() {
menuItemListener.updateCount()
if (itemCount == 0) menuItemListener.noMigration() if (itemCount == 0) menuItemListener.noMigration()
if (allMangasDone()) menuItemListener.enableButtons() if (allMangasDone()) menuItemListener.enableButtons()
} }