Fix backspace
This commit is contained in:
parent
4420da8738
commit
bfe5b7b813
1 changed files with 11 additions and 6 deletions
|
@ -383,9 +383,11 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
private void registerInputEditTexts() {
|
||||
TextWatcher textWatcher = new TextWatcher() {
|
||||
|
||||
private int strLength;
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
strLength = charSequence.length();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -400,11 +402,14 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
if (focusedView != null && focusedView instanceof EditText) {
|
||||
EditText focusedEditText = (EditText) focusedView;
|
||||
String str = focusedEditText.getText().toString();
|
||||
int pointIndex = str.indexOf(".");
|
||||
if (pointIndex != -1) {
|
||||
int currentAccuracy = str.substring(pointIndex + 1).length();
|
||||
if (currentAccuracy >= accuracy) {
|
||||
switchToNextInput(focusedEditText.getId());
|
||||
int currentLength = str.length();
|
||||
if (currentLength > strLength) {
|
||||
int pointIndex = str.indexOf(".");
|
||||
if (pointIndex != -1) {
|
||||
int currentAccuracy = str.substring(pointIndex + 1).length();
|
||||
if (currentAccuracy >= accuracy) {
|
||||
switchToNextInput(focusedEditText.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue