Code cleanup.

This commit is contained in:
NerdNumber9 2017-03-07 22:44:08 -05:00
parent c42f011a05
commit 961a6c0b4f
3 changed files with 12 additions and 12 deletions

View File

@ -119,7 +119,7 @@ class BatchAddFragment : BaseFragment() {
.title("No galleries to add!") .title("No galleries to add!")
.content("You must specify at least one gallery to add!") .content("You must specify at least one gallery to add!")
.positiveText("Ok") .positiveText("Ok")
.onPositive { materialDialog, dialogAction -> materialDialog.dismiss() } .onPositive { materialDialog, _ -> materialDialog.dismiss() }
.cancelable(true) .cancelable(true)
.canceledOnTouchOutside(true) .canceledOnTouchOutside(true)
.show() .show()

View File

@ -67,8 +67,8 @@ class LibraryMigrationManager(val context: MainActivity,
"This migration process is not automatic, tap 'CONTINUE' to be guided through it.") "This migration process is not automatic, tap 'CONTINUE' to be guided through it.")
.positiveText("Continue") .positiveText("Continue")
.negativeText("Cancel") .negativeText("Cancel")
.onPositive { materialDialog, dialogAction -> jumpToMigrationStep(MigrationStatus.OPEN_BACKUP_MENU) } .onPositive { _, _ -> jumpToMigrationStep(MigrationStatus.OPEN_BACKUP_MENU) }
.onNegative { materialDialog, dialogAction -> warnUserMigration() } .onNegative { _, _ -> warnUserMigration() }
.show() .show()
} }
@ -79,8 +79,8 @@ class LibraryMigrationManager(val context: MainActivity,
"Press 'MIGRATE' to restart the migration process, press 'OK' if you still wish to cancel the migration process.") "Press 'MIGRATE' to restart the migration process, press 'OK' if you still wish to cancel the migration process.")
.positiveText("Ok") .positiveText("Ok")
.negativeText("Migrate") .negativeText("Migrate")
.onPositive { materialDialog, dialogAction -> completeMigration() } .onPositive { _, _ -> completeMigration() }
.onNegative { materialDialog, dialogAction -> notifyUserMigration() } .onNegative { _, _ -> notifyUserMigration() }
.show() .show()
} }
@ -98,7 +98,7 @@ class LibraryMigrationManager(val context: MainActivity,
migrationStepDialog(1, null, MigrationStatus.PERFORM_BACKUP) migrationStepDialog(1, null, MigrationStatus.PERFORM_BACKUP)
.customView(view, true) .customView(view, true)
.neutralText("Launch Old App") .neutralText("Launch Old App")
.onNeutral { materialDialog, dialogAction -> .onNeutral { _, _ ->
//Auto dismiss messes this up so we have to reopen the dialog manually //Auto dismiss messes this up so we have to reopen the dialog manually
val ma = mainTachiyomiEHActivity() val ma = mainTachiyomiEHActivity()
if(ma != null) { if(ma != null) {
@ -134,7 +134,7 @@ class LibraryMigrationManager(val context: MainActivity,
"Then tap 'OK' to exit the migration process!")) "Then tap 'OK' to exit the migration process!"))
.positiveText("Ok") .positiveText("Ok")
.neutralText("Uninstall Old App") .neutralText("Uninstall Old App")
.onPositive { materialDialog, dialogAction -> .onPositive { _, _ ->
completeMigration() completeMigration()
//Check if the metadata needs to be updated //Check if the metadata needs to be updated
databaseHelper.getLibraryMangas().asRxSingle().subscribe { databaseHelper.getLibraryMangas().asRxSingle().subscribe {
@ -144,7 +144,7 @@ class LibraryMigrationManager(val context: MainActivity,
} }
} }
} }
.onNeutral { materialDialog, dialogAction -> .onNeutral { _, _ ->
val packageUri = Uri.parse("package:$TACHIYOMI_EH_PACKAGE") val packageUri = Uri.parse("package:$TACHIYOMI_EH_PACKAGE")
val uninstallIntent = Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri) val uninstallIntent = Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri)
context.startActivity(uninstallIntent) context.startActivity(uninstallIntent)
@ -164,11 +164,11 @@ class LibraryMigrationManager(val context: MainActivity,
.apply { .apply {
if(previousStep != null) { if(previousStep != null) {
negativeText("Back") negativeText("Back")
onNegative { materialDialog, dialogAction -> jumpToMigrationStep(previousStep) } onNegative { _, _ -> jumpToMigrationStep(previousStep) }
} }
if(nextStep != null) { if(nextStep != null) {
positiveText("Continue") positiveText("Continue")
onPositive { materialDialog, dialogAction -> jumpToMigrationStep(nextStep) } onPositive { _, _ -> jumpToMigrationStep(nextStep) }
} }
}!! }!!

View File

@ -105,8 +105,8 @@ class MetadataFetchDialog {
"This process can be done later if required.")) "This process can be done later if required."))
.positiveText("Migrate") .positiveText("Migrate")
.negativeText("Later") .negativeText("Later")
.onPositive { materialDialog, dialogAction -> show(activity) } .onPositive { _, _ -> show(activity) }
.onNegative { materialDialog, dialogAction -> adviseMigrationLater(activity) } .onNegative({ _, _ -> adviseMigrationLater(activity) })
.cancelable(false) .cancelable(false)
.canceledOnTouchOutside(false) .canceledOnTouchOutside(false)
.dismissListener { .dismissListener {