diff --git a/OsmAnd-java/src/net/osmand/NativeLibrary.java b/OsmAnd-java/src/net/osmand/NativeLibrary.java index c0aec802dd..c2ed078c65 100644 --- a/OsmAnd-java/src/net/osmand/NativeLibrary.java +++ b/OsmAnd-java/src/net/osmand/NativeLibrary.java @@ -281,13 +281,13 @@ public class NativeLibrary { return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1); } - public static void loadFontData(String dir) { - File dr = new File(dir); - if (dr.listFiles() == null) { + public void loadFontData(File dr) { + File[] lf = dr.listFiles(); + if (lf == null) { System.err.println("No fonts loaded from " + dr.getAbsolutePath()); return; } - ArrayList lst = new ArrayList(Arrays.asList(dr.listFiles())); + ArrayList lst = new ArrayList(Arrays.asList(lf)); Collections.sort(lst, new Comparator() { diff --git a/OsmAnd/.gitignore b/OsmAnd/.gitignore index 5a330f65ec..fcf6015200 100644 --- a/OsmAnd/.gitignore +++ b/OsmAnd/.gitignore @@ -3,6 +3,7 @@ dist/ res/values/no_translate.xml assets/specialphrases/* assets/voice/* +assets/fonts/* gen/ local.properties raw/ diff --git a/OsmAnd/assets/bundled_assets.xml b/OsmAnd/assets/bundled_assets.xml index f3240fa183..8f7238cdeb 100644 --- a/OsmAnd/assets/bundled_assets.xml +++ b/OsmAnd/assets/bundled_assets.xml @@ -43,14 +43,11 @@ - + + + + + + diff --git a/OsmAnd/assets/fonts/Roboto-Medium.ttf b/OsmAnd/assets/fonts/Roboto-Medium.ttf deleted file mode 100644 index a3c1a1f170..0000000000 Binary files a/OsmAnd/assets/fonts/Roboto-Medium.ttf and /dev/null differ diff --git a/OsmAnd/assets/fonts/Roboto-Regular.ttf b/OsmAnd/assets/fonts/Roboto-Regular.ttf deleted file mode 100644 index 7d9a6c4c32..0000000000 Binary files a/OsmAnd/assets/fonts/Roboto-Regular.ttf and /dev/null differ diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index 6724c10597..ca9018b2ae 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 21 - buildToolsVersion "23.0.0" + buildToolsVersion "23.0.1" signingConfigs { development { @@ -190,6 +190,14 @@ task collectVoiceAssets(type: Sync) { include "**/*.p" } + +task collectFonts(type: Copy) { + from "../../resources/fonts" + from "../../resources/rendering_styles/fonts/OpenSans" + into "assets/fonts" + include "*.ttf" +} + task collectHelpContentsAssets(type: Sync) { from "../../help/help" into "assets/help" @@ -237,6 +245,7 @@ task copyStyleIcons(type: Copy) { task collectExternalResources << {} collectExternalResources.dependsOn collectVoiceAssets, + collectFonts, collectHelpContentsAssets, collectRoutingResources, collectRenderingStylesResources, diff --git a/OsmAnd/build.xml b/OsmAnd/build.xml index cf09ba7992..42688a7f7b 100644 --- a/OsmAnd/build.xml +++ b/OsmAnd/build.xml @@ -81,6 +81,14 @@ + + + + + + + + diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index bafc5f6686..f611803a88 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -442,11 +442,16 @@ public class AppInitializer implements IProgress { osmandSettings.NATIVE_RENDERING_FAILED.set(true); startTask(app.getString(R.string.init_native_library), -1); RenderingRulesStorage storage = app.getRendererRegistry().getCurrentSelectedRenderer(); - boolean initialized = NativeOsmandLibrary.getLibrary(storage, app) != null; + NativeOsmandLibrary lib = NativeOsmandLibrary.getLibrary(storage, app); + boolean initialized = lib != null; osmandSettings.NATIVE_RENDERING_FAILED.set(false); if (!initialized) { LOG.info("Native library could not be loaded!"); + } else { + File ls = app.getAppPath("fonts"); + lib.loadFontData(ls); } + } app.getResourceManager().initMapBoundariesCacheNative(); } diff --git a/eclipse-compile/appcompat/build.gradle b/eclipse-compile/appcompat/build.gradle index 77d0c8369f..34e8ec28cf 100644 --- a/eclipse-compile/appcompat/build.gradle +++ b/eclipse-compile/appcompat/build.gradle @@ -6,7 +6,7 @@ dependencies { android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" defaultConfig { minSdkVersion 9 diff --git a/eclipse-compile/cardview/build.gradle b/eclipse-compile/cardview/build.gradle index 391b3c602c..d78f964e28 100755 --- a/eclipse-compile/cardview/build.gradle +++ b/eclipse-compile/cardview/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" defaultConfig { minSdkVersion 7 diff --git a/eclipse-compile/design/build.gradle b/eclipse-compile/design/build.gradle index b17876349c..4768adbd15 100644 --- a/eclipse-compile/design/build.gradle +++ b/eclipse-compile/design/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" defaultConfig { minSdkVersion 9 diff --git a/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/BuildConfig.java b/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/BuildConfig.java deleted file mode 100644 index dad3d40209..0000000000 --- a/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package net.osmand.addressPlugin; - -/* 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/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/Manifest.java b/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/Manifest.java deleted file mode 100644 index cd02208eb7..0000000000 --- a/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package net.osmand.addressPlugin; - -/* 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/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/R.java b/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/R.java deleted file mode 100644 index 8403ec7744..0000000000 --- a/plugins/OsmAnd-AddressPlugin/gen/net/osmand/addressPlugin/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package net.osmand.addressPlugin; - -/* 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 diff --git a/plugins/Osmand-Nautical/build.gradle b/plugins/Osmand-Nautical/build.gradle index 9d9cc05dd9..17aa1d99f2 100644 --- a/plugins/Osmand-Nautical/build.gradle +++ b/plugins/Osmand-Nautical/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" signingConfigs { development { diff --git a/plugins/Osmand-ParkingPlugin/build.gradle b/plugins/Osmand-ParkingPlugin/build.gradle index 9d9cc05dd9..17aa1d99f2 100644 --- a/plugins/Osmand-ParkingPlugin/build.gradle +++ b/plugins/Osmand-ParkingPlugin/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" signingConfigs { development { diff --git a/plugins/Osmand-SRTMPlugin/build.gradle b/plugins/Osmand-SRTMPlugin/build.gradle index 9d9cc05dd9..17aa1d99f2 100644 --- a/plugins/Osmand-SRTMPlugin/build.gradle +++ b/plugins/Osmand-SRTMPlugin/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" signingConfigs { development { diff --git a/plugins/Osmand-Sherpafy/.classpath b/plugins/Osmand-Sherpafy/.classpath deleted file mode 100644 index 7bc01d9a9c..0000000000 --- a/plugins/Osmand-Sherpafy/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plugins/Osmand-Sherpafy/.gitignore b/plugins/Osmand-Sherpafy/.gitignore deleted file mode 100644 index 36986d81cf..0000000000 --- a/plugins/Osmand-Sherpafy/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -bin -gen -raw -obj diff --git a/plugins/Osmand-Sherpafy/.project b/plugins/Osmand-Sherpafy/.project deleted file mode 100644 index 728045eb8b..0000000000 --- a/plugins/Osmand-Sherpafy/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - Osmand-Sherpafy - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/plugins/Osmand-Sherpafy/AndroidManifest.xml b/plugins/Osmand-Sherpafy/AndroidManifest.xml deleted file mode 100644 index 144a69c82d..0000000000 --- a/plugins/Osmand-Sherpafy/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/Osmand-Sherpafy/build.gradle b/plugins/Osmand-Sherpafy/build.gradle deleted file mode 100644 index 9d9cc05dd9..0000000000 --- a/plugins/Osmand-Sherpafy/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" - - signingConfigs { - development { - storeFile file("../../keystores/debug.keystore") - storePassword "android" - keyAlias "androiddebugkey" - keyPassword "android" - } - - publishing { - storeFile file("../../osmand_key") - storePassword System.getenv("OSMAND_APK_PASSWORD") - keyAlias "androiddebugkey" - keyPassword System.getenv("OSMAND_APK_PASSWORD") - } - } - - defaultConfig { - minSdkVersion 9 - targetSdkVersion 21 - } - - lintOptions { - abortOnError false - } - - sourceSets { - main { - manifest.srcFile "AndroidManifest.xml" - jni.srcDirs = [] - jniLibs.srcDirs = [] - aidl.srcDirs = ["src"] - java.srcDirs = ["src"] - resources.srcDirs = ["src"] - renderscript.srcDirs = ["src"] - res.srcDirs = ["res"] - assets.srcDirs = ["assets"] - } - } - - buildTypes { - debug { - signingConfig signingConfigs.development - } - release { - signingConfig signingConfigs.publishing - } - } -} - -repositories { - ivy { - name = "OsmAndBinariesIvy" - url = "http://builder.osmand.net" - layout "pattern", { - artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" - } - } -} - -dependencies { -} diff --git a/plugins/Osmand-Sherpafy/proguard-project.txt b/plugins/Osmand-Sherpafy/proguard-project.txt deleted file mode 100644 index f2fe1559a2..0000000000 --- a/plugins/Osmand-Sherpafy/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/plugins/Osmand-Sherpafy/project.properties b/plugins/Osmand-Sherpafy/project.properties deleted file mode 100644 index 4ab125693c..0000000000 --- a/plugins/Osmand-Sherpafy/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-19 diff --git a/plugins/Osmand-Sherpafy/res/drawable-hdpi/ic_launcher.png b/plugins/Osmand-Sherpafy/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 96a442e5b8..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-hdpi/icon.png b/plugins/Osmand-Sherpafy/res/drawable-hdpi/icon.png deleted file mode 100644 index 1426adff51..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-ldpi/ic_launcher.png b/plugins/Osmand-Sherpafy/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 99238729d8..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-ldpi/icon.png b/plugins/Osmand-Sherpafy/res/drawable-ldpi/icon.png deleted file mode 100644 index c99e8a25f7..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-mdpi/ic_launcher.png b/plugins/Osmand-Sherpafy/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 359047dfa4..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-mdpi/icon.png b/plugins/Osmand-Sherpafy/res/drawable-mdpi/icon.png deleted file mode 100644 index 15eeaf60c2..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-xhdpi/ic_launcher.png b/plugins/Osmand-Sherpafy/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 71c6d760f0..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/drawable-xhdpi/icon.png b/plugins/Osmand-Sherpafy/res/drawable-xhdpi/icon.png deleted file mode 100644 index 8c9caab40c..0000000000 Binary files a/plugins/Osmand-Sherpafy/res/drawable-xhdpi/icon.png and /dev/null differ diff --git a/plugins/Osmand-Sherpafy/res/layout/main.xml b/plugins/Osmand-Sherpafy/res/layout/main.xml deleted file mode 100644 index 35e8b132cc..0000000000 --- a/plugins/Osmand-Sherpafy/res/layout/main.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/plugins/Osmand-Sherpafy/res/values/strings.xml b/plugins/Osmand-Sherpafy/res/values/strings.xml deleted file mode 100644 index 5cac6def46..0000000000 --- a/plugins/Osmand-Sherpafy/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - No - Yes - OsmAnd is not installed - Sherpafy - OsmAnd Sherpafy is installed and enabled in OsmAnd settings. - \ No newline at end of file diff --git a/plugins/Osmand-Sherpafy/src/net/osmand/sherpafy/SherpafyPluginActivity.java b/plugins/Osmand-Sherpafy/src/net/osmand/sherpafy/SherpafyPluginActivity.java deleted file mode 100644 index c2773ea6dd..0000000000 --- a/plugins/Osmand-Sherpafy/src/net/osmand/sherpafy/SherpafyPluginActivity.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.osmand.sherpafy; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.ActivityNotFoundException; -import android.content.ComponentName; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.net.Uri; -import android.os.Bundle; - -public class SherpafyPluginActivity extends Activity { - private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$ - private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$ - private static final String OSMAND_ACTIVITY = "net.osmand.plus.sherpafy.TourViewActivity"; //$NON-NLS-1$ - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - Intent intentPlus = new Intent(); - intentPlus.setComponent(new ComponentName(OSMAND_COMPONENT_PLUS, OSMAND_ACTIVITY)); - intentPlus.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); - ResolveInfo resolved = getPackageManager().resolveActivity(intentPlus, PackageManager.MATCH_DEFAULT_ONLY); - if(resolved != null) { - stopService(intentPlus); - startActivity(intentPlus); - finish(); - } else { - Intent intentNormal = new Intent(); - intentNormal.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); - intentNormal.setComponent(new ComponentName(OSMAND_COMPONENT, OSMAND_ACTIVITY)); - resolved = getPackageManager().resolveActivity(intentNormal, PackageManager.MATCH_DEFAULT_ONLY); - if (resolved != null) { - stopService(intentNormal); - intentNormal.putExtra("SHERPAFY", true); - startActivity(intentNormal); - finish(); - } else { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage(getString(R.string.osmand_app_not_found)); - builder.setPositiveButton(getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + OSMAND_COMPONENT_PLUS)); - try { - stopService(intent); - startActivity(intent); - } catch (ActivityNotFoundException e) { - } - } - }); - builder.setNegativeButton(getString(R.string.shared_string_no), null); - builder.show(); - } - } - } - -} \ No newline at end of file diff --git a/plugins/Osmand-Skimaps/build.gradle b/plugins/Osmand-Skimaps/build.gradle index 9d9cc05dd9..17aa1d99f2 100644 --- a/plugins/Osmand-Skimaps/build.gradle +++ b/plugins/Osmand-Skimaps/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 21 - buildToolsVersion "21.1.2" + buildToolsVersion "23.0.1" signingConfigs { development {