Fixed dialer input cursor being moved to start when using digits from numpad
This commit is contained in:
parent
e19ab356d4
commit
1eb4d3f4ec
2 changed files with 8 additions and 0 deletions
|
@ -22,6 +22,7 @@ package org.linphone.activities.main.dialer.viewmodels
|
|||
import android.content.Context
|
||||
import android.os.Vibrator
|
||||
import android.provider.Settings
|
||||
import android.widget.EditText
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
|
@ -140,6 +141,11 @@ class DialerViewModel : LogsUploadViewModel() {
|
|||
super.onCleared()
|
||||
}
|
||||
|
||||
// This is to workaround the cursor being set to the start when pressing a digit
|
||||
fun onUriChanged(input: EditText) {
|
||||
input.setSelection(input.text.length)
|
||||
}
|
||||
|
||||
fun updateShowVideoPreview() {
|
||||
val videoPreview = corePreferences.videoPreview
|
||||
showPreview.value = videoPreview
|
||||
|
|
|
@ -42,7 +42,9 @@
|
|||
android:src="@drawable/backspace" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/sip_uri_input"
|
||||
android:text="@={viewModel.enteredUri}"
|
||||
android:onTextChanged="@{(text, start, before, count) -> viewModel.onUriChanged(sipUriInput)}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
Loading…
Reference in a new issue