Move migration into browse as a tab

This commit is contained in:
arkon 2020-05-23 18:53:13 -04:00
parent 39ae84301a
commit 4e027cec71
5 changed files with 7 additions and 21 deletions

View File

@ -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
}
}

View File

@ -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)
}

View File

@ -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 {

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M9.01,14L2,14v2h7.01v3L13,15l-3.99,-4v3zM14.99,13v-3L22,10L22,8h-7.01L14.99,5L11,9l3.99,4z" />
</vector>

View File

@ -20,7 +20,7 @@
<string name="label_sources">Sources</string>
<string name="label_categories">Categories</string>
<string name="label_backup">Backup</string>
<string name="label_migration">Source migration</string>
<string name="label_migration">Migration</string>
<string name="label_extensions">Extensions</string>
<string name="label_extension_info">Extension info</string>
<string name="label_help">Help</string>