Added coordinate search to address tab

This commit is contained in:
Alexey Kulish 2017-03-26 10:45:58 +03:00
parent 78e254a457
commit 6e5d5b8417
2 changed files with 13 additions and 1 deletions

View file

@ -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();
}
}

View file

@ -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));