Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a161cf8b78
3 changed files with 9 additions and 6 deletions
|
@ -25,6 +25,7 @@ import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
|||
import net.osmand.plus.render.RenderingIcons;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
import net.osmand.util.Algorithms;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
@ -104,6 +105,7 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
@ -120,11 +122,10 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
|
||||
public List<Object> getFilters(String s) {
|
||||
List<Object> filters = new ArrayList<Object>() ;
|
||||
PoiFiltersHelper poiFilters = getApp().getPoiFilters();
|
||||
if (Algorithms.isEmpty(s)) {
|
||||
PoiFiltersHelper poiFilters = getApp().getPoiFilters();
|
||||
filters.addAll(poiFilters.getTopDefinedPoiFilters());
|
||||
} else {
|
||||
PoiFiltersHelper poiFilters = getApp().getPoiFilters();
|
||||
for(PoiLegacyFilter pf : poiFilters.getTopDefinedPoiFilters()) {
|
||||
if(!pf.isStandardFilter() && pf.getName().toLowerCase().startsWith(s.toLowerCase())) {
|
||||
filters.add(pf);
|
||||
|
|
|
@ -966,13 +966,14 @@ 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(MapRouteInfoControl.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){
|
||||
mapRouteInfoControlDialog.selectAddress(name, latLon, false);
|
||||
mapRouteInfoControlDialog.selectAddress(name, latLon, target);
|
||||
} else {
|
||||
mapRouteInfoControlDialog.selectAddress("", latLon, true);
|
||||
mapRouteInfoControlDialog.selectAddress("", latLon, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ public class MapRouteInfoControl implements IRouteInformationListener {
|
|||
private boolean showDialog = false;
|
||||
private MapActivity mapActivity;
|
||||
private MapControlsLayer mapControlsLayer;
|
||||
public static final String TARGET_SELECT = "TARGET_SELECT";
|
||||
|
||||
public MapRouteInfoControl(ContextMenuLayer contextMenu,
|
||||
MapActivity mapActivity, MapControlsLayer mapControlsLayer) {
|
||||
|
@ -208,7 +209,7 @@ public class MapRouteInfoControl implements IRouteInformationListener {
|
|||
} else if(position == 3) {
|
||||
Intent intent = new Intent(mapActivity, SearchAddressActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
intent.putExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_INTENT_KEY, (String) null);
|
||||
intent.putExtra(TARGET_SELECT, true);
|
||||
mapActivity.startActivityForResult(intent, MapControlsLayer.REQUEST_ADDRESS_SELECT);
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +238,7 @@ public class MapRouteInfoControl implements IRouteInformationListener {
|
|||
} else if(position == 3) {
|
||||
Intent intent = new Intent(mapActivity, SearchAddressActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
intent.putExtra(SearchAddressFragment.SELECT_ADDRESS_POINT_INTENT_KEY, (String) null);
|
||||
intent.putExtra(TARGET_SELECT, false);
|
||||
mapActivity.startActivityForResult(intent, MapControlsLayer.REQUEST_ADDRESS_SELECT);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue