From 99a24260a672313b3558e05ecc380733e09d37a5 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 1 Nov 2017 19:00:15 +0200 Subject: [PATCH] Fix options menu --- ...r_coordinate_input_bottom_sheet_dialog.xml | 73 ---- ...nate_input_options_bottom_sheet_helper.xml | 371 +++++++++++++----- .../res/layout/marker_coordinate_formats.xml | 123 ------ OsmAnd/res/values/strings.xml | 3 + ...rdinateInputBottomSheetDialogFragment.java | 168 ++++---- .../CoordinateInputDialogFragment.java | 147 +++---- 6 files changed, 397 insertions(+), 488 deletions(-) delete mode 100644 OsmAnd/res/layout/fragment_marker_coordinate_input_bottom_sheet_dialog.xml delete mode 100644 OsmAnd/res/layout/marker_coordinate_formats.xml diff --git a/OsmAnd/res/layout/fragment_marker_coordinate_input_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_marker_coordinate_input_bottom_sheet_dialog.xml deleted file mode 100644 index 0043b20544..0000000000 --- a/OsmAnd/res/layout/fragment_marker_coordinate_input_bottom_sheet_dialog.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/layout/fragment_marker_coordinate_input_options_bottom_sheet_helper.xml b/OsmAnd/res/layout/fragment_marker_coordinate_input_options_bottom_sheet_helper.xml index 9a9d487f03..d093e40a06 100644 --- a/OsmAnd/res/layout/fragment_marker_coordinate_input_options_bottom_sheet_helper.xml +++ b/OsmAnd/res/layout/fragment_marker_coordinate_input_options_bottom_sheet_helper.xml @@ -1,120 +1,289 @@ + xmlns:osmand="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/bg_color" + android:orientation="vertical"> - + - + - + - + - + - + - - + + - + - + - + - + - + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/marker_coordinate_formats.xml b/OsmAnd/res/layout/marker_coordinate_formats.xml deleted file mode 100644 index f342c3d05a..0000000000 --- a/OsmAnd/res/layout/marker_coordinate_formats.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 1de6ffec87..aa968497b8 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,9 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Automatically switch to the next field after entering %1$d digits after the decimal point + %1$d digits + Go to next field can be imported as Favorites points, or as track file. Import as GPX file Import as Favorites diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputBottomSheetDialogFragment.java index 90b5639c14..67eb2b5024 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputBottomSheetDialogFragment.java @@ -33,10 +33,10 @@ public class CoordinateInputBottomSheetDialogFragment extends BottomSheetDialogF private boolean portrait; private View mainView; private boolean night; - private int coordinateFormat = -1; private boolean useOsmandKeyboard = true; + private boolean goToNextField; + private int accuracy = -1; private CoordinateInputFormatChangeListener listener; - private boolean shouldClose; public void setListener(CoordinateInputFormatChangeListener listener) { this.listener = listener; @@ -47,10 +47,9 @@ public class CoordinateInputBottomSheetDialogFragment extends BottomSheetDialogF super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { - coordinateFormat = args.getInt(CoordinateInputDialogFragment.COORDINATE_FORMAT); useOsmandKeyboard = args.getBoolean(CoordinateInputDialogFragment.USE_OSMAND_KEYBOARD); - } else { - shouldClose = true; + goToNextField = args.getBoolean(CoordinateInputDialogFragment.GO_TO_NEXT_FIELD); + accuracy = args.getInt(CoordinateInputDialogFragment.ACCURACY); } } @@ -62,8 +61,7 @@ public class CoordinateInputBottomSheetDialogFragment extends BottomSheetDialogF night = !mapActivity.getMyApplication().getSettings().isLightContent(); final int themeRes = night ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme; - mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), coordinateFormat == -1 ? - R.layout.fragment_marker_coordinate_input_bottom_sheet_dialog : R.layout.fragment_marker_coordinate_input_options_bottom_sheet_helper, container); + mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_marker_coordinate_input_options_bottom_sheet_helper, container); if (portrait) { AndroidUtils.setBackground(getActivity(), mainView, night, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); } @@ -72,93 +70,85 @@ public class CoordinateInputBottomSheetDialogFragment extends BottomSheetDialogF ((TextView) mainView.findViewById(R.id.coordinate_input_title)).setTextColor(getResources().getColor(R.color.ctx_menu_info_text_dark)); } - ImageView degreesIcon = (ImageView) mainView.findViewById(R.id.degrees_icon); - TextView degreesText = (TextView) mainView.findViewById(R.id.degrees_text); - if (coordinateFormat == PointDescription.FORMAT_DEGREES) { - degreesIcon.setImageDrawable(getIcon(R.drawable.ic_action_coordinates_latitude, R.color.dashboard_blue)); - degreesText.setTextColor(ContextCompat.getColor(mapActivity, R.color.dashboard_blue)); - ((RadioButton) mainView.findViewById(R.id.degrees_radio_button)).setChecked(true); - } else { - degreesIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_coordinates_latitude)); - } - degreesText.setText(PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_DEGREES)); + ((TextView) mainView.findViewById(R.id.coordinate_input_accuracy_descr)).setText(getString(R.string.coordinate_input_accuracy_description, accuracy)); - ImageView minutesIcon = (ImageView) mainView.findViewById(R.id.minutes_icon); - TextView minutesText = (TextView) mainView.findViewById(R.id.minutes_text); - if (coordinateFormat == PointDescription.FORMAT_MINUTES) { - minutesIcon.setImageDrawable(getIcon(R.drawable.ic_action_coordinates_latitude, R.color.dashboard_blue)); - minutesText.setTextColor(ContextCompat.getColor(mapActivity, R.color.dashboard_blue)); - ((RadioButton) mainView.findViewById(R.id.minutes_radio_button)).setChecked(true); - } else { - minutesIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_coordinates_latitude)); - } - minutesText.setText(PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_MINUTES)); - - ImageView secondsIcon = (ImageView) mainView.findViewById(R.id.seconds_icon); - TextView secondsText = (TextView) mainView.findViewById(R.id.seconds_text); - if (coordinateFormat == PointDescription.FORMAT_SECONDS) { - secondsIcon.setImageDrawable(getIcon(R.drawable.ic_action_coordinates_latitude, R.color.dashboard_blue)); - secondsText.setTextColor(ContextCompat.getColor(mapActivity, R.color.dashboard_blue)); - ((RadioButton) mainView.findViewById(R.id.seconds_radio_button)).setChecked(true); - } else { - secondsIcon.setImageDrawable(getContentIcon(R.drawable.ic_action_coordinates_latitude)); - } - secondsText.setText(PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_SECONDS)); - - if (coordinateFormat != -1) { - ((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard); - ((ImageView) mainView.findViewById(R.id.use_system_keyboard_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_keyboard)); - mainView.findViewById(R.id.use_system_keyboard_row).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - useOsmandKeyboard = !useOsmandKeyboard; - ((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard); - if (listener != null) { - listener.onKeyboardChanged(useOsmandKeyboard); - } + ((CompoundButton) mainView.findViewById(R.id.go_to_next_field_switch)).setChecked(goToNextField); + ((ImageView) mainView.findViewById(R.id.go_to_next_field_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_keyboard)); + mainView.findViewById(R.id.go_to_next_field_row).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + goToNextField = !goToNextField; + ((CompoundButton) mainView.findViewById(R.id.go_to_next_field_switch)).setChecked(goToNextField); + if (listener != null) { + listener.onGoToNextFieldChanged(goToNextField); } - }); - highlightSelectedItem(true); - } + } + }); - View.OnClickListener formatChangeListener = new View.OnClickListener() { + if (accuracy == 4) { + ((RadioButton) mainView.findViewById(R.id.four_digits_radio_button)).setChecked(true); + } + ((TextView) mainView.findViewById(R.id.four_digits_title)).setText(getString(R.string.coordinate_input_accuracy, 4)); + ((TextView) mainView.findViewById(R.id.four_digits_description)).setText("00:00." + "5555"); + + if (accuracy == 3) { + ((RadioButton) mainView.findViewById(R.id.three_digits_radio_button)).setChecked(true); + } + ((TextView) mainView.findViewById(R.id.three_digits_title)).setText(getString(R.string.coordinate_input_accuracy, 3)); + ((TextView) mainView.findViewById(R.id.three_digits_description)).setText("00:00." + "555"); + + if (accuracy == 2) { + ((RadioButton) mainView.findViewById(R.id.two_digits_radio_button)).setChecked(true); + } + ((TextView) mainView.findViewById(R.id.two_digits_title)).setText(getString(R.string.coordinate_input_accuracy, 2)); + ((TextView) mainView.findViewById(R.id.two_digits_description)).setText("00:00." + "55"); + + ((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard); + ((ImageView) mainView.findViewById(R.id.use_system_keyboard_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_keyboard)); + mainView.findViewById(R.id.use_system_keyboard_row).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + useOsmandKeyboard = !useOsmandKeyboard; + ((CompoundButton) mainView.findViewById(R.id.use_system_keyboard_switch)).setChecked(!useOsmandKeyboard); + if (listener != null) { + listener.onKeyboardChanged(useOsmandKeyboard); + } + } + }); + highlightSelectedItem(true); + + View.OnClickListener accuracyChangedListener = new View.OnClickListener() { @Override public void onClick(View view) { highlightSelectedItem(false); switch (view.getId()) { - case R.id.degrees_row: - coordinateFormat = PointDescription.FORMAT_DEGREES; + case R.id.four_digits_row: + accuracy = 4; break; - case R.id.minutes_row: - coordinateFormat = PointDescription.FORMAT_MINUTES; + case R.id.three_digits_row: + accuracy = 3; break; - case R.id.seconds_row: - coordinateFormat = PointDescription.FORMAT_SECONDS; + case R.id.two_digits_row: + accuracy = 2; break; default: - throw new IllegalArgumentException("Unsupported format"); + throw new IllegalArgumentException("Unsupported accuracy"); } highlightSelectedItem(true); if (listener != null) { - listener.onCoordinateFormatChanged(coordinateFormat); - } - if (shouldClose) { - dismiss(); + listener.onAccuracyChanged(accuracy); } } }; - mainView.findViewById(R.id.degrees_row).setOnClickListener(formatChangeListener); - mainView.findViewById(R.id.minutes_row).setOnClickListener(formatChangeListener); - mainView.findViewById(R.id.seconds_row).setOnClickListener(formatChangeListener); + mainView.findViewById(R.id.four_digits_row).setOnClickListener(accuracyChangedListener); + mainView.findViewById(R.id.three_digits_row).setOnClickListener(accuracyChangedListener); + mainView.findViewById(R.id.two_digits_row).setOnClickListener(accuracyChangedListener); mainView.findViewById(R.id.cancel_row).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dismiss(); - if (shouldClose && listener != null) { - listener.onCancel(); - } } }); @@ -215,48 +205,32 @@ public class CoordinateInputBottomSheetDialogFragment extends BottomSheetDialogF } } - @Override - public void onCancel(DialogInterface dialog) { - super.onCancel(dialog); - if (shouldClose && listener != null) { - listener.onCancel(); - } - } - @Override protected Drawable getContentIcon(@DrawableRes int id) { return getIcon(id, night ? R.color.ctx_menu_info_text_dark : R.color.on_map_icon_color); } private void highlightSelectedItem(boolean check) { - int iconColor = check ? R.color.dashboard_blue : night ? R.color.ctx_menu_info_text_dark : R.color.on_map_icon_color; - int textColor = ContextCompat.getColor(getContext(), check ? (night ? R.color.color_dialog_buttons_dark : R.color.dashboard_blue) : night ? R.color.color_white : R.color.color_black); - switch (coordinateFormat) { - case PointDescription.FORMAT_DEGREES: - ((TextView) mainView.findViewById(R.id.degrees_text)).setTextColor(textColor); - ((ImageView) mainView.findViewById(R.id.degrees_icon)).setImageDrawable((getIcon(R.drawable.ic_action_coordinates_latitude, iconColor))); - ((RadioButton) mainView.findViewById(R.id.degrees_radio_button)).setChecked(check); + switch (accuracy) { + case 4: + ((RadioButton) mainView.findViewById(R.id.four_digits_radio_button)).setChecked(check); break; - case PointDescription.FORMAT_MINUTES: - ((TextView) mainView.findViewById(R.id.minutes_text)).setTextColor(textColor); - ((ImageView) mainView.findViewById(R.id.minutes_icon)).setImageDrawable((getIcon(R.drawable.ic_action_coordinates_latitude, iconColor))); - ((RadioButton) mainView.findViewById(R.id.minutes_radio_button)).setChecked(check); + case 3: + ((RadioButton) mainView.findViewById(R.id.three_digits_radio_button)).setChecked(check); break; - case PointDescription.FORMAT_SECONDS: - ((TextView) mainView.findViewById(R.id.seconds_text)).setTextColor(textColor); - ((ImageView) mainView.findViewById(R.id.seconds_icon)).setImageDrawable((getIcon(R.drawable.ic_action_coordinates_latitude, iconColor))); - ((RadioButton) mainView.findViewById(R.id.seconds_radio_button)).setChecked(check); + case 2: + ((RadioButton) mainView.findViewById(R.id.two_digits_radio_button)).setChecked(check); break; } } interface CoordinateInputFormatChangeListener { - void onCoordinateFormatChanged(int format); - void onKeyboardChanged(boolean useOsmandKeyboard); - void onCancel(); + void onGoToNextFieldChanged(boolean goToNextField); + + void onAccuracyChanged(int accuracy); } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index ee424a04e6..e92390e2af 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -16,7 +16,6 @@ import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.PopupMenu; import android.support.v7.widget.RecyclerView; import android.text.Editable; -import android.text.InputFilter; import android.text.InputType; import android.text.TextWatcher; import android.util.TypedValue; @@ -69,17 +68,12 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm public static final String TAG = "CoordinateInputDialogFragment"; - public static final String COORDINATE_FORMAT = "coordinate_format"; public static final String USE_OSMAND_KEYBOARD = "use_osmand_keyboard"; + public static final String GO_TO_NEXT_FIELD = "go_to_next_field"; + public static final String ACCURACY = "accuracy"; private static final int CLEAR_BUTTON_POSITION = 9; private static final int DELETE_BUTTON_POSITION = 11; - private static final int DEGREES_MAX_LENGTH = 6; - private static final int MINUTES_MAX_LENGTH = 9; - private static final int SECONDS_MAX_LENGTH = 12; - private static final String DEGREES_HINT = "50.000"; - private static final String MINUTES_HINT = "50:00.000"; - private static final String SECONDS_HINT = "50:00:00.000"; private static final String LATITUDE_LABEL = "latitude"; private static final String LONGITUDE_LABEL = "longitude"; private static final String NAME_LABEL = "name"; @@ -89,7 +83,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm private CoordinateInputAdapter adapter; private boolean lightTheme; private boolean useOsmandKeyboard = true; - private int coordinateFormat = -1; + private boolean goToNextField; + private int accuracy = 4; private List textFieldBoxes; private List inputEditTexts; private View mainView; @@ -112,10 +107,6 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm lightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME; int themeId = lightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme; setStyle(STYLE_NO_FRAME, themeId); - - CoordinateInputBottomSheetDialogFragment fragment = new CoordinateInputBottomSheetDialogFragment(); - fragment.setListener(createCoordinateInputFormatChangeListener()); - fragment.show(getMapActivity().getSupportFragmentManager(), CoordinateInputBottomSheetDialogFragment.TAG); } @NonNull @@ -172,8 +163,9 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm } CoordinateInputBottomSheetDialogFragment fragment = new CoordinateInputBottomSheetDialogFragment(); Bundle args = new Bundle(); - args.putInt(COORDINATE_FORMAT, coordinateFormat); args.putBoolean(USE_OSMAND_KEYBOARD, useOsmandKeyboard); + args.putBoolean(GO_TO_NEXT_FIELD, goToNextField); + args.putInt(ACCURACY, accuracy); fragment.setArguments(args); fragment.setListener(createCoordinateInputFormatChangeListener()); fragment.show(getMapActivity().getSupportFragmentManager(), CoordinateInputBottomSheetDialogFragment.TAG); @@ -215,10 +207,6 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm if (savedInstanceState == null) { latitudeBox.select(); - } else { - changeInputEditTextHints(); - changeInputEditTextsLengths(); - changeKeyboardInEditTexts(); } final View mapMarkersLayout = mainView.findViewById(R.id.map_markers_layout); @@ -382,42 +370,6 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm if (focusedView != null && focusedView instanceof EditText) { EditText focusedEditText = (EditText) focusedView; String str = focusedEditText.getText().toString(); - int strLength = str.length(); - if (len < strLength) { - String strAfterChanging = str.substring(len); - String strDivider = null; - if (strLength == 3) { - if (coordinateFormat == PointDescription.FORMAT_DEGREES) { - strDivider = "."; - } else { - strDivider = ":"; - } - } else if (strLength == 6 && coordinateFormat != PointDescription.FORMAT_DEGREES) { - if (coordinateFormat == PointDescription.FORMAT_MINUTES) { - strDivider = "."; - } else { - strDivider = ":"; - } - } else if (strLength == 9 && coordinateFormat == PointDescription.FORMAT_SECONDS) { - strDivider = "."; - } - if (strDivider != null) { - String textToSet = strBeforeChanging + strDivider + strAfterChanging; - focusedEditText.setText(textToSet); - focusedEditText.setSelection(textToSet.length()); - } - } else if (len > strLength) { - if (strLength > 0 && (".:").contains(str.substring(strLength - 1))) { - focusedEditText.setText(str.substring(0, str.length() - 1)); - } - focusedEditText.setSelection(focusedEditText.getText().length()); - } - - if ((strLength == DEGREES_MAX_LENGTH && coordinateFormat == PointDescription.FORMAT_DEGREES) - || (strLength == MINUTES_MAX_LENGTH && coordinateFormat == PointDescription.FORMAT_MINUTES) - || (strLength == SECONDS_MAX_LENGTH && coordinateFormat == PointDescription.FORMAT_SECONDS)) { - switchToNextInput(focusedEditText.getId()); - } } } }; @@ -429,13 +381,16 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm if (orientationPortrait && !isOsmandKeyboardCurrentlyVisible()) { changeOsmandKeyboardVisibility(true); } - AndroidUtils.hideSoftKeyboard(getActivity(), view); - return false; + EditText editText = (EditText) view; + int inType = editText.getInputType(); // Backup the input type + editText.setInputType(InputType.TYPE_NULL); // Disable standard keyboard + editText.onTouchEvent(motionEvent); // Call native handler + editText.setInputType(inType); // Restore input type + return true; // Consume touch event } else { if (isOsmandKeyboardCurrentlyVisible()) { changeOsmandKeyboardVisibility(false); } - AndroidUtils.showSoftKeyboard(view); return false; } } @@ -554,17 +509,14 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm textView.setOnFocusChangeListener(focusChangeListener); textView.setOnEditorActionListener(inputTextViewOnEditorActionListener); } + + changeInputEditTextHints(); + changeInputEditTextLengths(); + changeKeyboardInEditTexts(); } private CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener createCoordinateInputFormatChangeListener() { return new CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener() { - @Override - public void onCoordinateFormatChanged(int format) { - coordinateFormat = format; - changeInputEditTextHints(); - changeInputEditTextsLengths(); - } - @Override public void onKeyboardChanged(boolean useOsmandKeyboard) { CoordinateInputDialogFragment.this.useOsmandKeyboard = useOsmandKeyboard; @@ -576,8 +528,15 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm } @Override - public void onCancel() { - dismiss(); + public void onGoToNextFieldChanged(boolean goToNextField) { + CoordinateInputDialogFragment.this.goToNextField = goToNextField; + } + + @Override + public void onAccuracyChanged(int accuracy) { + CoordinateInputDialogFragment.this.accuracy = accuracy; + changeInputEditTextHints(); + changeInputEditTextLengths(); } }; } @@ -608,37 +567,37 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm // } } - private void changeInputEditTextsLengths() { - int maxLength; - if (coordinateFormat == PointDescription.FORMAT_DEGREES) { - maxLength = DEGREES_MAX_LENGTH; - } else if (coordinateFormat == PointDescription.FORMAT_MINUTES) { - maxLength = MINUTES_MAX_LENGTH; - } else { - maxLength = SECONDS_MAX_LENGTH; - } - InputFilter[] filtersArray = new InputFilter[] {new InputFilter.LengthFilter(maxLength)}; - for (EditText editText : inputEditTexts) { - if (editText.getId() != R.id.name_edit_text) { - editText.setFilters(filtersArray); - } - } + private void changeInputEditTextLengths() { +// int maxLength; +// if (accuracy == PointDescription.FORMAT_DEGREES) { +// maxLength = DEGREES_MAX_LENGTH; +// } else if (accuracy == PointDescription.FORMAT_MINUTES) { +// maxLength = MINUTES_MAX_LENGTH; +// } else { +// maxLength = SECONDS_MAX_LENGTH; +// } +// InputFilter[] filtersArray = new InputFilter[] {new InputFilter.LengthFilter(maxLength)}; +// for (EditText editText : inputEditTexts) { +// if (editText.getId() != R.id.name_edit_text) { +// editText.setFilters(filtersArray); +// } +// } } private void changeInputEditTextHints() { - String hint; - if (coordinateFormat == PointDescription.FORMAT_DEGREES) { - hint = DEGREES_HINT; - } else if (coordinateFormat == PointDescription.FORMAT_MINUTES) { - hint = MINUTES_HINT; - } else { - hint = SECONDS_HINT; - } - for (EditText editText : inputEditTexts) { - if (editText.getId() != R.id.name_edit_text) { - editText.setHint(hint); - } - } +// String hint; +// if (accuracy == PointDescription.FORMAT_DEGREES) { +// hint = DEGREES_HINT; +// } else if (accuracy == PointDescription.FORMAT_MINUTES) { +// hint = MINUTES_HINT; +// } else { +// hint = SECONDS_HINT; +// } +// for (EditText editText : inputEditTexts) { +// if (editText.getId() != R.id.name_edit_text) { +// editText.setHint(hint); +// } +// } } private void switchToNextInput(int id) {