mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-20 16:01:14 +01:00
Finish auto-migration feature
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user