Minor code cleanup
This commit is contained in:
@@ -42,8 +42,8 @@ class MigrationPresenter(
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext { state = state.copy(sourcesWithManga = findSourcesWithManga(it)) }
|
||||
.combineLatest(stateRelay.map { it.selectedSource }
|
||||
.distinctUntilChanged(),
|
||||
{ library, source -> library to source })
|
||||
.distinctUntilChanged()
|
||||
) { library, source -> library to source }
|
||||
.filter { (_, source) -> source != null }
|
||||
.observeOn(Schedulers.io())
|
||||
.map { (library, source) -> libraryToMigrationItem(library, source!!.id) }
|
||||
|
||||
@@ -77,13 +77,13 @@ class SearchController(
|
||||
.content(R.string.migration_dialog_what_to_include)
|
||||
.items(MigrationFlags.titles.map { resources?.getString(it) })
|
||||
.alwaysCallMultiChoiceCallback()
|
||||
.itemsCallbackMultiChoice(preselected.toTypedArray(), { _, positions, _ ->
|
||||
.itemsCallbackMultiChoice(preselected.toTypedArray()) { _, positions, _ ->
|
||||
// Save current settings for the next time
|
||||
val newValue = MigrationFlags.getFlagsFromPositions(positions)
|
||||
preferences.migrateFlags().set(newValue)
|
||||
|
||||
true
|
||||
})
|
||||
}
|
||||
.positiveText(R.string.migrate)
|
||||
.negativeText(R.string.copy)
|
||||
.neutralText(android.R.string.cancel)
|
||||
@@ -98,4 +98,4 @@ class SearchController(
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user