From 6e5d5b84175c2ef8e3d68781abe5456678a94e37 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sun, 26 Mar 2017 10:45:58 +0300 Subject: [PATCH] Added coordinate search to address tab --- .../osmand/plus/search/QuickSearchCoordinatesFragment.java | 7 ++++++- .../net/osmand/plus/search/QuickSearchDialogFragment.java | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java index 11decf28d0..a22285e245 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java @@ -381,13 +381,18 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os private void showOnMap() { if (currentLatLon != null) { - ((QuickSearchDialogFragment)getParentFragment()).dismiss(); + QuickSearchDialogFragment dialogFragment = (QuickSearchDialogFragment) getParentFragment(); + dialogFragment.hideToolbar(); + dialogFragment.hide(); + PointDescription pointDescription = new PointDescription(currentLatLon.getLatitude(), currentLatLon.getLongitude()); getMyApplication().getSettings().setMapLocationToShow( currentLatLon.getLatitude(), currentLatLon.getLongitude(), 15, pointDescription, true, currentLatLon); MapActivity.launchMapActivityMoveToTop(getActivity()); + + dismiss(); } } diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java index 5c483b733a..1fe5d1bf80 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchDialogFragment.java @@ -1089,6 +1089,13 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC AndroidUtils.softKeyboardDelayed(searchEditText); } })); + rows.add(new QuickSearchButtonListItem(app, R.drawable.ic_action_marker_dark, + app.getString(R.string.coords_search), new OnClickListener() { + @Override + public void onClick(View v) { + QuickSearchCoordinatesFragment.showDialog(QuickSearchDialogFragment.this, ""); + } + })); if (res != null) { rows.add(new QuickSearchHeaderListItem(app, app.getString(R.string.nearest_cities), true));