From f86b89472f27d683c42335d2c30447cbcbe2f97f Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Mon, 6 Nov 2017 14:25:25 +0200 Subject: [PATCH] Fix clear --- .../plus/mapmarkers/CoordinateInputDialogFragment.java | 6 ++---- .../src/net/osmand/plus/widgets/OsmandTextFieldBoxes.java | 6 +++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index f66dbb6e7f..307046e779 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -680,16 +680,14 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm mapMarkers.add(mapMarker); adapter.notifyDataSetChanged(); clearInputs(); - ((OsmandTextFieldBoxes) mainView.findViewById(R.id.latitude_box)).select(); } private void clearInputs() { - for (EditText inputEditText : inputEditTexts) { - inputEditText.setText(""); - } for (OsmandTextFieldBoxes osmandTextFieldBox : textFieldBoxes) { + osmandTextFieldBox.getEditText().setText(""); osmandTextFieldBox.deactivate(); } + ((OsmandTextFieldBoxes) mainView.findViewById(R.id.latitude_box)).select(); } private MapActivity getMapActivity() { diff --git a/OsmAnd/src/net/osmand/plus/widgets/OsmandTextFieldBoxes.java b/OsmAnd/src/net/osmand/plus/widgets/OsmandTextFieldBoxes.java index 9a747758b4..181354c57f 100644 --- a/OsmAnd/src/net/osmand/plus/widgets/OsmandTextFieldBoxes.java +++ b/OsmAnd/src/net/osmand/plus/widgets/OsmandTextFieldBoxes.java @@ -2,11 +2,11 @@ package net.osmand.plus.widgets; import android.content.Context; import android.support.v4.view.ViewCompat; -import android.text.InputType; import android.util.AttributeSet; import android.view.View; import android.view.inputmethod.InputMethodManager; +import studio.carbonylgroup.textfieldboxes.ExtendedEditText; import studio.carbonylgroup.textfieldboxes.TextFieldBoxes; public class OsmandTextFieldBoxes extends TextFieldBoxes { @@ -80,4 +80,8 @@ public class OsmandTextFieldBoxes extends TextFieldBoxes { this.activated = false; } + + public ExtendedEditText getEditText() { + return editText; + } }