From 21494f20e1661a8dc5843db13b0378b756befd7c Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Fri, 3 Nov 2017 18:48:01 +0200 Subject: [PATCH] Change default keyboard by tapping on icon --- .../CoordinateInputDialogFragment.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index e9413fcf2d..fff4b371d2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -196,9 +196,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm public void onClick(View view) { View focusedView = getDialog().getCurrentFocus(); if (focusedView != null) { - if (isOsmandKeyboardCurrentlyVisible()) { - changeOsmandKeyboardVisibility(false); - } + useOsmandKeyboard = false; + changeKeyboard(); AndroidUtils.showSoftKeyboard(focusedView); } } @@ -570,17 +569,21 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm changeEditTextSelections(); } + private void changeKeyboard() { + if (orientationPortrait && !useOsmandKeyboard && isOsmandKeyboardCurrentlyVisible()) { + changeOsmandKeyboardVisibility(false); + } + changeKeyboardInBoxes(); + changeKeyboardInEditTexts(); + changeEditTextSelections(); + } + private CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener createCoordinateInputFormatChangeListener() { return new CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener() { @Override public void onKeyboardChanged(boolean useOsmandKeyboard) { CoordinateInputDialogFragment.this.useOsmandKeyboard = useOsmandKeyboard; - if (orientationPortrait && !useOsmandKeyboard && isOsmandKeyboardCurrentlyVisible()) { - changeOsmandKeyboardVisibility(false); - } - changeKeyboardInBoxes(); - changeKeyboardInEditTexts(); - changeEditTextSelections(); + changeKeyboard(); } @Override