simplify AddFavoritesDialog confirmation

This commit is contained in:
tibbi 2018-03-01 16:41:48 +01:00
parent 3cddd70a5b
commit aef045f160
1 changed files with 1 additions and 5 deletions

View File

@ -43,13 +43,10 @@ class AddFavoritesDialog(val activity: SimpleActivity, private val callback: ()
}
dialog = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null)
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this)
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
dialogConfirmed()
}
}
}
@ -66,7 +63,6 @@ class AddFavoritesDialog(val activity: SimpleActivity, private val callback: ()
contactsHelper.removeFavorites(allDisplayedContacts)
callback()
dialog?.dismiss()
}.start()
}
}