Skip to content

Instantly share code, notes, and snippets.

@hXtreme
Created July 10, 2019 19:22
Show Gist options
  • Save hXtreme/8b55917665fe1ae6c8d174e7ae07565a to your computer and use it in GitHub Desktop.
Save hXtreme/8b55917665fe1ae6c8d174e7ae07565a to your computer and use it in GitHub Desktop.
The changes I made when trying to provide Migration from within Manga Info page.
import eu.kanade.tachiyomi.ui.migration.MigrationController
import eu.kanade.tachiyomi.ui.migration.SearchController
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_open_in_browser -> openInBrowser()
R.id.action_open_in_web_view -> openInWebView()
R.id.action_share -> shareManga()
R.id.action_add_to_home_screen -> addToHomeScreen()
R.id.action_migrate -> migrate()
else -> return super.onOptionsItemSelected(item)
}
return true
}
/**
* Migrate the current manga to a different source
*/
private fun migrate() {
val migrationController = MigrationController()
val controller = SearchController(presenter.manga)
controller.targetController = migrationController
router.pushController(controller.withFadeTransaction())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment