From 4e027cec71dd5ec345c3b7f6b415cc8fb2225b63 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 23 May 2020 18:53:13 -0400 Subject: [PATCH] Move migration into browse as a tab --- .../eu/kanade/tachiyomi/ui/browse/BrowseController.kt | 6 +++++- .../tachiyomi/ui/browse/migration/MigrationController.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/more/MoreController.kt | 9 --------- .../main/res/drawable/ic_compare_arrows_black_24dp.xml | 9 --------- app/src/main/res/values/strings.xml | 2 +- 5 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_compare_arrows_black_24dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt index af11ef978c..61cafdd4d5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt @@ -20,6 +20,7 @@ import eu.kanade.tachiyomi.ui.base.controller.RootController import eu.kanade.tachiyomi.ui.base.controller.RxController import eu.kanade.tachiyomi.ui.base.controller.TabbedController import eu.kanade.tachiyomi.ui.browse.extension.ExtensionController +import eu.kanade.tachiyomi.ui.browse.migration.MigrationController import eu.kanade.tachiyomi.ui.browse.source.SourceController import kotlinx.android.synthetic.main.main_activity.tabs import uy.kohesive.injekt.injectLazy @@ -111,7 +112,8 @@ class BrowseController : private val tabTitles = listOf( R.string.label_sources, - R.string.label_extensions + R.string.label_extensions, + R.string.label_migration ) .map { resources!!.getString(it) } @@ -124,6 +126,7 @@ class BrowseController : val controller: Controller = when (position) { SOURCES_CONTROLLER -> SourceController() EXTENSIONS_CONTROLLER -> ExtensionController() + MIGRATION_CONTROLLER -> MigrationController() else -> error("Wrong position $position") } router.setRoot(RouterTransaction.with(controller)) @@ -140,5 +143,6 @@ class BrowseController : const val SOURCES_CONTROLLER = 0 const val EXTENSIONS_CONTROLLER = 1 + const val MIGRATION_CONTROLLER = 2 } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationController.kt index 21f3c1a05e..2b94d56941 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationController.kt @@ -88,7 +88,7 @@ class MigrationController : val controller = SearchController(item.manga) controller.targetController = this - router.pushController(controller.withFadeTransaction()) + parentController!!.router.pushController(controller.withFadeTransaction()) } else if (item is SourceItem) { presenter.setSelectedSource(item.source) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt index c3263e8167..b3f494f187 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt @@ -11,7 +11,6 @@ import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys import eu.kanade.tachiyomi.ui.base.controller.NoToolbarElevationController import eu.kanade.tachiyomi.ui.base.controller.RootController import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.ui.browse.migration.MigrationController import eu.kanade.tachiyomi.ui.download.DownloadController import eu.kanade.tachiyomi.ui.setting.SettingsController import eu.kanade.tachiyomi.ui.setting.SettingsMainController @@ -67,14 +66,6 @@ class MoreController : router.pushController(DownloadController().withFadeTransaction()) } } - preference { - titleRes = R.string.label_migration - iconRes = R.drawable.ic_compare_arrows_black_24dp - iconTint = tintColor - onClick { - router.pushController(MigrationController().withFadeTransaction()) - } - } } preferenceCategory { diff --git a/app/src/main/res/drawable/ic_compare_arrows_black_24dp.xml b/app/src/main/res/drawable/ic_compare_arrows_black_24dp.xml deleted file mode 100644 index 261c56592d..0000000000 --- a/app/src/main/res/drawable/ic_compare_arrows_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ac0f5afaed..e7d28cd5ac 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,7 +20,7 @@ Sources Categories Backup - Source migration + Migration Extensions Extension info Help