Finish auto-migration feature

This commit is contained in:
NerdNumber9
2019-08-03 02:23:21 -04:00
parent 9cc24a3be3
commit 4f2985469c
13 changed files with 360 additions and 95 deletions

View File

@@ -165,6 +165,16 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
subscriptions += controller.selectionRelay
.subscribe { onSelectionChanged(it) }
subscriptions += controller.selectAllRelay
.subscribe {
if (it == category.id) {
adapter.currentItems.forEach { item ->
controller.setSelection(item.manga, true)
}
controller.invalidateActionMode()
}
}
}
fun onRecycle() {

View File

@@ -99,6 +99,8 @@ class LibraryController(
*/
val libraryMangaRelay: BehaviorRelay<LibraryMangaEvent> = BehaviorRelay.create()
val selectAllRelay: PublishRelay<Int> = PublishRelay.create()
/**
* Number of manga per row in grid mode.
*/
@@ -436,6 +438,9 @@ class LibraryController(
}
R.id.action_move_to_category -> showChangeMangaCategoriesDialog()
R.id.action_delete -> showDeleteMangaDialog()
R.id.action_select_all -> {
selectAllRelay.call(activeCategory)
}
R.id.action_auto_source_migration -> {
router.pushController(MigrationDesignController.create(
selectedMangas.mapNotNull { it.id }