simplify AddFavoritesDialog confirmation
This commit is contained in:
parent
3cddd70a5b
commit
aef045f160
|
@ -43,13 +43,10 @@ class AddFavoritesDialog(val activity: SimpleActivity, private val callback: ()
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = AlertDialog.Builder(activity)
|
dialog = AlertDialog.Builder(activity)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this)
|
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)
|
contactsHelper.removeFavorites(allDisplayedContacts)
|
||||||
|
|
||||||
callback()
|
callback()
|
||||||
dialog?.dismiss()
|
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue