Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import eu.kanade.tachiyomi.ui.migration.MigrationController
  2. import eu.kanade.tachiyomi.ui.migration.SearchController
  3.  
  4. override fun onOptionsItemSelected(item: MenuItem): Boolean {
  5. when (item.itemId) {
  6. R.id.action_open_in_browser -> openInBrowser()
  7. R.id.action_open_in_web_view -> openInWebView()
  8. R.id.action_share -> shareManga()
  9. R.id.action_add_to_home_screen -> addToHomeScreen()
  10. R.id.action_migrate -> migrate()
  11. else -> return super.onOptionsItemSelected(item)
  12. }
  13. return true
  14. }
  15.  
  16. /**
  17. * Migrate the current manga to a different source
  18. */
  19. private fun migrate() {
  20. val migrationController = MigrationController()
  21. val controller = SearchController(presenter.manga)
  22. controller.targetController = migrationController
  23.  
  24. router.pushController(controller.withFadeTransaction())
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement