diff --git a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java index f1d4e44757..dbbdc468c5 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java @@ -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() ; + } } diff --git a/OsmAnd-java/src/net/osmand/osm/PoiCategory.java b/OsmAnd-java/src/net/osmand/osm/PoiCategory.java new file mode 100644 index 0000000000..c3a7ab37fd --- /dev/null +++ b/OsmAnd-java/src/net/osmand/osm/PoiCategory.java @@ -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; + } + +} diff --git a/OsmAnd-java/src/net/osmand/osm/PoiType.java b/OsmAnd-java/src/net/osmand/osm/PoiType.java new file mode 100644 index 0000000000..ff8d1eb172 --- /dev/null +++ b/OsmAnd-java/src/net/osmand/osm/PoiType.java @@ -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; + } + +} diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml index 40d3aa21de..93460e56de 100644 --- a/OsmAnd/AndroidManifest.xml +++ b/OsmAnd/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionCode="201" package="net.osmand.plus"> - + diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index a64db6d5c4..004059eb17 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -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; diff --git a/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java b/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java index 5e57660314..511ea7d9c0 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditPOIFilterActivity.java @@ -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, diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java index 6887fc1556..7845082179 100644 --- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java @@ -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); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 5571ac1772..d2561989b2 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -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); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 11938b393d..2457cdde45 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -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 userDefined = new ArrayList(); + public AlertDialog selectPOIFilterLayer(final OsmandMapTileView mapView, final PoiLegacyFilter[] selected){ + final List userDefined = new ArrayList(); 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(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index 7bd5dfa2de..d59a00f79d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -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> 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()); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java index 072524fdc7..41946bab76 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java @@ -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 filters = new ArrayList() ; + List filters = new ArrayList() ; 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 { - AmenityAdapter(List list) { + class AmenityAdapter extends ArrayAdapter { + AmenityAdapter(List 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())) { diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 273e8b55cc..c1513370a6 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -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() { diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index 2906606c8d..358cc0a710 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -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 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() { diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index c3730cf6e7..a0ad180b90 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -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 locationPoints) { - PoiFilter pf = getPoiFilter(); + PoiLegacyFilter pf = getPoiFilter(); if (pf != null) { final List locs = route.getImmutableAllLocations(); List 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() { diff --git a/OsmAnd/src/net/osmand/plus/NameFinderPoiFilter.java b/OsmAnd/src/net/osmand/plus/poi/NameFinderPoiFilter.java similarity index 96% rename from OsmAnd/src/net/osmand/plus/NameFinderPoiFilter.java rename to OsmAnd/src/net/osmand/plus/poi/NameFinderPoiFilter.java index 41aee81b34..b04c877fba 100644 --- a/OsmAnd/src/net/osmand/plus/NameFinderPoiFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/NameFinderPoiFilter.java @@ -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); diff --git a/OsmAnd/src/net/osmand/plus/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java similarity index 77% rename from OsmAnd/src/net/osmand/plus/PoiFiltersHelper.java rename to OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index 90fbb7e22f..9e20e60d96 100644 --- a/OsmAnd/src/net/osmand/plus/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -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 cacheTopStandardFilters; - private List cacheUserDefinedFilters; - private List cacheOsmDefinedFilters; + private List cacheTopStandardFilters; + private List cacheUserDefinedFilters; + private List 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... collections) { - for(List c : collections) { - for(PoiFilter f : c) { + private PoiLegacyFilter findPoiFilter(String filterId, List... collections) { + for(List 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 getUserDefinedDefaultFilters() { - List filters = new ArrayList(); - filters.add(new PoiFilter(application.getString(R.string.poi_filter_accomodation), PoiFilter.USER_PREFIX + UDF_ACCOMMODATION, + private List getUserDefinedDefaultFilters() { + List filters = new ArrayList(); + 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 getUserDefinedPoiFilters(){ + public List getUserDefinedPoiFilters(){ if(cacheUserDefinedFilters == null){ - cacheUserDefinedFilters = new ArrayList(); + cacheUserDefinedFilters = new ArrayList(); PoiFilterDbHelper helper = openDbHelper(); - List userDefined = helper.getFilters(helper.getReadableDatabase()); + List userDefined = helper.getFilters(helper.getReadableDatabase()); sortListOfFiltersByName(userDefined); cacheUserDefinedFilters.addAll(userDefined); helper.close(); } return Collections.unmodifiableList(cacheUserDefinedFilters); } - private void sortListOfFiltersByName(List userDefined) { + private void sortListOfFiltersByName(List userDefined) { final Collator instance = Collator.getInstance(); - Collections.sort(userDefined, new Comparator() { + Collections.sort(userDefined, new Comparator() { @Override - public int compare(PoiFilter object1, PoiFilter object2) { + public int compare(PoiLegacyFilter object1, PoiLegacyFilter object2) { return instance.compare(object1.getName(), object2.getName()); } }); } - public List getTopStandardFilters() { + public List getTopStandardFilters() { if (cacheTopStandardFilters == null) { - cacheTopStandardFilters = new ArrayList(); - PoiFilter filter = new PoiFilter(application.getString(R.string.poi_filter_custom_filter), - PoiFilter.CUSTOM_FILTER_ID, new LinkedHashMap>(), application); //$NON-NLS-1$ + cacheTopStandardFilters = new ArrayList(); + PoiLegacyFilter filter = new PoiLegacyFilter(application.getString(R.string.poi_filter_custom_filter), + PoiLegacyFilter.CUSTOM_FILTER_ID, new LinkedHashMap>(), 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 getOsmDefinedPoiFilters(){ + public List getOsmDefinedPoiFilters(){ if(cacheOsmDefinedFilters == null){ - cacheOsmDefinedFilters = new ArrayList(); + cacheOsmDefinedFilters = new ArrayList(); 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() { + Collections.sort(cacheOsmDefinedFilters, new Comparator() { @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 filters = PoiFilterDbHelper.this.getFilters(conn); - List def = getUserDefinedDefaultFilters(); - for(PoiFilter f : filters){ - PoiFilter std = null; - for(PoiFilter d : def){ + List filters = PoiFilterDbHelper.this.getFilters(conn); + List 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 getFilters(SQLiteConnection conn){ - ArrayList list = new ArrayList(); + protected List getFilters(SQLiteConnection conn){ + ArrayList list = new ArrayList(); 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$ diff --git a/OsmAnd/src/net/osmand/plus/PoiFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java similarity index 96% rename from OsmAnd/src/net/osmand/plus/PoiFilter.java rename to OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java index 2c167177fb..a6116ca3cc 100644 --- a/OsmAnd/src/net/osmand/plus/PoiFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiLegacyFilter.java @@ -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> acceptedTypes, OsmandApplication app){ + public PoiLegacyFilter(String name, String filterId, Map> acceptedTypes, OsmandApplication app){ this.app = app; isStandardFilter = false; if(filterId == null){ diff --git a/OsmAnd/src/net/osmand/plus/SearchByNameFilter.java b/OsmAnd/src/net/osmand/plus/poi/SearchByNameFilter.java similarity index 88% rename from OsmAnd/src/net/osmand/plus/SearchByNameFilter.java rename to OsmAnd/src/net/osmand/plus/poi/SearchByNameFilter.java index e2f872baea..e71ee1022a 100644 --- a/OsmAnd/src/net/osmand/plus/SearchByNameFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/SearchByNameFilter.java @@ -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 searchedAmenities = new ArrayList(); diff --git a/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepository.java b/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepository.java index c8ea50691b..0378df1ddc 100644 --- a/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepository.java +++ b/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepository.java @@ -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 searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom, PoiFilter filter, List amenities, + public List searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom, PoiLegacyFilter filter, List amenities, ResultMatcher matcher); - public List searchAmenitiesOnThePath(List locations, double radius, PoiFilter filter, ResultMatcher matcher); + public List searchAmenitiesOnThePath(List locations, double radius, PoiLegacyFilter filter, ResultMatcher matcher); } diff --git a/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java index d07dcf6c6a..6f624cfaf8 100644 --- a/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java @@ -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 searchAmenities(int stop, int sleft, int sbottom, int sright, int zoom, - final PoiFilter filter, final List amenities, ResultMatcher matcher) { + final PoiLegacyFilter filter, final List amenities, ResultMatcher matcher) { long now = System.currentTimeMillis(); SearchPoiTypeFilter poiTypeFilter = new SearchPoiTypeFilter(){ @Override @@ -108,7 +108,7 @@ public class AmenityIndexRepositoryBinary implements AmenityIndexRepository { } @Override - public synchronized List searchAmenitiesOnThePath(List locations, double radius, final PoiFilter filter, ResultMatcher matcher) { + public synchronized List searchAmenitiesOnThePath(List locations, double radius, final PoiLegacyFilter filter, ResultMatcher matcher) { long now = System.currentTimeMillis(); SearchPoiTypeFilter poiTypeFilter = new SearchPoiTypeFilter(){ @Override diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 8f513e2b96..1acfe59295 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -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 searchAmenities(PoiFilter filter, + public List searchAmenities(PoiLegacyFilter filter, double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude, int zoom, final ResultMatcher matcher) { final List amenities = new ArrayList(); searchAmenitiesInProgress = true; @@ -824,7 +824,7 @@ public class ResourceManager { return map; } - public List searchAmenitiesOnThePath(List locations, double radius, PoiFilter filter, ResultMatcher matcher) { + public List searchAmenitiesOnThePath(List locations, double radius, PoiLegacyFilter filter, ResultMatcher matcher) { searchAmenitiesInProgress = true; final List amenities = new ArrayList(); try { diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 844d4f4cce..2c6d80ea12 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -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(); } diff --git a/appcompat/.classpath b/appcompat/.classpath index a4763d1eec..7bc01d9a9c 100644 --- a/appcompat/.classpath +++ b/appcompat/.classpath @@ -3,6 +3,7 @@ - + + diff --git a/appcompat/.gitignore b/appcompat/.gitignore new file mode 100644 index 0000000000..e614fbbef9 --- /dev/null +++ b/appcompat/.gitignore @@ -0,0 +1,2 @@ +bin +gen diff --git a/appcompat/gen/android/support/v7/appcompat/BuildConfig.java b/appcompat/gen/android/support/v7/appcompat/BuildConfig.java deleted file mode 100644 index 4cee8535dc..0000000000 --- a/appcompat/gen/android/support/v7/appcompat/BuildConfig.java +++ /dev/null @@ -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); -} \ No newline at end of file diff --git a/appcompat/gen/android/support/v7/appcompat/Manifest.java b/appcompat/gen/android/support/v7/appcompat/Manifest.java deleted file mode 100644 index 3ddf9e5d8b..0000000000 --- a/appcompat/gen/android/support/v7/appcompat/Manifest.java +++ /dev/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 { -} \ No newline at end of file diff --git a/appcompat/gen/android/support/v7/appcompat/R.java b/appcompat/gen/android/support/v7/appcompat/R.java deleted file mode 100644 index 5f706f4dde..0000000000 --- a/appcompat/gen/android/support/v7/appcompat/R.java +++ /dev/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 R class actually packed into the APK */ -public final class R { -} \ No newline at end of file