Fix #3626
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
@ -97,6 +97,8 @@ import net.osmand.plus.routing.RoutingHelper;
|
|||
import net.osmand.plus.routing.RoutingHelper.IRouteInformationListener;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteCalculationProgressCallback;
|
||||
import net.osmand.plus.search.QuickSearchDialogFragment;
|
||||
import net.osmand.plus.search.QuickSearchDialogFragment.QuickSearchTab;
|
||||
import net.osmand.plus.search.QuickSearchDialogFragment.QuickSearchType;
|
||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.MapControlsLayer;
|
||||
import net.osmand.plus.views.MapInfoLayer;
|
||||
|
@ -1230,10 +1232,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
}
|
||||
}
|
||||
OsmandPlugin.onMapActivityResult(requestCode, resultCode, data);
|
||||
MapControlsLayer mcl = mapView.getLayerByClass(MapControlsLayer.class);
|
||||
if (mcl != null) {
|
||||
mcl.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshMap() {
|
||||
|
@ -1475,7 +1473,8 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
fragment.dismiss();
|
||||
refreshMap();
|
||||
}
|
||||
QuickSearchDialogFragment.showInstance(this, "", null, true, new LatLon(latitude, longitude));
|
||||
QuickSearchDialogFragment.showInstance(this, "", null,
|
||||
QuickSearchType.REGULAR, QuickSearchTab.CATEGORIES, new LatLon(latitude, longitude));
|
||||
}
|
||||
|
||||
public void showQuickSearch(Object object) {
|
||||
|
@ -1485,22 +1484,37 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
fragment.dismiss();
|
||||
refreshMap();
|
||||
}
|
||||
QuickSearchDialogFragment.showInstance(this, "", object, true, null);
|
||||
QuickSearchDialogFragment.showInstance(this, "", object,
|
||||
QuickSearchType.REGULAR, QuickSearchTab.CATEGORIES, null);
|
||||
}
|
||||
|
||||
public void showQuickSearch(ShowQuickSearchMode mode, boolean showCategories) {
|
||||
hideContextMenu();
|
||||
QuickSearchDialogFragment fragment = getQuickSearchDialogFragment();
|
||||
if (fragment != null) {
|
||||
if (mode == ShowQuickSearchMode.NEW || (mode == ShowQuickSearchMode.NEW_IF_EXPIRED && fragment.isExpired())) {
|
||||
if (mode == ShowQuickSearchMode.START_POINT_SELECTION || mode == ShowQuickSearchMode.DESTINATION_SELECTION) {
|
||||
if (fragment != null) {
|
||||
fragment.dismiss();
|
||||
QuickSearchDialogFragment.showInstance(this, "", null, showCategories, null);
|
||||
}
|
||||
if (mode == ShowQuickSearchMode.START_POINT_SELECTION) {
|
||||
QuickSearchDialogFragment.showInstance(this, "", null,
|
||||
QuickSearchType.START_POINT, showCategories ? QuickSearchTab.CATEGORIES : QuickSearchTab.ADDRESS, null);
|
||||
} else {
|
||||
QuickSearchDialogFragment.showInstance(this, "", null,
|
||||
QuickSearchType.DESTINATION, showCategories ? QuickSearchTab.CATEGORIES : QuickSearchTab.ADDRESS, null);
|
||||
}
|
||||
} else if (fragment != null) {
|
||||
if (mode == ShowQuickSearchMode.NEW
|
||||
|| (mode == ShowQuickSearchMode.NEW_IF_EXPIRED && fragment.isExpired())) {
|
||||
fragment.dismiss();
|
||||
QuickSearchDialogFragment.showInstance(this, "", null,
|
||||
QuickSearchType.REGULAR, showCategories ? QuickSearchTab.CATEGORIES : QuickSearchTab.HISTORY, null);
|
||||
} else {
|
||||
fragment.show();
|
||||
}
|
||||
refreshMap();
|
||||
} else {
|
||||
QuickSearchDialogFragment.showInstance(this, "", null, showCategories, null);
|
||||
QuickSearchDialogFragment.showInstance(this, "", null,
|
||||
QuickSearchType.REGULAR, showCategories ? QuickSearchTab.CATEGORIES : QuickSearchTab.HISTORY, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1557,6 +1571,8 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
NEW,
|
||||
NEW_IF_EXPIRED,
|
||||
CURRENT,
|
||||
START_POINT_SELECTION,
|
||||
DESTINATION_SELECTION,
|
||||
}
|
||||
|
||||
public InAppHelper execInAppTask(@NonNull InAppHelper.InAppRunnable runnable) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import android.app.Dialog;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnDismissListener;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.app.Fragment;
|
||||
|
@ -41,7 +40,6 @@ import net.osmand.plus.activities.FavoritesListFragment.FavouritesAdapter;
|
|||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.ShowRouteInfoDialogFragment;
|
||||
import net.osmand.plus.activities.actions.AppModeDialog;
|
||||
import net.osmand.plus.activities.search.SearchAddressActivity;
|
||||
import net.osmand.plus.dialogs.FavoriteDialogs;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.helpers.MapMarkerDialogHelper;
|
||||
|
@ -306,10 +304,8 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
|||
} else if (id == SPINNER_MAP_ID) {
|
||||
selectOnScreen(true);
|
||||
} else if (id == SPINNER_ADDRESS_ID) {
|
||||
Intent intent = new Intent(mapActivity, SearchAddressActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
intent.putExtra(TARGET_SELECT, true);
|
||||
mapActivity.startActivityForResult(intent, MapControlsLayer.REQUEST_ADDRESS_SELECT);
|
||||
mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.DESTINATION_SELECTION, false);
|
||||
setupToSpinner(parentView);
|
||||
} else if (id == SPINNER_MAP_MARKER_MORE_ID) {
|
||||
selectMapMarker(-1, true);
|
||||
setupToSpinner(parentView);
|
||||
|
@ -378,10 +374,8 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
|||
} else if (id == SPINNER_MAP_ID) {
|
||||
selectOnScreen(false);
|
||||
} else if (id == SPINNER_ADDRESS_ID) {
|
||||
Intent intent = new Intent(mapActivity, SearchAddressActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
intent.putExtra(TARGET_SELECT, false);
|
||||
mapActivity.startActivityForResult(intent, MapControlsLayer.REQUEST_ADDRESS_SELECT);
|
||||
mapActivity.showQuickSearch(MapActivity.ShowQuickSearchMode.START_POINT_SELECTION, false);
|
||||
setupFromSpinner(parentView);
|
||||
} else if (id == SPINNER_MAP_MARKER_MORE_ID) {
|
||||
selectMapMarker(-1, false);
|
||||
setupFromSpinner(parentView);
|
||||
|
|
|
@ -110,7 +110,6 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
private static final String QUICK_SEARCH_LAT_KEY = "quick_search_lat_key";
|
||||
private static final String QUICK_SEARCH_LON_KEY = "quick_search_lon_key";
|
||||
private static final String QUICK_SEARCH_INTERRUPTED_SEARCH_KEY = "quick_search_interrupted_search_key";
|
||||
private static final String QUICK_SEARCH_SHOW_CATEGORIES_KEY = "quick_search_show_categories_key";
|
||||
private static final String QUICK_SEARCH_HIDDEN_KEY = "quick_search_hidden_key";
|
||||
private static final String QUICK_SEARCH_TOOLBAR_TITLE_KEY = "quick_search_toolbar_title_key";
|
||||
private static final String QUICK_SEARCH_TOOLBAR_VISIBLE_KEY = "quick_search_toolbar_visible_key";
|
||||
|
@ -119,6 +118,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
private static final String QUICK_SEARCH_RUN_SEARCH_FIRST_TIME_KEY = "quick_search_run_search_first_time_key";
|
||||
private static final String QUICK_SEARCH_PHRASE_DEFINED_KEY = "quick_search_phrase_defined_key";
|
||||
|
||||
private static final String QUICK_SEARCH_SHOW_TAB_KEY = "quick_search_show_tab_key";
|
||||
private static final String QUICK_SEARCH_TYPE_KEY = "quick_search_type_key";
|
||||
|
||||
private Toolbar toolbar;
|
||||
private LockableViewPager viewPager;
|
||||
private SearchFragmentPagerAdapter pagerAdapter;
|
||||
|
@ -176,9 +178,22 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
private boolean citiesLoaded;
|
||||
private LatLon storedOriginalLocation;
|
||||
|
||||
private QuickSearchType searchType = QuickSearchType.REGULAR;
|
||||
|
||||
private static final double DISTANCE_THRESHOLD = 70000; // 70km
|
||||
private static final int EXPIRATION_TIME_MIN = 10; // 10 minutes
|
||||
|
||||
public enum QuickSearchTab {
|
||||
HISTORY,
|
||||
CATEGORIES,
|
||||
ADDRESS,
|
||||
}
|
||||
|
||||
public enum QuickSearchType {
|
||||
REGULAR,
|
||||
START_POINT,
|
||||
DESTINATION,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -220,6 +235,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
|
||||
Bundle arguments = getArguments();
|
||||
if (savedInstanceState != null) {
|
||||
searchType = QuickSearchType.valueOf(savedInstanceState.getString(QUICK_SEARCH_TYPE_KEY, QuickSearchType.REGULAR.name()));
|
||||
searchQuery = savedInstanceState.getString(QUICK_SEARCH_QUERY_KEY);
|
||||
double lat = savedInstanceState.getDouble(QUICK_SEARCH_LAT_KEY, Double.NaN);
|
||||
double lon = savedInstanceState.getDouble(QUICK_SEARCH_LON_KEY, Double.NaN);
|
||||
|
@ -233,6 +249,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
fabVisible = savedInstanceState.getBoolean(QUICK_SEARCH_FAB_VISIBLE_KEY, false);
|
||||
}
|
||||
if (searchQuery == null && arguments != null) {
|
||||
searchType = QuickSearchType.valueOf(arguments.getString(QUICK_SEARCH_TYPE_KEY, QuickSearchType.REGULAR.name()));
|
||||
searchQuery = arguments.getString(QUICK_SEARCH_QUERY_KEY);
|
||||
runSearchFirstTime = arguments.getBoolean(QUICK_SEARCH_RUN_SEARCH_FIRST_TIME_KEY, false);
|
||||
phraseDefined = arguments.getBoolean(QUICK_SEARCH_PHRASE_DEFINED_KEY, false);
|
||||
|
@ -246,9 +263,12 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
if (searchQuery == null)
|
||||
searchQuery = "";
|
||||
|
||||
boolean showCategories = false;
|
||||
QuickSearchTab showSearchTab = QuickSearchTab.HISTORY;
|
||||
if (arguments != null) {
|
||||
showCategories = arguments.getBoolean(QUICK_SEARCH_SHOW_CATEGORIES_KEY, false);
|
||||
showSearchTab = QuickSearchTab.valueOf(arguments.getString(QUICK_SEARCH_SHOW_TAB_KEY, QuickSearchTab.HISTORY.name()));
|
||||
}
|
||||
if (showSearchTab == QuickSearchTab.ADDRESS) {
|
||||
addressSearch = true;
|
||||
}
|
||||
|
||||
tabToolbarView = view.findViewById(R.id.tab_toolbar_layout);
|
||||
|
@ -462,8 +482,16 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
viewPager.setOffscreenPageLimit(2);
|
||||
pagerAdapter = new SearchFragmentPagerAdapter(getChildFragmentManager(), getResources());
|
||||
viewPager.setAdapter(pagerAdapter);
|
||||
if (centerLatLon != null || showCategories) {
|
||||
viewPager.setCurrentItem(1);
|
||||
switch (showSearchTab) {
|
||||
case HISTORY:
|
||||
viewPager.setCurrentItem(0);
|
||||
break;
|
||||
case CATEGORIES:
|
||||
viewPager.setCurrentItem(1);
|
||||
break;
|
||||
case ADDRESS:
|
||||
viewPager.setCurrentItem(2);
|
||||
break;
|
||||
}
|
||||
|
||||
tabLayout = (TabLayout) view.findViewById(R.id.tab_layout);
|
||||
|
@ -677,6 +705,10 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
getMapActivity().hideTopToolbar(toolbarController);
|
||||
}
|
||||
|
||||
public QuickSearchType getSearchType() {
|
||||
return searchType;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return searchEditText.getText().toString();
|
||||
}
|
||||
|
@ -838,6 +870,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
outState.putString(QUICK_SEARCH_TYPE_KEY, searchType.name());
|
||||
outState.putString(QUICK_SEARCH_QUERY_KEY, searchQuery);
|
||||
outState.putBoolean(QUICK_SEARCH_INTERRUPTED_SEARCH_KEY, interruptedSearch = searching);
|
||||
outState.putBoolean(QUICK_SEARCH_HIDDEN_KEY, hidden);
|
||||
|
@ -985,6 +1018,9 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
|
||||
case ADDRESS:
|
||||
addressSearchFragment = (QuickSearchAddressListFragment) searchListFragment;
|
||||
if (addressSearch && !citiesLoaded) {
|
||||
reloadCities();
|
||||
}
|
||||
break;
|
||||
|
||||
case MAIN:
|
||||
|
@ -1672,7 +1708,8 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
public static boolean showInstance(@NonNull MapActivity mapActivity,
|
||||
@NonNull String searchQuery,
|
||||
@Nullable Object object,
|
||||
boolean showCategories,
|
||||
QuickSearchType searchType,
|
||||
QuickSearchTab showSearchTab,
|
||||
@Nullable LatLon latLon) {
|
||||
try {
|
||||
|
||||
|
@ -1710,7 +1747,8 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
|
|||
}
|
||||
|
||||
bundle.putString(QUICK_SEARCH_QUERY_KEY, searchQuery);
|
||||
bundle.putBoolean(QUICK_SEARCH_SHOW_CATEGORIES_KEY, showCategories);
|
||||
bundle.putString(QUICK_SEARCH_SHOW_TAB_KEY, showSearchTab.name());
|
||||
bundle.putString(QUICK_SEARCH_TYPE_KEY, searchType.name());
|
||||
if (latLon != null) {
|
||||
bundle.putDouble(QUICK_SEARCH_LAT_KEY, latLon.getLatitude());
|
||||
bundle.putDouble(QUICK_SEARCH_LON_KEY, latLon.getLongitude());
|
||||
|
|
|
@ -80,10 +80,6 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
}
|
||||
}
|
||||
});
|
||||
//View header = getLayoutInflater(savedInstanceState).inflate(R.layout.list_shadow_header, null);
|
||||
//View footer = getLayoutInflater(savedInstanceState).inflate(R.layout.list_shadow_footer, null);
|
||||
//listView.addHeaderView(header, null, false);
|
||||
//listView.addFooterView(footer, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +104,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
|| sr.objectType == ObjectType.WPT
|
||||
|| sr.objectType == ObjectType.STREET_INTERSECTION) {
|
||||
|
||||
showOnMap(sr);
|
||||
showResult(sr);
|
||||
} else {
|
||||
dialogFragment.completeQueryWithObject(item.getSearchResult());
|
||||
}
|
||||
|
@ -169,7 +165,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
dialogFragment.onSearchListFragmentResume(this);
|
||||
}
|
||||
|
||||
private void showOnMap(SearchResult searchResult) {
|
||||
private void showResult(SearchResult searchResult) {
|
||||
if (searchResult.location != null) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
String lang = searchResult.requiredSearchPhrase.getSettings().getLang();
|
||||
|
@ -249,12 +245,37 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
dialogFragment.hideToolbar();
|
||||
dialogFragment.hide();
|
||||
|
||||
getMyApplication().getSettings().setMapLocationToShow(
|
||||
searchResult.location.getLatitude(), searchResult.location.getLongitude(),
|
||||
searchResult.preferredZoom, pointDescription, true, object);
|
||||
switch (dialogFragment.getSearchType()) {
|
||||
case REGULAR: {
|
||||
getMyApplication().getSettings().setMapLocationToShow(
|
||||
searchResult.location.getLatitude(), searchResult.location.getLongitude(),
|
||||
searchResult.preferredZoom, pointDescription, true, object);
|
||||
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
dialogFragment.reloadHistory();
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
dialogFragment.reloadHistory();
|
||||
break;
|
||||
}
|
||||
case START_POINT: {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getMapLayers().getMapControlsLayer().selectAddress(
|
||||
pointDescription != null ? pointDescription.getName() : null,
|
||||
searchResult.location.getLatitude(), searchResult.location.getLongitude(),
|
||||
false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DESTINATION: {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getMapLayers().getMapControlsLayer().selectAddress(
|
||||
pointDescription != null ? pointDescription.getName() : null,
|
||||
searchResult.location.getLatitude(), searchResult.location.getLongitude(),
|
||||
true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package net.osmand.plus.views;
|
|||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
|
@ -43,7 +42,6 @@ import net.osmand.plus.TargetPointsHelper;
|
|||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.MapActivity.ShowQuickSearchMode;
|
||||
import net.osmand.plus.activities.search.SearchAddressFragment;
|
||||
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
|
||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
||||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
|
@ -60,7 +58,6 @@ import gnu.trove.list.array.TIntArrayList;
|
|||
public class MapControlsLayer extends OsmandMapLayer {
|
||||
|
||||
private static final int TIMEOUT_TO_SHOW_BUTTONS = 7000;
|
||||
public static final int REQUEST_ADDRESS_SELECT = 2;
|
||||
private static final int REQUEST_LOCATION_FOR_NAVIGATION_PERMISSION = 200;
|
||||
private static final int REQUEST_LOCATION_FOR_NAVIGATION_FAB_PERMISSION = 201;
|
||||
private static final int REQUEST_LOCATION_FOR_ADD_DESTINATION_PERMISSION = 202;
|
||||
|
@ -1173,18 +1170,11 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
};
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == REQUEST_ADDRESS_SELECT && resultCode == SearchAddressFragment.SELECT_ADDRESS_POINT_RESULT_OK) {
|
||||
String name = data.getStringExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_INTENT_KEY);
|
||||
boolean target = data.getBooleanExtra(MapRouteInfoMenu.TARGET_SELECT, true);
|
||||
LatLon latLon = new LatLon(
|
||||
data.getDoubleExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_LAT, 0),
|
||||
data.getDoubleExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_LON, 0));
|
||||
if (name != null) {
|
||||
mapRouteInfoMenu.selectAddress(name, latLon, target);
|
||||
} else {
|
||||
mapRouteInfoMenu.selectAddress("", latLon, target);
|
||||
}
|
||||
public void selectAddress(String name, double latitude, double longitude, boolean target) {
|
||||
if (name != null) {
|
||||
mapRouteInfoMenu.selectAddress(name, new LatLon(latitude, longitude), target);
|
||||
} else {
|
||||
mapRouteInfoMenu.selectAddress("", new LatLon(latitude, longitude), target);
|
||||
}
|
||||
}
|
||||
|
||||
|
|