Update fonts
|
@ -281,13 +281,13 @@ public class NativeLibrary {
|
||||||
return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1);
|
return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadFontData(String dir) {
|
public void loadFontData(File dr) {
|
||||||
File dr = new File(dir);
|
File[] lf = dr.listFiles();
|
||||||
if (dr.listFiles() == null) {
|
if (lf == null) {
|
||||||
System.err.println("No fonts loaded from " + dr.getAbsolutePath());
|
System.err.println("No fonts loaded from " + dr.getAbsolutePath());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ArrayList<File> lst = new ArrayList<File>(Arrays.asList(dr.listFiles()));
|
ArrayList<File> lst = new ArrayList<File>(Arrays.asList(lf));
|
||||||
Collections.sort(lst, new Comparator<File>() {
|
Collections.sort(lst, new Comparator<File>() {
|
||||||
|
|
||||||
|
|
||||||
|
|
1
OsmAnd/.gitignore
vendored
|
@ -3,6 +3,7 @@ dist/
|
||||||
res/values/no_translate.xml
|
res/values/no_translate.xml
|
||||||
assets/specialphrases/*
|
assets/specialphrases/*
|
||||||
assets/voice/*
|
assets/voice/*
|
||||||
|
assets/fonts/*
|
||||||
gen/
|
gen/
|
||||||
local.properties
|
local.properties
|
||||||
raw/
|
raw/
|
||||||
|
|
|
@ -43,14 +43,11 @@
|
||||||
<asset source="voice/ru/config.p" destination="voice/ru/_config.p" mode="overwriteOnlyIfExists" />
|
<asset source="voice/ru/config.p" destination="voice/ru/_config.p" mode="overwriteOnlyIfExists" />
|
||||||
|
|
||||||
|
|
||||||
<!-- TODO delete deprecated
|
<asset source="fonts/OpenSans-Italic.ttf" destination="fonts/OpenSans-Italic.ttf" mode="alwaysOverwriteOrCopy" />
|
||||||
<asset source="voice/fr-ov/config.p" destination="voice/fr/_config.p" mode="overwriteOnlyIfExists" />
|
<asset source="fonts/OpenSans-Regular.ttf" destination="fonts/OpenSans-Regular.ttf" mode="alwaysOverwriteOrCopy" />
|
||||||
<asset source="voice/he-ov/config.p" destination="voice/he/_config.p" mode="overwriteOnlyIfExists" />
|
<asset source="fonts/OpenSans-Semibold.ttf" destination="fonts/OpenSans-Semibold.ttf" mode="alwaysOverwriteOrCopy" />
|
||||||
<asset source="voice/it-Chiara-ov/config.p" destination="voice/it-Chiara/_config.p" mode="overwriteOnlyIfExists" />
|
<asset source="fonts/OpenSans-SemiboldItalic.ttf" destination="fonts/OpenSans-SemiboldItalic.ttf" mode="alwaysOverwriteOrCopy" />
|
||||||
<asset source="voice/it-Roberto-ov/config.p" destination="voice/it-Roberto/_config.p" mode="overwriteOnlyIfExists" />
|
|
||||||
<asset source="voice/ru2-ov/config.p" destination="voice/ru2/_config.p" mode="overwriteOnlyIfExists" />
|
|
||||||
<asset source="voice/ru3-ov/config.p" destination="voice/ru3/_config.p" mode="overwriteOnlyIfExists" />
|
|
||||||
<asset source="voice/sk-Ruzena-ov/config.p" destination="voice/sk-Ruzena/_config.p" mode="overwriteOnlyIfExists" />
|
|
||||||
-->
|
|
||||||
<asset source="sounds/camera_click.ogg" destination="sounds/camera_click.ogg" mode="copyOnlyIfDoesNotExist" />
|
<asset source="sounds/camera_click.ogg" destination="sounds/camera_click.ogg" mode="copyOnlyIfDoesNotExist" />
|
||||||
</assets>
|
</assets>
|
||||||
|
|
|
@ -19,7 +19,7 @@ apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "23.0.0"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
development {
|
development {
|
||||||
|
@ -190,6 +190,14 @@ task collectVoiceAssets(type: Sync) {
|
||||||
include "**/*.p"
|
include "**/*.p"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
task collectFonts(type: Copy) {
|
||||||
|
from "../../resources/fonts"
|
||||||
|
from "../../resources/rendering_styles/fonts/OpenSans"
|
||||||
|
into "assets/fonts"
|
||||||
|
include "*.ttf"
|
||||||
|
}
|
||||||
|
|
||||||
task collectHelpContentsAssets(type: Sync) {
|
task collectHelpContentsAssets(type: Sync) {
|
||||||
from "../../help/help"
|
from "../../help/help"
|
||||||
into "assets/help"
|
into "assets/help"
|
||||||
|
@ -237,6 +245,7 @@ task copyStyleIcons(type: Copy) {
|
||||||
|
|
||||||
task collectExternalResources << {}
|
task collectExternalResources << {}
|
||||||
collectExternalResources.dependsOn collectVoiceAssets,
|
collectExternalResources.dependsOn collectVoiceAssets,
|
||||||
|
collectFonts,
|
||||||
collectHelpContentsAssets,
|
collectHelpContentsAssets,
|
||||||
collectRoutingResources,
|
collectRoutingResources,
|
||||||
collectRenderingStylesResources,
|
collectRenderingStylesResources,
|
||||||
|
|
|
@ -81,6 +81,14 @@
|
||||||
<include name="voice/**/*.p" />
|
<include name="voice/**/*.p" />
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
|
<copy todir="assets/fonts">
|
||||||
|
<fileset dir="../../resources/fonts">
|
||||||
|
<include name="*.ttf" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="../../resources/rendering_styles/fonts/OpenSans">
|
||||||
|
<include name="*.ttf" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
<copy todir="res/">
|
<copy todir="res/">
|
||||||
<fileset dir="../../resources/rendering_styles/style-icons/" >
|
<fileset dir="../../resources/rendering_styles/style-icons/" >
|
||||||
<include name="**/*" />
|
<include name="**/*" />
|
||||||
|
|
|
@ -442,11 +442,16 @@ public class AppInitializer implements IProgress {
|
||||||
osmandSettings.NATIVE_RENDERING_FAILED.set(true);
|
osmandSettings.NATIVE_RENDERING_FAILED.set(true);
|
||||||
startTask(app.getString(R.string.init_native_library), -1);
|
startTask(app.getString(R.string.init_native_library), -1);
|
||||||
RenderingRulesStorage storage = app.getRendererRegistry().getCurrentSelectedRenderer();
|
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);
|
osmandSettings.NATIVE_RENDERING_FAILED.set(false);
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
LOG.info("Native library could not be loaded!");
|
LOG.info("Native library could not be loaded!");
|
||||||
|
} else {
|
||||||
|
File ls = app.getAppPath("fonts");
|
||||||
|
lib.loadFontData(ls);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
app.getResourceManager().initMapBoundariesCacheNative();
|
app.getResourceManager().initMapBoundariesCacheNative();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ dependencies {
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 7
|
minSdkVersion 7
|
||||||
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -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 {
|
|
||||||
}
|
|
|
@ -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 {
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
development {
|
development {
|
||||||
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
development {
|
development {
|
||||||
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
development {
|
development {
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="src" path="gen"/>
|
|
||||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
|
||||||
<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>
|
|
4
plugins/Osmand-Sherpafy/.gitignore
vendored
|
@ -1,4 +0,0 @@
|
||||||
bin
|
|
||||||
gen
|
|
||||||
raw
|
|
||||||
obj
|
|
|
@ -1,33 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>Osmand-Sherpafy</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,24 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="net.osmand.sherpafy"
|
|
||||||
android:versionCode="6"
|
|
||||||
android:versionName="1.0" >
|
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="16" />
|
|
||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
|
||||||
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
|
|
||||||
android:xlargeScreens="true" android:anyDensity="true" />
|
|
||||||
<application
|
|
||||||
android:icon="@drawable/icon"
|
|
||||||
android:label="@string/app_name" >
|
|
||||||
<activity
|
|
||||||
android:name=".SherpafyPluginActivity"
|
|
||||||
android:label="@string/app_name" >
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
|
@ -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 {
|
|
||||||
}
|
|
|
@ -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 *;
|
|
||||||
#}
|
|
|
@ -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
|
|
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB |
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:gravity="center_vertical|center_horizontal"
|
|
||||||
android:text="@string/parking_plugin_installed"
|
|
||||||
android:textSize="22sp"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="shared_string_no">No</string>
|
|
||||||
<string name="shared_string_yes">Yes</string>
|
|
||||||
<string name="osmand_app_not_found">OsmAnd is not installed</string>
|
|
||||||
<string name="app_name">Sherpafy</string>
|
|
||||||
<string name="parking_plugin_installed">OsmAnd Sherpafy is installed and enabled in OsmAnd settings.</string>
|
|
||||||
</resources>
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
buildToolsVersion "21.1.2"
|
buildToolsVersion "23.0.1"
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
development {
|
development {
|
||||||
|
|