Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-11-12 18:01:29 +01:00
commit 3dbf9a3408
2 changed files with 24 additions and 4 deletions

View file

@ -32,6 +32,7 @@ android {
jniLibs.srcDirs = ["libs"] jniLibs.srcDirs = ["libs"]
java.srcDirs = ["src"] java.srcDirs = ["src"]
renderscript.srcDirs = ["src"] renderscript.srcDirs = ["src"]
resources.srcDirs = ["src"]
res.srcDirs = ["res"] res.srcDirs = ["res"]
assets.srcDirs = ["assets"] assets.srcDirs = ["assets"]
} }
@ -74,6 +75,23 @@ android {
} }
} }
task collectMiscResources(type: Copy) {
into "src/net/osmand/osm"
from("../../resources/poi") {
include "poi_types.xml"
}
}
task collectRegionsInfoResources(type: Copy) {
from "../../resources/countries-info"
into "src/net/osmand/map"
include "regions.ocbf"
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn << [collectMiscResources, collectRegionsInfoResources]
}
repositories { repositories {
ivy { ivy {
name = "OsmAndBinariesIvy" name = "OsmAndBinariesIvy"

View file

@ -5,8 +5,6 @@ import android.app.Application;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Environment; import android.os.Environment;
import android.os.Handler; import android.os.Handler;
import android.os.Message;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import net.osmand.core.android.CoreResourcesFromAndroidAssets; import net.osmand.core.android.CoreResourcesFromAndroidAssets;
@ -58,8 +56,12 @@ public class SampleApplication extends Application {
} }
public void initPoiTypes() { public void initPoiTypes() {
File poiTypesFile = new File(Environment.getExternalStorageDirectory() + "/osmand/poi_types.xml");
poiTypes.init(Environment.getExternalStorageDirectory() + "/osmand/poi_types.xml"); if (poiTypesFile.exists()) {
poiTypes.init(poiTypesFile.getAbsolutePath());
} else {
poiTypes.init();
}
poiTypes.setPoiTranslator(new MapPoiTypes.PoiTranslator() { poiTypes.setPoiTranslator(new MapPoiTypes.PoiTranslator() {
@Override @Override