Fixed handling of DTMF backspace character
This commit is contained in:
@@ -1424,16 +1424,16 @@ class MainActivity : ComponentActivity() {
|
|||||||
val shouldRequestFocus by focusDtmf
|
val shouldRequestFocus by focusDtmf
|
||||||
TextField(
|
TextField(
|
||||||
value = dtmfText.value,
|
value = dtmfText.value,
|
||||||
onValueChange = { newText ->
|
onValueChange = {
|
||||||
if (newText.length > dtmfText.value.length) {
|
if (it.length > dtmfText.value.length) {
|
||||||
val char = newText.last()
|
val char = it.last()
|
||||||
Log.d(TAG, "Got DTMF digit '$char'")
|
|
||||||
if (char.isDigit() || char == '*' || char == '#') {
|
if (char.isDigit() || char == '*' || char == '#') {
|
||||||
dtmfText.value = newText
|
Log.d(TAG, "Got DTMF digit '$char'")
|
||||||
ua = UserAgent.ofAor(viewModel.selectedAor.value)!!
|
ua = UserAgent.ofAor(viewModel.selectedAor.value)!!
|
||||||
ua.currentCall()!!.sendDigit(char)
|
ua.currentCall()!!.sendDigit(char)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dtmfText.value = it
|
||||||
},
|
},
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone),
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
Reference in New Issue
Block a user