Undo formatting changes
This commit is contained in:
parent
04e8f0d77f
commit
7928c5f66d
@ -349,11 +349,7 @@ class MigrationListController(bundle: Bundle? = null) :
|
|||||||
} else {
|
} else {
|
||||||
sources.filter { it.id != manga.source }
|
sources.filter { it.id != manga.source }
|
||||||
}
|
}
|
||||||
val searchController =
|
val searchController = SearchController(manga, validSources)
|
||||||
SearchController(
|
|
||||||
manga,
|
|
||||||
validSources
|
|
||||||
)
|
|
||||||
searchController.targetController = this@MigrationListController
|
searchController.targetController = this@MigrationListController
|
||||||
router.pushController(searchController.withFadeTransaction())
|
router.pushController(searchController.withFadeTransaction())
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,7 @@ class MangaItem(val manga: Manga) : AbstractFlexibleItem<MangaHolder>(), Parcela
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): MangaHolder {
|
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): MangaHolder {
|
||||||
return MangaHolder(
|
return MangaHolder(view, adapter)
|
||||||
view,
|
|
||||||
adapter
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun bindViewHolder(
|
override fun bindViewHolder(
|
||||||
|
@ -56,18 +56,9 @@ class MigrationMangaPresenter(
|
|||||||
replace: Boolean
|
replace: Boolean
|
||||||
) {
|
) {
|
||||||
val flags = Injekt.get<PreferencesHelper>().migrateFlags().get()
|
val flags = Injekt.get<PreferencesHelper>().migrateFlags().get()
|
||||||
val migrateChapters =
|
val migrateChapters = MigrationFlags.hasChapters(flags)
|
||||||
MigrationFlags.hasChapters(
|
val migrateCategories = MigrationFlags.hasCategories(flags)
|
||||||
flags
|
val migrateTracks = MigrationFlags.hasTracks(flags)
|
||||||
)
|
|
||||||
val migrateCategories =
|
|
||||||
MigrationFlags.hasCategories(
|
|
||||||
flags
|
|
||||||
)
|
|
||||||
val migrateTracks =
|
|
||||||
MigrationFlags.hasTracks(
|
|
||||||
flags
|
|
||||||
)
|
|
||||||
|
|
||||||
db.inTransaction {
|
db.inTransaction {
|
||||||
// Update chapters read
|
// Update chapters read
|
||||||
|
@ -52,11 +52,7 @@ class SearchController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun createPresenter(): GlobalSearchPresenter {
|
override fun createPresenter(): GlobalSearchPresenter {
|
||||||
return SearchPresenter(
|
return SearchPresenter(initialQuery, manga!!, sources = sources)
|
||||||
initialQuery,
|
|
||||||
manga!!,
|
|
||||||
sources = sources
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
@ -91,8 +87,7 @@ class SearchController(
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
fun migrateManga() {
|
fun migrateManga() {
|
||||||
val target = targetController as? MigrationInterface
|
val target = targetController as? MigrationInterface ?: return
|
||||||
?: return
|
|
||||||
val manga = manga ?: return
|
val manga = manga ?: return
|
||||||
val newManga = newManga ?: return
|
val newManga = newManga ?: return
|
||||||
|
|
||||||
@ -101,8 +96,7 @@ class SearchController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun copyManga() {
|
fun copyManga() {
|
||||||
val target = targetController as? MigrationInterface
|
val target = targetController as? MigrationInterface ?: return
|
||||||
?: return
|
|
||||||
val manga = manga ?: return
|
val manga = manga ?: return
|
||||||
val newManga = newManga ?: return
|
val newManga = newManga ?: return
|
||||||
|
|
||||||
@ -113,10 +107,7 @@ class SearchController(
|
|||||||
private fun replaceWithNewSearchController(manga: Manga?) {
|
private fun replaceWithNewSearchController(manga: Manga?) {
|
||||||
if (manga != null) {
|
if (manga != null) {
|
||||||
// router.popCurrentController()
|
// router.popCurrentController()
|
||||||
val searchController =
|
val searchController = SearchController(manga)
|
||||||
SearchController(
|
|
||||||
manga
|
|
||||||
)
|
|
||||||
searchController.targetController = targetController
|
searchController.targetController = targetController
|
||||||
searchController.progress = progress + 1
|
searchController.progress = progress + 1
|
||||||
searchController.totalProgress = totalProgress
|
searchController.totalProgress = totalProgress
|
||||||
@ -134,8 +125,7 @@ class SearchController(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
newManga = manga
|
newManga = manga
|
||||||
val dialog =
|
val dialog = MigrationDialog()
|
||||||
MigrationDialog()
|
|
||||||
dialog.targetController = this
|
dialog.targetController = this
|
||||||
dialog.showDialog(router)
|
dialog.showDialog(router)
|
||||||
}
|
}
|
||||||
@ -152,10 +142,7 @@ class SearchController(
|
|||||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||||
val prefValue = preferences.migrateFlags().get()
|
val prefValue = preferences.migrateFlags().get()
|
||||||
|
|
||||||
val preselected =
|
val preselected = MigrationFlags.getEnabledFlagsPositions(prefValue)
|
||||||
MigrationFlags.getEnabledFlagsPositions(
|
|
||||||
prefValue
|
|
||||||
)
|
|
||||||
|
|
||||||
return MaterialDialog(activity!!)
|
return MaterialDialog(activity!!)
|
||||||
.message(R.string.data_to_include_in_migration)
|
.message(R.string.data_to_include_in_migration)
|
||||||
@ -164,10 +151,7 @@ class SearchController(
|
|||||||
{ resources?.getString(it) as CharSequence },
|
{ resources?.getString(it) as CharSequence },
|
||||||
initialSelection = preselected.toIntArray()
|
initialSelection = preselected.toIntArray()
|
||||||
) { _, positions, _ ->
|
) { _, positions, _ ->
|
||||||
val newValue =
|
val newValue = MigrationFlags.getFlagsFromPositions(positions.toTypedArray())
|
||||||
MigrationFlags.getFlagsFromPositions(
|
|
||||||
positions.toTypedArray()
|
|
||||||
)
|
|
||||||
preferences.migrateFlags().set(newValue)
|
preferences.migrateFlags().set(newValue)
|
||||||
}
|
}
|
||||||
.positiveButton(R.string.migrate) {
|
.positiveButton(R.string.migrate) {
|
||||||
|
@ -25,10 +25,7 @@ class SelectionHeader : AbstractHeaderItem<SelectionHeader.Holder>() {
|
|||||||
* Creates a new view holder for this item.
|
* Creates a new view holder for this item.
|
||||||
*/
|
*/
|
||||||
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): Holder {
|
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): Holder {
|
||||||
return Holder(
|
return Holder(view, adapter)
|
||||||
view,
|
|
||||||
adapter
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,10 +28,7 @@ data class SourceItem(val source: Source, val header: SelectionHeader) :
|
|||||||
* Creates a new view holder for this item.
|
* Creates a new view holder for this item.
|
||||||
*/
|
*/
|
||||||
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): SourceHolder {
|
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): SourceHolder {
|
||||||
return SourceHolder(
|
return SourceHolder(view, adapter as SourceAdapter)
|
||||||
view,
|
|
||||||
adapter as SourceAdapter
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -429,10 +429,7 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
R.id.action_source_migration -> {
|
R.id.action_source_migration -> {
|
||||||
router.pushController(
|
router.pushController(MigrationSourcesController().withFadeTransaction())
|
||||||
MigrationSourcesController()
|
|
||||||
.withFadeTransaction()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
// --> EXH
|
// --> EXH
|
||||||
R.id.action_sync_favorites -> {
|
R.id.action_sync_favorites -> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user