Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d6da184b8c
27 changed files with 195 additions and 155 deletions
|
@ -48,8 +48,6 @@ public class MapPoiTypes {
|
|||
if (name.equals("category")) { //$NON-NLS-1$
|
||||
parentCategory = parser.getAttributeValue("","name");
|
||||
poiParentCategory = parser.getAttributeValue("","poi_category");
|
||||
poiParentPrefix = parser.getAttributeValue("","poi_prefix");
|
||||
order = parser.getAttributeValue("","order");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,4 +67,8 @@ public class MapPoiTypes {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
getDefault() ;
|
||||
}
|
||||
}
|
||||
|
|
21
OsmAnd-java/src/net/osmand/osm/PoiCategory.java
Normal file
21
OsmAnd-java/src/net/osmand/osm/PoiCategory.java
Normal file
|
@ -0,0 +1,21 @@
|
|||
package net.osmand.osm;
|
||||
|
||||
public class PoiCategory {
|
||||
|
||||
private String name;
|
||||
private String translationName;
|
||||
private MapPoiTypes poiTypes;
|
||||
|
||||
public PoiCategory(MapPoiTypes poiTypes){
|
||||
this.poiTypes = poiTypes;
|
||||
}
|
||||
|
||||
public String getTranslationName() {
|
||||
return translationName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
23
OsmAnd-java/src/net/osmand/osm/PoiType.java
Normal file
23
OsmAnd-java/src/net/osmand/osm/PoiType.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package net.osmand.osm;
|
||||
|
||||
public class PoiType {
|
||||
|
||||
private String name;
|
||||
private String translationName;
|
||||
private MapPoiTypes poiTypes;
|
||||
private PoiCategory category;
|
||||
|
||||
public PoiType(MapPoiTypes poiTypes, PoiCategory category){
|
||||
this.poiTypes = poiTypes;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getTranslationName() {
|
||||
return translationName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
android:versionCode="201"
|
||||
package="net.osmand.plus">
|
||||
|
||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
|
||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" />
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.osmand.plus.download.DownloadActivity;
|
|||
import net.osmand.plus.helpers.AvoidSpecificRoads;
|
||||
import net.osmand.plus.helpers.WaypointHelper;
|
||||
import net.osmand.plus.monitoring.LiveMonitoringHelper;
|
||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||
import net.osmand.plus.render.NativeOsmandLibrary;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
|
|
|
@ -20,12 +20,12 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.osm.MapRenderingTypes;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.PoiFiltersHelper;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SpecialPhrases;
|
||||
import net.osmand.plus.activities.search.SearchActivity;
|
||||
import net.osmand.plus.activities.search.SearchPOIActivity;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -39,7 +39,7 @@ import android.widget.LinearLayout.LayoutParams;
|
|||
*/
|
||||
public class EditPOIFilterActivity extends OsmandListActivity {
|
||||
public static final String AMENITY_FILTER = "net.osmand.amenity_filter"; //$NON-NLS-1$
|
||||
private PoiFilter filter;
|
||||
private PoiLegacyFilter filter;
|
||||
private PoiFiltersHelper helper;
|
||||
public static final String SEARCH_LAT = SearchActivity.SEARCH_LAT; //$NON-NLS-1$
|
||||
public static final String SEARCH_LON = SearchActivity.SEARCH_LON; //$NON-NLS-1$
|
||||
|
@ -153,7 +153,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
PoiFilter nFilter = new PoiFilter(editText.getText().toString(), null, filter.getAcceptedTypes(), (OsmandApplication) getApplication());
|
||||
PoiLegacyFilter nFilter = new PoiLegacyFilter(editText.getText().toString(), null, filter.getAcceptedTypes(), (OsmandApplication) getApplication());
|
||||
if (helper.createPoiFilter(nFilter)) {
|
||||
AccessibleToast.makeText(
|
||||
EditPOIFilterActivity.this,
|
||||
|
|
|
@ -31,11 +31,11 @@ public class HelpActivity extends ActionBarActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
getMyApplication().applyTheme(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
getWindow().setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
wv = new WebView(this);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
String title = getString(R.string.help);
|
||||
|
|
|
@ -27,7 +27,6 @@ import net.osmand.plus.OsmAndConstants;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.TargetPointsHelper;
|
||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||
|
@ -37,6 +36,7 @@ import net.osmand.plus.base.FailSafeFuntions;
|
|||
import net.osmand.plus.base.MapViewTrackingUtilities;
|
||||
import net.osmand.plus.helpers.GpxImportHelper;
|
||||
import net.osmand.plus.helpers.WakeLockHelper;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.render.RendererRegistry;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
|
@ -336,9 +336,9 @@ public class MapActivity extends AccessibleActivity {
|
|||
updateApplicationModeSettings();
|
||||
|
||||
String filterId = settings.getPoiFilterForMap();
|
||||
PoiFilter poiFilter = app.getPoiFilters().getFilterById(filterId);
|
||||
PoiLegacyFilter poiFilter = app.getPoiFilters().getFilterById(filterId);
|
||||
if (poiFilter == null) {
|
||||
poiFilter = new PoiFilter(null, app);
|
||||
poiFilter = new PoiLegacyFilter(null, app);
|
||||
}
|
||||
|
||||
mapLayers.getPoiMapLayer().setFilter(poiFilter);
|
||||
|
|
|
@ -22,11 +22,11 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.OsmandSettings.CommonPreference;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.PoiFiltersHelper;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SQLiteTileSource;
|
||||
import net.osmand.plus.helpers.GpxUiHelper;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
|
||||
import net.osmand.plus.render.MapVectorLayer;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
|
@ -259,8 +259,8 @@ public class MapActivityLayers {
|
|||
|
||||
|
||||
|
||||
public AlertDialog selectPOIFilterLayer(final OsmandMapTileView mapView, final PoiFilter[] selected){
|
||||
final List<PoiFilter> userDefined = new ArrayList<PoiFilter>();
|
||||
public AlertDialog selectPOIFilterLayer(final OsmandMapTileView mapView, final PoiLegacyFilter[] selected){
|
||||
final List<PoiLegacyFilter> userDefined = new ArrayList<PoiLegacyFilter>();
|
||||
OsmandApplication app = (OsmandApplication)getApplication();
|
||||
final PoiFiltersHelper poiFilters = app.getPoiFilters();
|
||||
final ContextMenuAdapter adapter = new ContextMenuAdapter(activity);
|
||||
|
@ -273,7 +273,7 @@ public class MapActivityLayers {
|
|||
// 2nd custom
|
||||
adapter.item(getString(R.string.poi_filter_custom_filter)).icon(RenderingIcons.getBigIconResourceId("user_defined")).reg();
|
||||
|
||||
for (PoiFilter f : poiFilters.getUserDefinedPoiFilters()) {
|
||||
for (PoiLegacyFilter f : poiFilters.getUserDefinedPoiFilters()) {
|
||||
Item it = adapter.item(f.getName());
|
||||
if (RenderingIcons.containsBigIcon(f.getSimplifiedId())) {
|
||||
it.icon(RenderingIcons.getBigIconResourceId(f.getSimplifiedId()));
|
||||
|
@ -298,7 +298,7 @@ public class MapActivityLayers {
|
|||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if(which == 1){
|
||||
String filterId = PoiFilter.CUSTOM_FILTER_ID;
|
||||
String filterId = PoiLegacyFilter.CUSTOM_FILTER_ID;
|
||||
getApplication().getSettings().setPoiFilterForMap(filterId);
|
||||
Intent newIntent = new Intent(activity, EditPOIFilterActivity.class);
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, filterId);
|
||||
|
@ -315,7 +315,7 @@ public class MapActivityLayers {
|
|||
filterId = PoiFiltersHelper.getOsmDefinedFilterId(categories[which - userDefined.size() - 2]);
|
||||
}
|
||||
getApplication().getSettings().setPoiFilterForMap(filterId);
|
||||
PoiFilter f = poiFilters.getFilterById(filterId);
|
||||
PoiLegacyFilter f = poiFilters.getFilterById(filterId);
|
||||
if (f != null) {
|
||||
f.clearNameFilter();
|
||||
}
|
||||
|
|
|
@ -30,21 +30,21 @@ import net.osmand.osm.MapRenderingTypes;
|
|||
import net.osmand.plus.ContextMenuAdapter;
|
||||
import net.osmand.plus.ContextMenuAdapter.Item;
|
||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
||||
import net.osmand.plus.NameFinderPoiFilter;
|
||||
import net.osmand.plus.OsmAndConstants;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SearchByNameFilter;
|
||||
import net.osmand.plus.activities.EditPOIFilterActivity;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.MapActivityActions;
|
||||
import net.osmand.plus.activities.OsmandListActivity;
|
||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
||||
import net.osmand.plus.poi.NameFinderPoiFilter;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.poi.SearchByNameFilter;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
import net.osmand.plus.views.DirectionDrawable;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -92,7 +92,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
private static final int ORIENTATION_270 = 1;
|
||||
private static final int ORIENTATION_180 = 2;
|
||||
|
||||
private PoiFilter filter;
|
||||
private PoiLegacyFilter filter;
|
||||
private AmenityAdapter amenityAdapter;
|
||||
private EditText searchFilter;
|
||||
private View searchFilterLayout;
|
||||
|
@ -140,7 +140,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
public boolean onMenuItemClick(MenuItem item) {
|
||||
if(isSearchByNameFilter()){
|
||||
Intent newIntent = new Intent(SearchPOIActivity.this, EditPOIFilterActivity.class);
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, PoiFilter.CUSTOM_FILTER_ID);
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, PoiLegacyFilter.CUSTOM_FILTER_ID);
|
||||
if(location != null) {
|
||||
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LAT, location.getLatitude());
|
||||
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LON, location.getLongitude());
|
||||
|
@ -300,7 +300,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
|
||||
|
||||
String filterId = bundle.getString(AMENITY_FILTER);
|
||||
PoiFilter filter = app.getPoiFilters().getFilterById(filterId);
|
||||
PoiLegacyFilter filter = app.getPoiFilters().getFilterById(filterId);
|
||||
if (filter != this.filter) {
|
||||
this.filter = filter;
|
||||
if (filter != null) {
|
||||
|
@ -358,7 +358,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
if(loc != null){
|
||||
Map<AmenityType, List<String>> map = app.getResourceManager().searchAmenityCategoriesByName(query, loc.getLatitude(), loc.getLongitude());
|
||||
if(!map.isEmpty()){
|
||||
PoiFilter filter = ((OsmandApplication)getApplication()).getPoiFilters().getFilterById(PoiFilter.CUSTOM_FILTER_ID);
|
||||
PoiLegacyFilter filter = ((OsmandApplication)getApplication()).getPoiFilters().getFilterById(PoiLegacyFilter.CUSTOM_FILTER_ID);
|
||||
if(filter != null){
|
||||
showFilterItem.setVisible(true);
|
||||
filter.setMapToAccept(map);
|
||||
|
@ -451,7 +451,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
|
||||
public boolean isSearchByNameFilter(){
|
||||
return filter != null && PoiFilter.BY_NAME_FILTER_ID.equals(filter.getFilterId());
|
||||
return filter != null && PoiLegacyFilter.BY_NAME_FILTER_ID.equals(filter.getFilterId());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ import android.support.v7.app.ActionBarActivity;
|
|||
import android.view.*;
|
||||
import net.osmand.access.AccessibleToast;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.NameFinderPoiFilter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.PoiFiltersHelper;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SearchByNameFilter;
|
||||
import net.osmand.plus.activities.EditPOIFilterActivity;
|
||||
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
|
||||
import net.osmand.plus.poi.NameFinderPoiFilter;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||
import net.osmand.plus.poi.SearchByNameFilter;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
import android.content.Intent;
|
||||
|
@ -51,8 +51,8 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> av, View v, int pos, long id) {
|
||||
PoiFilter poi = ((AmenityAdapter) getListAdapter()).getItem(pos);
|
||||
if(!poi.isStandardFilter() || poi.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID)) {
|
||||
PoiLegacyFilter poi = ((AmenityAdapter) getListAdapter()).getItem(pos);
|
||||
if(!poi.isStandardFilter() || poi.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID)) {
|
||||
showEditActivity(poi);
|
||||
return true;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
|
||||
public void refreshPoiListAdapter() {
|
||||
PoiFiltersHelper poiFilters = getApp().getPoiFilters();
|
||||
List<PoiFilter> filters = new ArrayList<PoiFilter>() ;
|
||||
List<PoiLegacyFilter> filters = new ArrayList<PoiLegacyFilter>() ;
|
||||
filters.addAll(poiFilters.getTopStandardFilters());
|
||||
filters.addAll(poiFilters.getUserDefinedPoiFilters());
|
||||
filters.addAll(poiFilters.getOsmDefinedPoiFilters());
|
||||
|
@ -95,7 +95,7 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
}
|
||||
}
|
||||
|
||||
private void showEditActivity(PoiFilter poi) {
|
||||
private void showEditActivity(PoiLegacyFilter poi) {
|
||||
Intent newIntent = new Intent(getActivity(), EditPOIFilterActivity.class);
|
||||
// folder selected
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
|
||||
|
@ -112,8 +112,8 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
|
||||
@Override
|
||||
public void onListItemClick(ListView parent, View v, int position, long id) {
|
||||
final PoiFilter filter = ((AmenityAdapter) getListAdapter()).getItem(position);
|
||||
if (filter.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID)) {
|
||||
final PoiLegacyFilter filter = ((AmenityAdapter) getListAdapter()).getItem(position);
|
||||
if (filter.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID)) {
|
||||
filter.clearFilter();
|
||||
showEditActivity(filter);
|
||||
return;
|
||||
|
@ -133,8 +133,8 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
|
||||
|
||||
|
||||
class AmenityAdapter extends ArrayAdapter<PoiFilter> {
|
||||
AmenityAdapter(List<PoiFilter> list) {
|
||||
class AmenityAdapter extends ArrayAdapter<PoiLegacyFilter> {
|
||||
AmenityAdapter(List<PoiLegacyFilter> list) {
|
||||
super(getActivity(), R.layout.searchpoifolder_list, list);
|
||||
}
|
||||
|
||||
|
@ -147,11 +147,11 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
}
|
||||
TextView label = (TextView) row.findViewById(R.id.folder_label);
|
||||
ImageView icon = (ImageView) row.findViewById(R.id.folder_icon);
|
||||
final PoiFilter model = getItem(position);
|
||||
final PoiLegacyFilter model = getItem(position);
|
||||
label.setText(model.getName());
|
||||
if(model.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID)) {
|
||||
if(model.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID)) {
|
||||
icon.setImageResource(android.R.drawable.ic_input_get);
|
||||
} else if (model.getFilterId().equals(PoiFilter.BY_NAME_FILTER_ID)) {
|
||||
} else if (model.getFilterId().equals(PoiLegacyFilter.BY_NAME_FILTER_ID)) {
|
||||
icon.setImageResource(android.R.drawable.ic_search_category_default);
|
||||
} else {
|
||||
if(RenderingIcons.containsBigIcon(model.getSimplifiedId())) {
|
||||
|
|
|
@ -15,11 +15,11 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.OsmandSettings.CommonPreference;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.SettingsActivity;
|
||||
import net.osmand.plus.activities.TransportRouteHelper;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.render.RenderingRuleProperty;
|
||||
import net.osmand.render.RenderingRuleStorageProperties;
|
||||
|
@ -149,7 +149,7 @@ public class ConfigureMapMenu {
|
|||
}
|
||||
|
||||
protected void selectPOILayer(final OsmandSettings settings) {
|
||||
final PoiFilter[] selected = new PoiFilter[1];
|
||||
final PoiLegacyFilter[] selected = new PoiLegacyFilter[1];
|
||||
AlertDialog dlg = ma.getMapLayers().selectPOIFilterLayer(ma.getMapView(), selected);
|
||||
dlg.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.osmand.data.LocationPoint;
|
|||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.IntermediatePointsDialog;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.MapControlsLayer;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
@ -485,7 +485,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
running[0] = position;
|
||||
thisAdapter.notifyDataSetInvalidated();
|
||||
MapActivity map = (MapActivity) ctx;
|
||||
final PoiFilter[] selected = new PoiFilter[1];
|
||||
final PoiLegacyFilter[] selected = new PoiLegacyFilter[1];
|
||||
AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected);
|
||||
dlg.setOnDismissListener(new OnDismissListener() {
|
||||
@Override
|
||||
|
@ -504,9 +504,9 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
private void selectPoi(final int[] running, final ArrayAdapter<Object> listAdapter, final int type,
|
||||
final boolean enable, Activity ctx) {
|
||||
if (ctx instanceof MapActivity &&
|
||||
!PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) {
|
||||
!PoiLegacyFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) {
|
||||
MapActivity map = (MapActivity) ctx;
|
||||
final PoiFilter[] selected = new PoiFilter[1];
|
||||
final PoiLegacyFilter[] selected = new PoiLegacyFilter[1];
|
||||
AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected);
|
||||
dlg.setOnDismissListener(new OnDismissListener() {
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@ import net.osmand.plus.OsmAndFormatter;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.OsmandSettings.MetricsConstants;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||
import net.osmand.plus.activities.IntermediatePointsDialog;
|
||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
import net.osmand.plus.routing.AlarmInfo;
|
||||
import net.osmand.plus.routing.AlarmInfo.AlarmInfoType;
|
||||
|
@ -523,7 +523,7 @@ public class WaypointHelper {
|
|||
|
||||
|
||||
protected void calculatePoi(RouteCalculationResult route, List<LocationPointWrapper> locationPoints) {
|
||||
PoiFilter pf = getPoiFilter();
|
||||
PoiLegacyFilter pf = getPoiFilter();
|
||||
if (pf != null) {
|
||||
final List<Location> locs = route.getImmutableAllLocations();
|
||||
List<Amenity> amenities = app.getResourceManager().searchAmenitiesOnThePath(locs, poiSearchDeviationRadius,
|
||||
|
@ -602,7 +602,7 @@ public class WaypointHelper {
|
|||
|
||||
|
||||
///
|
||||
public PoiFilter getPoiFilter() {
|
||||
public PoiLegacyFilter getPoiFilter() {
|
||||
return app.getPoiFilters().getFilterById(app.getSettings().getPoiFilterForMap());
|
||||
}
|
||||
public boolean showPOI() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus;
|
||||
package net.osmand.plus.poi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -11,6 +11,9 @@ import net.osmand.PlatformUtil;
|
|||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.AmenityType;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.R.string;
|
||||
import net.osmand.util.MapUtils;
|
||||
import net.sf.junidecode.Junidecode;
|
||||
|
||||
|
@ -19,7 +22,7 @@ import org.xmlpull.v1.XmlPullParser;
|
|||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
|
||||
public class NameFinderPoiFilter extends PoiFilter {
|
||||
public class NameFinderPoiFilter extends PoiLegacyFilter {
|
||||
|
||||
public static final String FILTER_ID = "name_finder"; //$NON-NLS-1$
|
||||
private static final Log log = PlatformUtil.getLog(NameFinderPoiFilter.class);
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus;
|
||||
package net.osmand.plus.poi;
|
||||
|
||||
|
||||
import java.text.Collator;
|
||||
|
@ -11,6 +11,9 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import net.osmand.data.AmenityType;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.R.string;
|
||||
import net.osmand.plus.api.SQLiteAPI.SQLiteConnection;
|
||||
import net.osmand.plus.api.SQLiteAPI.SQLiteCursor;
|
||||
import net.osmand.plus.api.SQLiteAPI.SQLiteStatement;
|
||||
|
@ -19,9 +22,9 @@ public class PoiFiltersHelper {
|
|||
private final OsmandApplication application;
|
||||
|
||||
private NameFinderPoiFilter nameFinderPOIFilter;
|
||||
private List<PoiFilter> cacheTopStandardFilters;
|
||||
private List<PoiFilter> cacheUserDefinedFilters;
|
||||
private List<PoiFilter> cacheOsmDefinedFilters;
|
||||
private List<PoiLegacyFilter> cacheTopStandardFilters;
|
||||
private List<PoiLegacyFilter> cacheUserDefinedFilters;
|
||||
private List<PoiLegacyFilter> cacheOsmDefinedFilters;
|
||||
|
||||
private static final String UDF_CAR_AID = "car_aid";
|
||||
private static final String UDF_FOR_TOURISTS = "for_tourists";
|
||||
|
@ -48,9 +51,9 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
|
||||
|
||||
private PoiFilter findPoiFilter(String filterId, List<PoiFilter>... collections) {
|
||||
for(List<PoiFilter> c : collections) {
|
||||
for(PoiFilter f : c) {
|
||||
private PoiLegacyFilter findPoiFilter(String filterId, List<PoiLegacyFilter>... collections) {
|
||||
for(List<PoiLegacyFilter> c : collections) {
|
||||
for(PoiLegacyFilter f : c) {
|
||||
if(f.getFilterId().equals(filterId)){
|
||||
return f;
|
||||
}
|
||||
|
@ -60,7 +63,7 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public PoiFilter getFilterById(String filterId){
|
||||
public PoiLegacyFilter getFilterById(String filterId){
|
||||
if(filterId == null){
|
||||
return null;
|
||||
}
|
||||
|
@ -80,25 +83,25 @@ public class PoiFiltersHelper {
|
|||
types.put(tp, list);
|
||||
}
|
||||
|
||||
private List<PoiFilter> getUserDefinedDefaultFilters() {
|
||||
List<PoiFilter> filters = new ArrayList<PoiFilter>();
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_accomodation), PoiFilter.USER_PREFIX + UDF_ACCOMMODATION,
|
||||
private List<PoiLegacyFilter> getUserDefinedDefaultFilters() {
|
||||
List<PoiLegacyFilter> filters = new ArrayList<PoiLegacyFilter>();
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_accomodation), PoiLegacyFilter.USER_PREFIX + UDF_ACCOMMODATION,
|
||||
configureDefaultUserDefinedFilter(null, UDF_ACCOMMODATION), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_car_aid), PoiFilter.USER_PREFIX + UDF_CAR_AID,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_car_aid), PoiLegacyFilter.USER_PREFIX + UDF_CAR_AID,
|
||||
configureDefaultUserDefinedFilter(null, UDF_CAR_AID), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_food_shop), PoiFilter.USER_PREFIX + UDF_FOOD_SHOP,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_food_shop), PoiLegacyFilter.USER_PREFIX + UDF_FOOD_SHOP,
|
||||
configureDefaultUserDefinedFilter(null, UDF_FOOD_SHOP), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_for_tourists), PoiFilter.USER_PREFIX + UDF_FOR_TOURISTS,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_for_tourists), PoiLegacyFilter.USER_PREFIX + UDF_FOR_TOURISTS,
|
||||
configureDefaultUserDefinedFilter(null, UDF_FOR_TOURISTS), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_fuel), PoiFilter.USER_PREFIX + UDF_FUEL,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_fuel), PoiLegacyFilter.USER_PREFIX + UDF_FUEL,
|
||||
configureDefaultUserDefinedFilter(null, UDF_FUEL), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_parking), PoiFilter.USER_PREFIX + UDF_PARKING,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_parking), PoiLegacyFilter.USER_PREFIX + UDF_PARKING,
|
||||
configureDefaultUserDefinedFilter(null, UDF_PARKING), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_public_transport),
|
||||
PoiFilter.USER_PREFIX + UDF_PUBLIC_TRANSPORT, configureDefaultUserDefinedFilter(null, UDF_PUBLIC_TRANSPORT), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_restaurants), PoiFilter.USER_PREFIX + UDF_RESTAURANTS,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_public_transport),
|
||||
PoiLegacyFilter.USER_PREFIX + UDF_PUBLIC_TRANSPORT, configureDefaultUserDefinedFilter(null, UDF_PUBLIC_TRANSPORT), application));
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_restaurants), PoiLegacyFilter.USER_PREFIX + UDF_RESTAURANTS,
|
||||
configureDefaultUserDefinedFilter(null, UDF_RESTAURANTS), application));
|
||||
filters.add(new PoiFilter(application.getString(R.string.poi_filter_sightseeing), PoiFilter.USER_PREFIX + UDF_SIGHTSEEING,
|
||||
filters.add(new PoiLegacyFilter(application.getString(R.string.poi_filter_sightseeing), PoiLegacyFilter.USER_PREFIX + UDF_SIGHTSEEING,
|
||||
configureDefaultUserDefinedFilter(null, UDF_SIGHTSEEING), application));
|
||||
// UDF_EMERGENCY = "emergency";
|
||||
// UDF_ENTERTAINMENT = "entertainment";
|
||||
|
@ -166,35 +169,35 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
|
||||
|
||||
public List<PoiFilter> getUserDefinedPoiFilters(){
|
||||
public List<PoiLegacyFilter> getUserDefinedPoiFilters(){
|
||||
if(cacheUserDefinedFilters == null){
|
||||
cacheUserDefinedFilters = new ArrayList<PoiFilter>();
|
||||
cacheUserDefinedFilters = new ArrayList<PoiLegacyFilter>();
|
||||
PoiFilterDbHelper helper = openDbHelper();
|
||||
List<PoiFilter> userDefined = helper.getFilters(helper.getReadableDatabase());
|
||||
List<PoiLegacyFilter> userDefined = helper.getFilters(helper.getReadableDatabase());
|
||||
sortListOfFiltersByName(userDefined);
|
||||
cacheUserDefinedFilters.addAll(userDefined);
|
||||
helper.close();
|
||||
}
|
||||
return Collections.unmodifiableList(cacheUserDefinedFilters);
|
||||
}
|
||||
private void sortListOfFiltersByName(List<PoiFilter> userDefined) {
|
||||
private void sortListOfFiltersByName(List<PoiLegacyFilter> userDefined) {
|
||||
final Collator instance = Collator.getInstance();
|
||||
Collections.sort(userDefined, new Comparator<PoiFilter>() {
|
||||
Collections.sort(userDefined, new Comparator<PoiLegacyFilter>() {
|
||||
@Override
|
||||
public int compare(PoiFilter object1, PoiFilter object2) {
|
||||
public int compare(PoiLegacyFilter object1, PoiLegacyFilter object2) {
|
||||
return instance.compare(object1.getName(), object2.getName());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public List<PoiFilter> getTopStandardFilters() {
|
||||
public List<PoiLegacyFilter> getTopStandardFilters() {
|
||||
if (cacheTopStandardFilters == null) {
|
||||
cacheTopStandardFilters = new ArrayList<PoiFilter>();
|
||||
PoiFilter filter = new PoiFilter(application.getString(R.string.poi_filter_custom_filter),
|
||||
PoiFilter.CUSTOM_FILTER_ID, new LinkedHashMap<AmenityType, LinkedHashSet<String>>(), application); //$NON-NLS-1$
|
||||
cacheTopStandardFilters = new ArrayList<PoiLegacyFilter>();
|
||||
PoiLegacyFilter filter = new PoiLegacyFilter(application.getString(R.string.poi_filter_custom_filter),
|
||||
PoiLegacyFilter.CUSTOM_FILTER_ID, new LinkedHashMap<AmenityType, LinkedHashSet<String>>(), application); //$NON-NLS-1$
|
||||
filter.setStandardFilter(true);
|
||||
cacheTopStandardFilters.add(filter);
|
||||
cacheTopStandardFilters.add(new PoiFilter(null, application));
|
||||
cacheTopStandardFilters.add(new PoiLegacyFilter(null, application));
|
||||
filter = new SearchByNameFilter(application);
|
||||
filter.setStandardFilter(true);
|
||||
cacheTopStandardFilters.add(filter);
|
||||
|
@ -203,7 +206,7 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
|
||||
public static String getOsmDefinedFilterId(AmenityType t){
|
||||
return PoiFilter.STD_PREFIX + t;
|
||||
return PoiLegacyFilter.STD_PREFIX + t;
|
||||
}
|
||||
|
||||
public void updateFilters(boolean onlyAddFilters){
|
||||
|
@ -213,16 +216,16 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
|
||||
|
||||
public List<PoiFilter> getOsmDefinedPoiFilters(){
|
||||
public List<PoiLegacyFilter> getOsmDefinedPoiFilters(){
|
||||
if(cacheOsmDefinedFilters == null){
|
||||
cacheOsmDefinedFilters = new ArrayList<PoiFilter>();
|
||||
cacheOsmDefinedFilters = new ArrayList<PoiLegacyFilter>();
|
||||
for(AmenityType t : AmenityType.getCategories()){
|
||||
cacheOsmDefinedFilters.add(new PoiFilter(t, application));
|
||||
cacheOsmDefinedFilters.add(new PoiLegacyFilter(t, application));
|
||||
}
|
||||
final Collator instance = Collator.getInstance();
|
||||
Collections.sort(cacheOsmDefinedFilters, new Comparator<PoiFilter>() {
|
||||
Collections.sort(cacheOsmDefinedFilters, new Comparator<PoiLegacyFilter>() {
|
||||
@Override
|
||||
public int compare(PoiFilter object1, PoiFilter object2) {
|
||||
public int compare(PoiLegacyFilter object1, PoiLegacyFilter object2) {
|
||||
return instance.compare(object1.getName(), object2.getName());
|
||||
}
|
||||
});
|
||||
|
@ -234,10 +237,10 @@ public class PoiFiltersHelper {
|
|||
return new PoiFilterDbHelper(application);
|
||||
}
|
||||
|
||||
public boolean removePoiFilter(PoiFilter filter){
|
||||
if(filter.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID) ||
|
||||
filter.getFilterId().equals(PoiFilter.BY_NAME_FILTER_ID) ||
|
||||
filter.getFilterId().startsWith(PoiFilter.STD_PREFIX)){
|
||||
public boolean removePoiFilter(PoiLegacyFilter filter){
|
||||
if(filter.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID) ||
|
||||
filter.getFilterId().equals(PoiLegacyFilter.BY_NAME_FILTER_ID) ||
|
||||
filter.getFilterId().startsWith(PoiLegacyFilter.STD_PREFIX)){
|
||||
return false;
|
||||
}
|
||||
PoiFilterDbHelper helper = openDbHelper();
|
||||
|
@ -252,7 +255,7 @@ public class PoiFiltersHelper {
|
|||
return res;
|
||||
}
|
||||
|
||||
public boolean createPoiFilter(PoiFilter filter){
|
||||
public boolean createPoiFilter(PoiLegacyFilter filter){
|
||||
PoiFilterDbHelper helper = openDbHelper();
|
||||
if(helper == null){
|
||||
return false;
|
||||
|
@ -268,9 +271,9 @@ public class PoiFiltersHelper {
|
|||
|
||||
|
||||
|
||||
public boolean editPoiFilter(PoiFilter filter) {
|
||||
if (filter.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID) ||
|
||||
filter.getFilterId().equals(PoiFilter.BY_NAME_FILTER_ID) || filter.getFilterId().startsWith(PoiFilter.STD_PREFIX)) {
|
||||
public boolean editPoiFilter(PoiLegacyFilter filter) {
|
||||
if (filter.getFilterId().equals(PoiLegacyFilter.CUSTOM_FILTER_ID) ||
|
||||
filter.getFilterId().equals(PoiLegacyFilter.BY_NAME_FILTER_ID) || filter.getFilterId().startsWith(PoiLegacyFilter.STD_PREFIX)) {
|
||||
return false;
|
||||
}
|
||||
PoiFilterDbHelper helper = openDbHelper();
|
||||
|
@ -348,11 +351,11 @@ public class PoiFiltersHelper {
|
|||
}
|
||||
|
||||
public void upgradeFilters(SQLiteConnection conn, boolean onlyAdd) {
|
||||
List<PoiFilter> filters = PoiFilterDbHelper.this.getFilters(conn);
|
||||
List<PoiFilter> def = getUserDefinedDefaultFilters();
|
||||
for(PoiFilter f : filters){
|
||||
PoiFilter std = null;
|
||||
for(PoiFilter d : def){
|
||||
List<PoiLegacyFilter> filters = PoiFilterDbHelper.this.getFilters(conn);
|
||||
List<PoiLegacyFilter> def = getUserDefinedDefaultFilters();
|
||||
for(PoiLegacyFilter f : filters){
|
||||
PoiLegacyFilter std = null;
|
||||
for(PoiLegacyFilter d : def){
|
||||
if(f.getFilterId().equals(d.getFilterId())){
|
||||
std = d;
|
||||
break;
|
||||
|
@ -372,7 +375,7 @@ public class PoiFiltersHelper {
|
|||
def.remove(std);
|
||||
}
|
||||
}
|
||||
for(PoiFilter d : def){
|
||||
for(PoiLegacyFilter d : def){
|
||||
addFilter(d, conn, false);
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +389,7 @@ public class PoiFiltersHelper {
|
|||
conn.setVersion(newVersion);
|
||||
}
|
||||
|
||||
protected boolean addFilter(PoiFilter p, SQLiteConnection db, boolean addOnlyCategories){
|
||||
protected boolean addFilter(PoiLegacyFilter p, SQLiteConnection db, boolean addOnlyCategories){
|
||||
if(db != null){
|
||||
if(!addOnlyCategories){
|
||||
db.execSQL("INSERT INTO " + FILTER_NAME + " VALUES (?, ?, ?)",new Object[]{p.getName(), p.getFilterId(), p.getFilterByName()}); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
@ -414,8 +417,8 @@ public class PoiFiltersHelper {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected List<PoiFilter> getFilters(SQLiteConnection conn){
|
||||
ArrayList<PoiFilter> list = new ArrayList<PoiFilter>();
|
||||
protected List<PoiLegacyFilter> getFilters(SQLiteConnection conn){
|
||||
ArrayList<PoiLegacyFilter> list = new ArrayList<PoiLegacyFilter>();
|
||||
if(conn != null){
|
||||
SQLiteCursor query = conn.rawQuery("SELECT " + CATEGORIES_FILTER_ID +", " + CATEGORIES_COL_CATEGORY +"," + CATEGORIES_COL_SUBCATEGORY +" FROM " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
CATEGORIES_NAME, null);
|
||||
|
@ -447,7 +450,7 @@ public class PoiFiltersHelper {
|
|||
do {
|
||||
String filterId = query.getString(0);
|
||||
if(map.containsKey(filterId)){
|
||||
PoiFilter filter = new PoiFilter(query.getString(1), filterId, map.get(filterId), application);
|
||||
PoiLegacyFilter filter = new PoiLegacyFilter(query.getString(1), filterId, map.get(filterId), application);
|
||||
filter.setFilterByName(query.getString(2));
|
||||
list.add(filter);
|
||||
}
|
||||
|
@ -458,7 +461,7 @@ public class PoiFiltersHelper {
|
|||
return list;
|
||||
}
|
||||
|
||||
protected boolean editFilter(SQLiteConnection conn, PoiFilter filter) {
|
||||
protected boolean editFilter(SQLiteConnection conn, PoiLegacyFilter filter) {
|
||||
if (conn != null) {
|
||||
conn.execSQL("DELETE FROM " + CATEGORIES_NAME + " WHERE " + CATEGORIES_FILTER_ID + " = ?", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new Object[] { filter.getFilterId() });
|
||||
|
@ -469,12 +472,12 @@ public class PoiFiltersHelper {
|
|||
return false;
|
||||
}
|
||||
|
||||
private void updateName(SQLiteConnection db, PoiFilter filter) {
|
||||
private void updateName(SQLiteConnection db, PoiLegacyFilter filter) {
|
||||
db.execSQL("UPDATE " + FILTER_NAME + " SET " + FILTER_COL_FILTERBYNAME + " = ?, " + FILTER_COL_NAME + " = ? " + " WHERE " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
+ FILTER_COL_ID + "= ?", new Object[] { filter.getFilterByName(), filter.getName(), filter.getFilterId() }); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected boolean deleteFilter(SQLiteConnection db, PoiFilter p){
|
||||
protected boolean deleteFilter(SQLiteConnection db, PoiLegacyFilter p){
|
||||
if(db != null){
|
||||
db.execSQL("DELETE FROM " + FILTER_NAME + " WHERE " +FILTER_COL_ID + " = ?",new Object[]{p.getFilterId()}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
db.execSQL("DELETE FROM " + CATEGORIES_NAME + " WHERE " +CATEGORIES_FILTER_ID + " = ?", new Object[]{p.getFilterId()}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus;
|
||||
package net.osmand.plus.poi;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
@ -13,10 +13,13 @@ import net.osmand.IndexConstants;
|
|||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.AmenityType;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.util.MapUtils;
|
||||
import android.content.Context;
|
||||
|
||||
public class PoiFilter {
|
||||
public class PoiLegacyFilter {
|
||||
|
||||
public final static String STD_PREFIX = "std_"; //$NON-NLS-1$
|
||||
public final static String USER_PREFIX = "user_"; //$NON-NLS-1$
|
||||
|
@ -39,7 +42,7 @@ public class PoiFilter {
|
|||
|
||||
|
||||
// constructor for standard filters
|
||||
public PoiFilter(AmenityType type, OsmandApplication application){
|
||||
public PoiLegacyFilter(AmenityType type, OsmandApplication application){
|
||||
this.app = application;
|
||||
isStandardFilter = true;
|
||||
filterId = STD_PREFIX + type;
|
||||
|
@ -53,7 +56,7 @@ public class PoiFilter {
|
|||
}
|
||||
|
||||
// constructor for user defined filters
|
||||
public PoiFilter(String name, String filterId, Map<AmenityType, LinkedHashSet<String>> acceptedTypes, OsmandApplication app){
|
||||
public PoiLegacyFilter(String name, String filterId, Map<AmenityType, LinkedHashSet<String>> acceptedTypes, OsmandApplication app){
|
||||
this.app = app;
|
||||
isStandardFilter = false;
|
||||
if(filterId == null){
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus;
|
||||
package net.osmand.plus.poi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -8,11 +8,14 @@ import java.util.List;
|
|||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.AmenityType;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.R.string;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
public class SearchByNameFilter extends PoiFilter {
|
||||
public class SearchByNameFilter extends PoiLegacyFilter {
|
||||
|
||||
public static final String FILTER_ID = PoiFilter.BY_NAME_FILTER_ID; //$NON-NLS-1$
|
||||
public static final String FILTER_ID = PoiLegacyFilter.BY_NAME_FILTER_ID; //$NON-NLS-1$
|
||||
|
||||
List<Amenity> searchedAmenities = new ArrayList<Amenity>();
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||
import net.osmand.Location;
|
||||
import net.osmand.ResultMatcher;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
|
||||
public interface AmenityIndexRepository {
|
||||
|
||||
|
@ -18,10 +18,10 @@ public interface AmenityIndexRepository {
|
|||
/**
|
||||
* Search amenities in the specified box doesn't cache results
|
||||
*/
|
||||
public List<Amenity> searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom, PoiFilter filter, List<Amenity> amenities,
|
||||
public List<Amenity> searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom, PoiLegacyFilter filter, List<Amenity> amenities,
|
||||
ResultMatcher<Amenity> matcher);
|
||||
|
||||
public List<Amenity> searchAmenitiesOnThePath(List<Location> locations, double radius, PoiFilter filter, ResultMatcher<Amenity> matcher);
|
||||
public List<Amenity> searchAmenitiesOnThePath(List<Location> locations, double radius, PoiLegacyFilter filter, ResultMatcher<Amenity> matcher);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.osmand.binary.BinaryMapIndexReader.SearchPoiTypeFilter;
|
|||
import net.osmand.binary.BinaryMapIndexReader.SearchRequest;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.AmenityType;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -83,7 +83,7 @@ public class AmenityIndexRepositoryBinary implements AmenityIndexRepository {
|
|||
|
||||
@Override
|
||||
public synchronized List<Amenity> searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom,
|
||||
final PoiFilter filter, final List<Amenity> amenities, ResultMatcher<Amenity> matcher) {
|
||||
final PoiLegacyFilter filter, final List<Amenity> amenities, ResultMatcher<Amenity> matcher) {
|
||||
long now = System.currentTimeMillis();
|
||||
SearchPoiTypeFilter poiTypeFilter = new SearchPoiTypeFilter(){
|
||||
@Override
|
||||
|
@ -108,7 +108,7 @@ public class AmenityIndexRepositoryBinary implements AmenityIndexRepository {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized List<Amenity> searchAmenitiesOnThePath(List<Location> locations, double radius, final PoiFilter filter, ResultMatcher<Amenity> matcher) {
|
||||
public synchronized List<Amenity> searchAmenitiesOnThePath(List<Location> locations, double radius, final PoiLegacyFilter filter, ResultMatcher<Amenity> matcher) {
|
||||
long now = System.currentTimeMillis();
|
||||
SearchPoiTypeFilter poiTypeFilter = new SearchPoiTypeFilter(){
|
||||
@Override
|
||||
|
|
|
@ -36,15 +36,15 @@ import net.osmand.map.MapTileDownloader;
|
|||
import net.osmand.map.MapTileDownloader.DownloadRequest;
|
||||
import net.osmand.map.OsmandRegions;
|
||||
import net.osmand.plus.BusyIndicator;
|
||||
import net.osmand.plus.NameFinderPoiFilter;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SQLiteTileSource;
|
||||
import net.osmand.plus.SearchByNameFilter;
|
||||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.poi.NameFinderPoiFilter;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.poi.SearchByNameFilter;
|
||||
import net.osmand.plus.render.MapRenderRepositories;
|
||||
import net.osmand.plus.render.NativeOsmandLibrary;
|
||||
import net.osmand.plus.resources.AsyncLoadingThread.MapLoadRequest;
|
||||
|
@ -718,7 +718,7 @@ public class ResourceManager {
|
|||
return publish;
|
||||
}
|
||||
|
||||
public List<Amenity> searchAmenities(PoiFilter filter,
|
||||
public List<Amenity> searchAmenities(PoiLegacyFilter filter,
|
||||
double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, final ResultMatcher<Amenity> matcher) {
|
||||
final List<Amenity> amenities = new ArrayList<Amenity>();
|
||||
searchAmenitiesInProgress = true;
|
||||
|
@ -824,7 +824,7 @@ public class ResourceManager {
|
|||
return map;
|
||||
}
|
||||
|
||||
public List<Amenity> searchAmenitiesOnThePath(List<Location> locations, double radius, PoiFilter filter, ResultMatcher<Amenity> matcher) {
|
||||
public List<Amenity> searchAmenitiesOnThePath(List<Location> locations, double radius, PoiLegacyFilter filter, ResultMatcher<Amenity> matcher) {
|
||||
searchAmenitiesInProgress = true;
|
||||
final List<Amenity> amenities = new ArrayList<Amenity>();
|
||||
try {
|
||||
|
|
|
@ -16,9 +16,9 @@ import net.osmand.osm.MapRenderingTypes;
|
|||
import net.osmand.plus.ContextMenuAdapter;
|
||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.poi.PoiLegacyFilter;
|
||||
import net.osmand.plus.render.RenderingIcons;
|
||||
import net.osmand.plus.resources.ResourceManager;
|
||||
import net.osmand.plus.routing.RouteCalculationResult;
|
||||
|
@ -52,7 +52,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
|||
|
||||
private ResourceManager resourceManager;
|
||||
private RoutingHelper routingHelper;
|
||||
private PoiFilter filter;
|
||||
private PoiLegacyFilter filter;
|
||||
private MapTextLayer mapTextLayer;
|
||||
|
||||
/// cache for displayed POI
|
||||
|
@ -103,11 +103,11 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
|||
};
|
||||
}
|
||||
|
||||
public PoiFilter getFilter() {
|
||||
public PoiLegacyFilter getFilter() {
|
||||
return filter;
|
||||
}
|
||||
|
||||
public void setFilter(PoiFilter filter) {
|
||||
public void setFilter(PoiLegacyFilter filter) {
|
||||
this.filter = filter;
|
||||
data.clearCache();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
|
|
2
appcompat/.gitignore
vendored
Normal file
2
appcompat/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
bin
|
||||
gen
|
|
@ -1,8 +0,0 @@
|
|||
/*___Generated_by_IDEA___*/
|
||||
|
||||
package android.support.v7.appcompat;
|
||||
|
||||
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
|
||||
public final class BuildConfig {
|
||||
public final static boolean DEBUG = Boolean.parseBoolean(null);
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
/*___Generated_by_IDEA___*/
|
||||
|
||||
package android.support.v7.appcompat;
|
||||
|
||||
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
|
||||
public final class Manifest {
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
/*___Generated_by_IDEA___*/
|
||||
|
||||
package android.support.v7.appcompat;
|
||||
|
||||
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
|
||||
public final class R {
|
||||
}
|
Loading…
Reference in a new issue