Created
July 10, 2019 19:22
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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