mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Prevent choose address of phone number dialog not being dismissed once a user made a choice
This commit is contained in:
parent
dd454113e8
commit
a210ea67c1
2 changed files with 14 additions and 0 deletions
|
|
@ -39,15 +39,24 @@ class ContactNumberOrAddressModel
|
|||
) {
|
||||
val selected = MutableLiveData<Boolean>()
|
||||
|
||||
private var actionDoneCallback: (() -> Unit)? = null
|
||||
|
||||
@UiThread
|
||||
fun setActionDoneCallback(lambda: () -> Unit) {
|
||||
actionDoneCallback = lambda
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun onClicked() {
|
||||
listener.onClicked(this)
|
||||
actionDoneCallback?.invoke()
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun onLongPress(): Boolean {
|
||||
selected.value = true
|
||||
listener.onLongPress(this)
|
||||
actionDoneCallback?.invoke()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ class NumberOrAddressPickerDialogModel
|
|||
val dismissEvent = MutableLiveData<Event<Boolean>>()
|
||||
|
||||
init {
|
||||
for (model in list) {
|
||||
model.setActionDoneCallback {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
sipAddressesAndPhoneNumbers.value = list
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue