This commit is contained in:
Alexey Kulish 2016-11-10 18:04:40 +03:00
commit 9705573d12
5 changed files with 64 additions and 5 deletions

View file

@ -73,9 +73,9 @@ public class BinaryInspector {
if ("test".equals(args[0])) { if ("test".equals(args[0])) {
in.inspector(new String[] { in.inspector(new String[] {
// "-vpoi", // "-vpoi",
"-vmap", "-vmapobjects", // "-vmapcoordinates", // "-vmap", "-vmapobjects", // "-vmapcoordinates",
// "-vrouting", // "-vrouting",
// "-vtransport", "-vtransport",
// "-vaddress", "-vcities","-vstreetgroups", // "-vaddress", "-vcities","-vstreetgroups",
// "-vstreets", "-vbuildings", "-vintersections", // "-vstreets", "-vbuildings", "-vintersections",
// "-lang=ru", // "-lang=ru",

View file

@ -352,6 +352,8 @@ repositories {
dependencies { dependencies {
compile project(path: ':OsmAnd-java', configuration: 'android') compile project(path: ':OsmAnd-java', configuration: 'android')
// compile project(':eclipse-compile:design') // compile project(':eclipse-compile:design')
// compile project(':eclipse-compile:cardview') // compile project(':eclipse-compile:cardview')
// compile project(':eclipse-compile:gridlayout') // compile project(':eclipse-compile:gridlayout')
@ -366,3 +368,8 @@ dependencies {
qtcoreCompile "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar" qtcoreCompile "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
qtcoreCompile "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar" qtcoreCompile "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
} }
if(System.getenv("APP_FEATURES") && System.getenv("APP_FEATURES").contains("+play_market") &&
System.getenv("PACKAGE_TO_BUILT").equals("net.osmand")) {
println "Apply GMS plugin"
apply plugin: 'com.google.gms.google-services'
}

View file

@ -0,0 +1,42 @@
{
"project_info": {
"project_number": "521675454867",
"firebase_url": "https://osmand-1e236.firebaseio.com",
"project_id": "osmand-1e236",
"storage_bucket": "osmand-1e236.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:521675454867:android:be0477f14dc015f4",
"android_client_info": {
"package_name": "net.osmand"
}
},
"oauth_client": [
{
"client_id": "521675454867-ttjur3617a74qj0a9rkbkbcjavvuebjp.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBMaRMiPY-mS3J_-aX30sRBFB-WGIm-M-U"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

View file

@ -20,10 +20,10 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.MapObject.MapObjectComparator;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.data.QuadRect; import net.osmand.data.QuadRect;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
@ -514,7 +514,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
if (nearestWiki.size() > 0) { if (nearestWiki.size() > 0) {
AmenityInfoRow wikiInfo = new AmenityInfoRow( AmenityInfoRow wikiInfo = new AmenityInfoRow(
"nearest_wiki", R.drawable.ic_action_wikipedia, null, app.getString(R.string.wiki_around) + " - " + nearestWiki.size(), true, "nearest_wiki", R.drawable.ic_action_wikipedia, null, app.getString(R.string.wiki_around) + " (" + nearestWiki.size()+")", true,
getCollapsableWikiView(view.getContext(), true), getCollapsableWikiView(view.getContext(), true),
0, false, false, false, 1000, null, false, false); 0, false, false, false, 1000, null, false, false);
buildAmenityRow(view, wikiInfo); buildAmenityRow(view, wikiInfo);
@ -537,7 +537,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
private void processNearstWiki() { private void processNearstWiki() {
QuadRect rect = MapUtils.calculateLatLonBbox( QuadRect rect = MapUtils.calculateLatLonBbox(
amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), 100); amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), 250);
nearestWiki = app.getResourceManager().searchAmenities( nearestWiki = app.getResourceManager().searchAmenities(
new BinaryMapIndexReader.SearchPoiTypeFilter() { new BinaryMapIndexReader.SearchPoiTypeFilter() {
@Override @Override
@ -550,6 +550,15 @@ public class AmenityMenuBuilder extends MenuBuilder {
return false; return false;
} }
}, rect.top, rect.left, rect.bottom, rect.right, -1, null); }, rect.top, rect.left, rect.bottom, rect.right, -1, null);
Collections.sort(nearestWiki, new Comparator<Amenity>() {
@Override
public int compare(Amenity o1, Amenity o2) {
double d1 = MapUtils.getDistance(amenity.getLocation(), o1.getLocation());
double d2 = MapUtils.getDistance(amenity.getLocation(), o2.getLocation());
return Double.compare(d1, d2);
}
});
for (Amenity wiki : nearestWiki) { for (Amenity wiki : nearestWiki) {
if (wiki.getId().equals(amenity.getId())) { if (wiki.getId().equals(amenity.getId())) {
nearestWiki.remove(wiki); nearestWiki.remove(wiki);

View file

@ -4,6 +4,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.1.3' classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:3.0.0'
} }
} }