Merge pull request #10622 from osmandapp/master

update test branch
This commit is contained in:
Hardy 2021-01-19 18:04:12 +01:00 committed by GitHub
commit 3e4e074085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 408 additions and 574 deletions

View file

@ -182,10 +182,10 @@ public class Building extends MapObject {
@Override @Override
public String toString() { public String toString() {
if(interpolationInterval !=0){ if (interpolationInterval != 0) {
return name+"-"+name2 +" (+"+interpolationInterval+") "; return name + "-" + name2 + " (+" + interpolationInterval + ") ";
} else if(interpolationType != null) { } else if (interpolationType != null) {
return name+"-"+name2 +" ("+interpolationType+") "; return name + "-" + name2 + " (" + interpolationType + ") ";
} }
return name; return name;
} }

View file

@ -1004,17 +1004,12 @@ public class SearchUICore {
String subType2 = a2.getSubType() == null ? "" : a2.getSubType(); String subType2 = a2.getSubType() == null ? "" : a2.getSubType();
int cmp = 0; int cmp = 0;
boolean subtypeFilter1 = FILTER_DUPLICATE_POI_SUBTYPE.contains(subType1);
if (FILTER_DUPLICATE_POI_SUBTYPE.contains(subType1)) { boolean subtypeFilter2 = FILTER_DUPLICATE_POI_SUBTYPE.contains(subType2);
cmp = 1; if (subtypeFilter1 != subtypeFilter2) {
} else if (FILTER_DUPLICATE_POI_SUBTYPE.contains(subType2)) { // to filter second
cmp = -1; return subtypeFilter1 ? 1 : -1;
} }
if (cmp != 0) {
return cmp;
}
cmp = c.collator.compare(type1, type2); cmp = c.collator.compare(type1, type2);
if (cmp != 0) { if (cmp != 0) {
return cmp; return cmp;

View file

@ -10,7 +10,7 @@
android:value="fb792288460976727"/> android:value="fb792288460976727"/>
<activity <activity
android:name="net.osmand.plus.activities.MapActivity" android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenFreeDev" android:theme="@style/FirstSplashScreenNightlyFree"
tools:replace="android:theme"/> tools:replace="android:theme"/>
<service <service
android:name="net.osmand.plus.NavigationService" android:name="net.osmand.plus.NavigationService"

View file

@ -1,6 +1,3 @@
apply plugin: 'com.android.library'
apply plugin: 'ivy-publish'
task printc { task printc {
configurations.each { if(it.isCanBeResolved()) println it.name } configurations.each { if(it.isCanBeResolved()) println it.name }
} }
@ -11,21 +8,29 @@ android {
// compileNdkVersion "android-ndk-r17b" // compileNdkVersion "android-ndk-r17b"
defaultConfig { defaultConfig {
minSdkVersion 15
targetSdkVersion 29 targetSdkVersion 29
multiDexEnabled true multiDexEnabled true
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }
lintOptions { lintOptions {
tasks.lint.enabled = false
abortOnError false abortOnError false
} }
// related to kuromoji
//packagingOptions {
// exclude '/META-INF/CONTRIBUTORS.md'
// exclude '/META-INF/LICENSE.md'
// exclude '/META-INF/NOTICE.md'
//}
// This is from OsmAndCore_android.aar - for some reason it's not inherited
aaptOptions { aaptOptions {
// Don't compress any embedded resources // Don't compress any embedded resources
noCompress "qz" noCompress "qz"
cruncherEnabled = false cruncherEnabled = false
// Flag notifies aapt to keep the attribute IDs around
// additionalParameters "--no-version-vectors"
} }
dexOptions { dexOptions {
@ -34,11 +39,11 @@ android {
sourceSets { sourceSets {
main { main {
manifest.srcFile "AndroidManifest-library.xml" manifest.srcFile "AndroidManifest.xml"
jni.srcDirs = [] jni.srcDirs = []
jniLibs.srcDirs = ["libs"] jniLibs.srcDirs = ["libs"]
aidl.srcDirs = ["src"] aidl.srcDirs = ["src"]
java.srcDirs = ["src", "src-gms", "src-google"] java.srcDirs = ["src"]
resources.srcDirs = ["src"] resources.srcDirs = ["src"]
renderscript.srcDirs = ["src"] renderscript.srcDirs = ["src"]
res.srcDirs = ["res"] res.srcDirs = ["res"]
@ -95,20 +100,12 @@ android {
debug { debug {
debuggable true debuggable true
} }
release { release {
debuggable false debuggable false
} }
} }
} }
def replaceNoTranslate(line) {
if (line.contains("\"versionFeatures\"")) {
return line.replaceAll(">[^<]*<", ">" + "" + "<")
}
return line;
}
task updateNoTranslate(type: Copy) { task updateNoTranslate(type: Copy) {
from('.') { from('.') {
include 'no_translate.xml' include 'no_translate.xml'
@ -180,7 +177,7 @@ task collectHelpContentsAssets(type: Copy) {
include "*.html" include "*.html"
} }
from("../../help/website/blog_articles") { from("../../help/website/blog_articles") {
include "osmand-3-8-released.html" include "osmand-3-9-released.html"
} }
into "assets/feature_articles" into "assets/feature_articles"
} }
@ -277,8 +274,6 @@ task collectExternalResources {
// Legacy core build // Legacy core build
import org.apache.tools.ant.taskdefs.condition.Os import org.apache.tools.ant.taskdefs.condition.Os
import java.util.regex.Pattern
task buildOsmAndCore(type: Exec) { task buildOsmAndCore(type: Exec) {
Gradle gradle = getGradle() Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase() String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
@ -325,12 +320,6 @@ task cleanupDuplicatesInCore() {
} }
} }
afterEvaluate {
android.libraryVariants.all { variant ->
variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore)
}
}
task appStart(type: Exec) { task appStart(type: Exec) {
// linux // linux
commandLine 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity' commandLine 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity'
@ -338,27 +327,6 @@ task appStart(type: Exec) {
// commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity' // commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity'
} }
project.afterEvaluate {
publishing {
repositories {
ivy {
url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./"
version = "0.1-SNAPSHOT"
}
}
publications {
aar(IvyPublication) {
artifact bundleLegacyFatDebugAar {
classifier 'debug'
}
artifact bundleLegacyFatReleaseAar {
classifier 'release'
}
}
}
}
}
dependencies { dependencies {
implementation project(path: ':OsmAnd-java', configuration: 'android') implementation project(path: ':OsmAnd-java', configuration: 'android')
implementation project(':OsmAnd-api') implementation project(':OsmAnd-api')
@ -390,26 +358,18 @@ dependencies {
// implementation 'com.ibm.icu:icu4j:50.1' // implementation 'com.ibm.icu:icu4j:50.1'
// implementation 'net.sf.trove4j:trove4j:3.0.3' // implementation 'net.sf.trove4j:trove4j:3.0.3'
// qtcoreImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
// qtcoredebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
legacyImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar" legacyImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar"
// qtcoredebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"
// qtcoredebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar" implementation("com.getkeepsafe.taptargetview:taptargetview:1.12.0") {
// qtcoreImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
// qtcoreImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
implementation ("com.getkeepsafe.taptargetview:taptargetview:1.12.0"){
exclude group: 'com.android.support' exclude group: 'com.android.support'
} }
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1' implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'
implementation ("com.github.HITGIF:TextFieldBoxes:1.4.5"){ implementation("com.github.HITGIF:TextFieldBoxes:1.4.5") {
exclude group: 'com.android.support' exclude group: 'com.android.support'
} }
implementation('com.github.scribejava:scribejava-apis:7.1.1'){ implementation('com.github.scribejava:scribejava-apis:7.1.1') {
exclude group: "com.fasterxml.jackson.core" exclude group: "com.fasterxml.jackson.core"
} }
implementation 'com.jaredrummler:colorpicker:1.1.0' implementation 'com.jaredrummler:colorpicker:1.1.0'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.56' implementation 'org.bouncycastle:bcpkix-jdk15on:1.56'
implementation 'com.google.android.gms:play-services-location:17.1.0'
} }

View file

@ -0,0 +1,64 @@
apply plugin: 'com.android.library'
apply plugin: 'ivy-publish'
apply from: 'build-common.gradle'
android {
defaultConfig {
minSdkVersion 15
}
lintOptions {
tasks.lint.enabled = false
}
sourceSets {
main {
manifest.srcFile "AndroidManifest-library.xml"
java.srcDirs = ["src", "src-gms", "src-google"]
}
}
productFlavors {
// CoreVersion
// Build that doesn't include 3D OpenGL
legacy {
dimension "coreversion"
}
}
}
def replaceNoTranslate(line) {
return line;
}
afterEvaluate {
android.libraryVariants.all { variant ->
variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore)
}
}
project.afterEvaluate {
publishing {
repositories {
ivy {
url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./"
version = "0.1-SNAPSHOT"
}
}
publications {
aar(IvyPublication) {
artifact bundleLegacyFatDebugAar {
classifier 'debug'
}
artifact bundleLegacyFatReleaseAar {
classifier 'release'
}
}
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-location:17.1.0'
}

View file

@ -1,12 +1,12 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: 'build-common.gradle'
// Global Parameters accepted // Global Parameters accepted
// TARGET_APP_NAME - app name // TARGET_APP_NAME - app name
// APK_NUMBER_VERSION - version number of apk // APK_NUMBER_VERSION - version number of apk
// APK_VERSION_SUFFIX - build number like #99999Z, appended (for dev builds) to Manifest's versionName as X.X.X#99999Z // APK_VERSION_SUFFIX - build number like #99999Z, appended (for dev builds) to Manifest's versionName as X.X.X#99999Z
// Z means flavor: M=-master, D=-main-default, B=-Blackberry, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy // Z means flavor: M=-master, D=-main-default, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
// APP_EDITION - date stamp of builds // APP_EDITION - date stamp of builds
// APP_FEATURES - features +play_market +gps_status -parking_plugin -blackberry -free_version -amazon
// 1. To be done Filter fonts // 1. To be done Filter fonts
// <unzip src="OsmAndCore_android.aar" dest="."> // <unzip src="OsmAndCore_android.aar" dest=".">
@ -17,15 +17,7 @@ apply plugin: 'com.android.application'
// </unzip> // </unzip>
// Less important // Less important
task printc {
configurations.each { if(it.isCanBeResolved()) println it.name }
}
android { android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
// compileNdkVersion "android-ndk-r17b"
signingConfigs { signingConfigs {
development { development {
storeFile file("../keystores/debug.keystore") storeFile file("../keystores/debug.keystore")
@ -44,21 +36,15 @@ android {
defaultConfig { defaultConfig {
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 15 minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 15
targetSdkVersion 29
versionCode 390 versionCode 390
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
multiDexEnabled true
versionName "3.9.0" versionName "3.9.0"
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
// Stops the Gradle plugins automatic rasterization of vectors
// vectorDrawables.generatedDensities = ['hdpi']
vectorDrawables.useSupportLibrary = true
} }
lintOptions { lintOptions {
lintConfig file("lint.xml") lintConfig file("lint.xml")
abortOnError false
warningsAsErrors false warningsAsErrors false
} }
@ -79,55 +65,33 @@ android {
// exclude '/META-INF/NOTICE.md' // exclude '/META-INF/NOTICE.md'
//} //}
// This is from OsmAndCore_android.aar - for some reason it's not inherited
aaptOptions {
// Don't compress any embedded resources
noCompress "qz"
cruncherEnabled = false
// Flag notifies aapt to keep the attribute IDs around
// additionalParameters "--no-version-vectors"
}
dexOptions {
javaMaxHeapSize "4g"
}
sourceSets { sourceSets {
main {
manifest.srcFile "AndroidManifest.xml"
jni.srcDirs = []
jniLibs.srcDirs = ["libs"]
aidl.srcDirs = ["src"]
java.srcDirs = ["src"]
resources.srcDirs = ["src"]
renderscript.srcDirs = ["src"]
res.srcDirs = ["res"]
assets.srcDirs = ["assets"]
}
debug { debug {
manifest.srcFile "AndroidManifest-debug.xml" manifest.srcFile "AndroidManifest-debug.xml"
} }
full { androidFull {
java.srcDirs = ["src-nogms", "src-google"] java.srcDirs = ["src-nogms", "src-google"]
} }
fullGms { gplayFull {
java.srcDirs = ["src-gms", "src-google"] java.srcDirs = ["src-gms", "src-google"]
} }
free { gplayFree {
java.srcDirs = ["src-nogms", "src-google"]
manifest.srcFile "AndroidManifest-free.xml"
}
freeGms {
java.srcDirs = ["src-gms", "src-google"] java.srcDirs = ["src-gms", "src-google"]
manifest.srcFile "AndroidManifest-free.xml" manifest.srcFile "AndroidManifest-gplayFree.xml"
} }
freedev { nightlyFree {
java.srcDirs = ["src-nogms", "src-google"] java.srcDirs = ["src-nogms", "src-google"]
manifest.srcFile "AndroidManifest-freedev.xml" manifest.srcFile "AndroidManifest-nightlyFree.xml"
} }
freehuawei { amazonFree {
java.srcDirs = ["src-nogms", "src-google"] java.srcDirs = ["src-nogms", "src-google"]
manifest.srcFile "AndroidManifest-freehuawei.xml" }
amazonFull {
java.srcDirs = ["src-nogms", "src-google"]
}
huawei {
java.srcDirs = ["src-nogms", "src-google"]
manifest.srcFile "AndroidManifest-huawei.xml"
} }
legacy { legacy {
@ -137,75 +101,43 @@ android {
flavorDimensions "version", "coreversion", "abi" flavorDimensions "version", "coreversion", "abi"
productFlavors { productFlavors {
// ABI
armv7 {
dimension "abi"
ndk {
abiFilter 'armeabi-v7a'
}
}
arm64 {
dimension "abi"
ndk {
abiFilter 'arm64-v8a'
}
}
x86 {
dimension "abi"
ndk {
abiFilters 'x86', 'x86_64'
}
}
armonly {
dimension "abi"
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a'
}
}
fat {
dimension "abi"
ndk {
abiFilters 'arm64-v8a', 'x86', 'x86_64', 'armeabi-v7a'
}
}
// Version // Version
freedev { nightlyFree {
dimension "version" dimension "version"
applicationId "net.osmand.dev" applicationId "net.osmand.dev"
// resConfig "en" // resConfig "en"
} }
free { androidFull {
dimension "version"
applicationId "net.osmand"
}
freeGms {
dimension "version"
applicationId "net.osmand"
}
full {
dimension "version" dimension "version"
applicationId "net.osmand.plus" applicationId "net.osmand.plus"
} }
fullGms { gplayFree {
dimension "version"
applicationId "net.osmand"
}
gplayFull {
dimension "version" dimension "version"
applicationId "net.osmand.plus" applicationId "net.osmand.plus"
} }
freehuawei { amazonFree {
dimension "version"
applicationId "net.osmand"
}
amazonFull {
dimension "version"
applicationId "net.osmand.plus"
}
huawei {
dimension "version" dimension "version"
applicationId "net.osmand.huawei" applicationId "net.osmand.huawei"
} }
// CoreVersion
// Build that doesn't include 3D OpenGL
legacy {
dimension "coreversion"
}
// Build that includes 3D OpenGL release // Build that includes 3D OpenGL release
qtcore { opengl {
dimension "coreversion" dimension "coreversion"
} }
// Build that includes 3D OpenGL debug // Build that includes 3D OpenGL debug
qtcoredebug { opengldebug {
dimension "coreversion" dimension "coreversion"
} }
} }
@ -234,226 +166,9 @@ def replaceNoTranslate(line) {
if (line.contains("\"app_edition\"") && System.getenv("APP_EDITION")) { if (line.contains("\"app_edition\"") && System.getenv("APP_EDITION")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("APP_EDITION") + "<") return line.replaceAll(">[^<]*<", ">" + System.getenv("APP_EDITION") + "<")
} }
if (line.contains("\"versionFeatures\"") && System.getenv("APP_FEATURES")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("APP_FEATURES") + "<")
}
return line; return line;
} }
task updateNoTranslate(type: Copy) {
from('.') {
include 'no_translate.xml'
filter {
line -> replaceNoTranslate(line);
}
}
into 'res/values/'
}
task validateTranslate {
println "Validating translations"
file("res").eachFileRecurse groovy.io.FileType.FILES, {
if (it.name == "strings.xml" || it.name == "phrases.xml") {
it.eachLine { line ->
if (line.contains("\$ s") || line.contains("\$ d") || line.contains("\$ f") ||
line.contains(" \$s") || line.contains(" \$d") || line.contains(" \$f") ||
line.contains("1\$ ") || line.contains("2\$ ") || line.contains("3\$ ") ||
line.contains("%1s") || line.contains(" 1\$s") ||
(line.contains("% \$") || line.contains("% 1") || line.contains("% 2") ||
line.contains("% 3") || line.contains("% s"))) {
throw new GradleException("Incorrect translation " + it.getAbsolutePath() + " " + line);
}
}
}
}
}
task downloadWorldMiniBasemap {
doLast {
ant.get(src: 'http://builder.osmand.net/basemap/World_basemap_mini_2.obf', dest: 'assets/World_basemap_mini.obf', skipexisting: 'true')
}
}
task collectVoiceAssets(type: Sync) {
from "../../resources/voice"
into "assets/voice"
include "**/*.js"
}
task cleanNoTranslate(type: Delete) {
delete('res/values/no_translate.xml')
}
task collectFonts(type: Copy) {
from "../../resources/fonts"
from "../../resources/rendering_styles/fonts"
// from "../../resources/rendering_styles/fonts/OpenSans"
into "assets/fonts"
include "*.ttf"
}
task collectHelpContentsStyle(type: Copy) {
from("../../help/website/help/") {
include "style.css"
}
into "assets"
}
task collectHelpContentsAssets(type: Copy) {
from("../../help/website/help") {
include "about.html"
include "changes.html"
include "faq.html"
include "map-legend.html"
}
from("../../help/website/feature_articles") {
include "*.html"
}
from("../../help/website/blog_articles") {
include "osmand-3-9-released.html"
}
into "assets/feature_articles"
}
task copyPoiCategories(type: Copy) {
from("../../resources/poi") {
include "poi_categories.json"
}
into "assets"
}
task copyMapShaderIcons(type: Sync) {
// from "../../resources/rendering_styles/style-icons/map-shaders-png"
// into "res/"
from "../../resources/rendering_styles/style-icons/map-shaders-vector"
into "res/drawable"
include "**/*.png", "**/*.xml"
preserve {
include '**/*'
exclude "**/h_*"
}
}
task copyMapPOIIcons(type: Sync) {
from "../../resources/rendering_styles/style-icons/map-icons-vector"
into "res/drawable/"
// from "../../resources/rendering_styles/style-icons/map-icons-png"
// into "res/"
include "**/*.png", "**/*.xml"
preserve {
include '**/*'
exclude "**/mm_*"
}
}
task copyLargePOIIcons(type: Sync) {
from "../../resources/rendering_styles/style-icons/poi-icons-vector"
into "res/drawable/"
include "**/*.png", "**/*.xml"
preserve {
include '**/*'
exclude "**/mx_*"
}
}
task copyWidgetIconsXhdpi(type: Sync) {
from "res/drawable-xxhdpi/"
into "res/drawable-large-xhdpi/"
include "**/widget_*.png", "**/widget_*.xml", "**/map_*.xml", "**/map_*.png"
preserve {
include '*'
exclude "**/widget_*.png", "**/widget_*.xml", "**/map_*.xml", "**/map_*.png"
}
}
task copyWidgetIconsHdpi(type: Sync) {
from "res/drawable-xhdpi/"
into "res/drawable-large-hdpi/"
include "**/widget_*.png", "**/widget_*.xml", "**/map_*.xml", "**/map_*.png"
preserve {
include '*'
exclude "**/widget_*.png", "**/widget_*.xml", "**/map_*.xml", "**/map_*.png"
}
}
task copyWidgetIcons(type: Sync) {
from "res/drawable-hdpi/"
into "res/drawable-large/"
include "**/widget_*.png", "**/widget_*.xml", "**/map_*.xml", "**/map_*.png"
preserve {
include '*'
exclude "**/widget_*.png", "**/widget_*.xml", "**/map_*.xml", "**/map_*.png"
}
}
task collectExternalResources {
dependsOn collectVoiceAssets,
collectFonts,
collectHelpContentsAssets,
collectHelpContentsStyle,
copyMapShaderIcons,
copyMapPOIIcons,
copyLargePOIIcons,
updateNoTranslate,
validateTranslate,
copyWidgetIcons,
copyWidgetIconsHdpi,
copyWidgetIconsXhdpi,
copyPoiCategories,
downloadWorldMiniBasemap
}
// Legacy core build
import org.apache.tools.ant.taskdefs.condition.Os
task buildOsmAndCore(type: Exec) {
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
String flavour = "";
if(!tskReqStr.contains("fat")) {
if(tskReqStr.contains("arm64")) {
flavour = flavour.length() == 0 ? "ARM64_ONLY" : ""
}
if(tskReqStr.contains("armv7")) {
flavour = flavour.length() == 0 ? "ARMV7_ONLY" : ""
}
if(tskReqStr.contains("armonly")) {
flavour = flavour.length() == 0 ? "ARM_ONLY" : ""
}
if(tskReqStr.contains("x86")) {
flavour = flavour.length() == 0 ? "X86_ONLY" : ""
}
}
description "Build Legacy OsmAndCore"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
if(flavour.length() > 0) {
environment "$flavour", "1"
}
commandLine "bash", file("./old-ndk-build.sh").getAbsolutePath()
} else {
commandLine "cmd", "/c", "echo", "Not supported"
}
}
task cleanupDuplicatesInCore() {
dependsOn buildOsmAndCore
// doesn't work for legacy debug builds
doLast {
file("libc++/armeabi-v7a").mkdirs()
file("libs/armeabi-v7a/libc++_shared.so").renameTo(file("libc++/armeabi-v7a/libc++_shared.so"))
file("libc++/arm64-v8a").mkdirs()
file("libs/arm64-v8a/libc++_shared.so").renameTo(file("libc++/arm64-v8a/libc++_shared.so"))
file("libc++/x86").mkdirs()
file("libs/x86/libc++_shared.so").renameTo(file("libc++/x86/libc++_shared.so"))
file("libc++/x86_64").mkdirs()
file("libs/x86_64/libc++_shared.so").renameTo(file("libc++/x86_64/libc++_shared.so"))
}
}
afterEvaluate { afterEvaluate {
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore) variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore)
@ -465,52 +180,14 @@ afterEvaluate {
} }
} }
task appStart(type: Exec) {
// linux
commandLine 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity'
// windows
// commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity'
}
dependencies { dependencies {
implementation project(path: ':OsmAnd-java', configuration: 'android') openglImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
implementation project(':OsmAnd-api') opengldebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
implementation fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs')
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2' opengldebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"
implementation 'commons-codec:commons-codec:1.11' opengldebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
implementation 'it.unibo.alice.tuprolog:tuprolog:3.2.1' openglImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
implementation 'org.apache.commons:commons-compress:1.17' openglImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
implementation 'com.moparisthebest:junidecode:0.1.1'
implementation 'org.immutables:gson:2.5.0'
implementation 'com.vividsolutions:jts-core:1.14.0'
implementation 'com.google.openlocationcode:openlocationcode:1.0.4'
implementation 'com.android.billingclient:billing:2.0.3'
// turn off for now
//implementation 'com.atilika.kuromoji:kuromoji-ipadic:0.9.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'me.zhanghai.android.materialprogressbar:library:1.4.2'
// JS core
implementation group: 'org.mozilla', name: 'rhino', version: '1.7.9'
// size restrictions
// implementation 'com.ibm.icu:icu4j:50.1'
// implementation 'net.sf.trove4j:trove4j:3.0.3'
qtcoreImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
qtcoredebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
legacyImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar"
qtcoredebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"
qtcoredebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
qtcoreImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
qtcoreImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
implementation ("com.getkeepsafe.taptargetview:taptargetview:1.12.0"){ implementation ("com.getkeepsafe.taptargetview:taptargetview:1.12.0"){
exclude group: 'com.android.support' exclude group: 'com.android.support'
} }
@ -524,8 +201,8 @@ dependencies {
implementation 'com.jaredrummler:colorpicker:1.1.0' implementation 'com.jaredrummler:colorpicker:1.1.0'
implementation "org.bouncycastle:bcpkix-jdk15on:1.56" implementation "org.bouncycastle:bcpkix-jdk15on:1.56"
freehuaweiImplementation 'com.huawei.hms:iap:5.0.2.300' huaweiImplementation 'com.huawei.hms:iap:5.0.2.300'
freeGmsImplementation 'com.google.android.gms:play-services-location:17.1.0' gplayFreeImplementation 'com.google.android.gms:play-services-location:17.1.0'
fullGmsImplementation 'com.google.android.gms:play-services-location:17.1.0' gplayFullImplementation 'com.google.android.gms:play-services-location:17.1.0'
} }

View file

@ -12,7 +12,6 @@
<string name="ga_api_key">UA-28342846-2</string> <string name="ga_api_key">UA-28342846-2</string>
<string name="ga_dispatchPeriod">10</string> <string name="ga_dispatchPeriod">10</string>
<string name="ga_debug">true</string> <string name="ga_debug">true</string>
<string name="versionFeatures">+play_market -amazon -blackberry</string>
<string name="openstreetmap_copyright"><a href="https://www.openstreetmap.org/copyright">&#169; OpenStreetMap</a></string> <string name="openstreetmap_copyright"><a href="https://www.openstreetmap.org/copyright">&#169; OpenStreetMap</a></string>
<string name="app_edition"></string> <string name="app_edition"></string>
<string name="support_email">support@osmand.net</string> <string name="support_email">support@osmand.net</string>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M9,3H7V8H4L8,13L12,8H9V3Z"
android:fillColor="#ffffff"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M9,13H7V8H4L8,3L12,8H9V13Z"
android:fillColor="#ffffff"/>
</vector>

View file

@ -4030,4 +4030,9 @@
<string name="select_folder">تحديد مجلد</string> <string name="select_folder">تحديد مجلد</string>
<string name="select_folder_descr">تحديد مجلد أو إضافة واحد جديد</string> <string name="select_folder_descr">تحديد مجلد أو إضافة واحد جديد</string>
<string name="shared_string_empty">فارغ</string> <string name="shared_string_empty">فارغ</string>
<string name="analyze_by_intervals">التحليل حسب الفواصل الزمنية (الفاصل الزمني)</string>
<string name="upload_to_openstreetmap">رفع إلى خريطة الشارع المفتوح</string>
<string name="edit_track">تحرير المسار</string>
<string name="rename_track">تسمية المسار</string>
<string name="change_folder">تغيير المجلد</string>
</resources> </resources>

View file

@ -3967,4 +3967,9 @@
<string name="select_folder">Zvolte složku</string> <string name="select_folder">Zvolte složku</string>
<string name="select_folder_descr">Zvolte složku nebo vytvořte novou</string> <string name="select_folder_descr">Zvolte složku nebo vytvořte novou</string>
<string name="shared_string_empty">Prázdné</string> <string name="shared_string_empty">Prázdné</string>
<string name="analyze_by_intervals">Analyzovat podle intervalů (rozdělit interval)</string>
<string name="upload_to_openstreetmap">Nahrát do OpenStreetMap</string>
<string name="edit_track">Editovat stopu</string>
<string name="rename_track">Přejmenovat stopu</string>
<string name="change_folder">Změnit složku</string>
</resources> </resources>

View file

@ -3972,4 +3972,9 @@
<string name="select_folder">Ordner auswählen</string> <string name="select_folder">Ordner auswählen</string>
<string name="select_folder_descr">Ordner auswählen oder neuen hinzufügen</string> <string name="select_folder_descr">Ordner auswählen oder neuen hinzufügen</string>
<string name="shared_string_empty">Leer</string> <string name="shared_string_empty">Leer</string>
<string name="analyze_by_intervals">Nach Intervallen auswerten (geteiltes Intervall)</string>
<string name="upload_to_openstreetmap">Hochladen zu OpenStreetMap</string>
<string name="edit_track">Track editieren</string>
<string name="rename_track">Track umbenennen</string>
<string name="change_folder">Ordner ändern</string>
</resources> </resources>

View file

@ -233,7 +233,7 @@
<string name="shared_string_trip_recording">Registrado de kurso</string> <string name="shared_string_trip_recording">Registrado de kurso</string>
<string name="shared_string_navigation">Navigi</string> <string name="shared_string_navigation">Navigi</string>
<string name="osmand_running_in_background">Labori fone</string> <string name="osmand_running_in_background">Labori fone</string>
<string name="gps_wake_up_timer">Vek-intervalo de GPS</string> <string name="gps_wake_up_timer">Vek-ofteco de GPS</string>
<string name="favourites_edit_dialog_title">Informoj pri ŝatataj</string> <string name="favourites_edit_dialog_title">Informoj pri ŝatataj</string>
<string name="simulate_your_location_stop_descr">Ĉesigi simuladon de pozicio.</string> <string name="simulate_your_location_stop_descr">Ĉesigi simuladon de pozicio.</string>
<string name="simulate_your_location_descr">Simuli vian pozicion uzante komputitan kurson aŭ registritan GPX-spuron.</string> <string name="simulate_your_location_descr">Simuli vian pozicion uzante komputitan kurson aŭ registritan GPX-spuron.</string>
@ -587,17 +587,17 @@
<string name="sleep_mode_stop_dialog">Ĉu ĉesigi GPS-an fonan reĝimon?</string> <string name="sleep_mode_stop_dialog">Ĉu ĉesigi GPS-an fonan reĝimon?</string>
<string name="stop_navigation_service">Ĉesigi</string> <string name="stop_navigation_service">Ĉesigi</string>
<string name="confirm_every_run">Demandi ĉiam</string> <string name="confirm_every_run">Demandi ĉiam</string>
<string name="save_global_track_interval">Ĝenerala registrada intervalo</string> <string name="save_global_track_interval">Ĝenerala intertempo de registrado</string>
<string name="background_service_int">GPS-a vekintervalo</string> <string name="background_service_int">Vek-ofteco de GPS</string>
<string name="enable_sleep_mode">Aktivigi GPS-an fonan reĝimon</string> <string name="enable_sleep_mode">Aktivigi GPS-an fonan reĝimon</string>
<string name="save_track_to_gpx_globally_headline">Registri spuron laŭpete</string> <string name="save_track_to_gpx_globally_headline">Registri spuron laŭpete</string>
<string name="save_track_to_gpx_globally_descr">Ĝeneralan registradon de pozicio al GPXdosiero oni povas (mal)aktivigi per la GPXregistrada fenestraĵo sur la mapekrano.</string> <string name="save_track_to_gpx_globally_descr">Ĝeneralan registradon de pozicio al GPXdosiero oni povas (mal)aktivigi per la GPXregistrada fenestraĵo sur la mapekrano.</string>
<string name="save_current_track_descr">Konservi aktualan spuron kiel GPX-dosieron.</string> <string name="save_current_track_descr">Konservi aktualan spuron kiel GPX-dosieron.</string>
<string name="save_current_track">Konservi aktualan spuron</string> <string name="save_current_track">Konservi aktualan spuron</string>
<string name="save_track_to_gpx_descrp">GPX-spuro estas aŭtomate konservata al dosierujo de spuroj dum navigado.</string> <string name="save_track_to_gpx_descrp">GPX-spuro estas aŭtomate konservata al dosierujo de spuroj dum navigado.</string>
<string name="save_track_interval_globally">Registrada intervalo</string> <string name="save_track_interval_globally">Intertempo de registrado</string>
<string name="save_track_interval">Registrada intervalo dum navigado</string> <string name="save_track_interval">Registrada intertempo dum navigado</string>
<string name="save_track_interval_descr">Elekti intervalon por registri spurojn dum navigado</string> <string name="save_track_interval_descr">Elekti oftecon de registri spuron dum navigado</string>
<string name="voice_provider_descr">Elekti gvidadan voĉon por navigado.</string> <string name="voice_provider_descr">Elekti gvidadan voĉon por navigado.</string>
<string name="voice_provider">Gvidada voĉo</string> <string name="voice_provider">Gvidada voĉo</string>
<string name="enable_proxy_title">Aktivigi HTTP-retperanton</string> <string name="enable_proxy_title">Aktivigi HTTP-retperanton</string>
@ -654,7 +654,7 @@
<string name="select_index_file_to_download">Trovis nenion. Se vi ne povas trovi vian regionon, vi povas fari ĝin mem (rigardu https://osmand.net).</string> <string name="select_index_file_to_download">Trovis nenion. Se vi ne povas trovi vian regionon, vi povas fari ĝin mem (rigardu https://osmand.net).</string>
<string name="none_selected_gpx">Unue elektu GPXdosieron per frapetadi.</string> <string name="none_selected_gpx">Unue elektu GPXdosieron per frapetadi.</string>
<string name="local_index_select_gpx_file">Elektu kurson</string> <string name="local_index_select_gpx_file">Elektu kurson</string>
<string name="gpx_split_interval">Divid-intervalo</string> <string name="gpx_split_interval">Intertempo de divido</string>
<string name="sort_by_distance">Ordigi laŭ distanco</string> <string name="sort_by_distance">Ordigi laŭ distanco</string>
<string name="sort_by_name">Ordigi laŭ nomo</string> <string name="sort_by_name">Ordigi laŭ nomo</string>
<string name="plugin_touringview_name">Turisma map-vido</string> <string name="plugin_touringview_name">Turisma map-vido</string>
@ -728,8 +728,8 @@
<string name="gpx_info_average_speed">Mezuma rapido: %1$s</string> <string name="gpx_info_average_speed">Mezuma rapido: %1$s</string>
<string name="gpx_info_maximum_speed">Maksimuma rapido: %1$s</string> <string name="gpx_info_maximum_speed">Maksimuma rapido: %1$s</string>
<string name="gpx_info_avg_altitude">Mezuma altitudo: %1$s</string> <string name="gpx_info_avg_altitude">Mezuma altitudo: %1$s</string>
<string name="gpx_info_diff_altitude">Altituda intervalo: %1$s</string> <string name="gpx_info_diff_altitude">Variejo de altitudo: %1$s</string>
<string name="gpx_timespan">Tempa intervalo: %1$s</string> <string name="gpx_timespan">Variejo de tempo: %1$s</string>
<string name="gpx_info_asc_altitude">Desupro/alsupro: %1$s</string> <string name="gpx_info_asc_altitude">Desupro/alsupro: %1$s</string>
<string name="gpx_timemoving">Tempo movante: %1$s</string> <string name="gpx_timemoving">Tempo movante: %1$s</string>
<string name="gpx_selection_segment_title">Segmento</string> <string name="gpx_selection_segment_title">Segmento</string>
@ -1121,7 +1121,7 @@
<string name="bg_service_screen_lock_toast">Ekrano ŝlosita</string> <string name="bg_service_screen_lock_toast">Ekrano ŝlosita</string>
<string name="map_widget_mini_route">Kurs-mapeto</string> <string name="map_widget_mini_route">Kurs-mapeto</string>
<string name="show_cameras">Rapid-kontroliloj</string> <string name="show_cameras">Rapid-kontroliloj</string>
<string name="bg_service_interval">Agordi vekintervalon:</string> <string name="bg_service_interval">Agordi vekoftecon:</string>
<string name="show_traffic_warnings">Trafikaj avertoj</string> <string name="show_traffic_warnings">Trafikaj avertoj</string>
<string name="avoid_toll_roads">Sen pagendaj vojoj</string> <string name="avoid_toll_roads">Sen pagendaj vojoj</string>
<string name="continue_follow_previous_route_auto">Ĉu pluigi sekvi la antaŭan nefinitan kurson? (%1$s sekundoj)</string> <string name="continue_follow_previous_route_auto">Ĉu pluigi sekvi la antaŭan nefinitan kurson? (%1$s sekundoj)</string>
@ -1291,8 +1291,8 @@
<string name="local_openstreetmap_descr_title">Neunutempa (nesinkrona) redakto de OSM:</string> <string name="local_openstreetmap_descr_title">Neunutempa (nesinkrona) redakto de OSM:</string>
<string name="local_openstreetmap_settings">OSM-interesejoj/rimarkoj konservitaj en aparato</string> <string name="local_openstreetmap_settings">OSM-interesejoj/rimarkoj konservitaj en aparato</string>
<string name="local_openstreetmap_settings_descr">Vidi kaj administri loke konservitajn OSMinteresejojn/rimarkojn.</string> <string name="local_openstreetmap_settings_descr">Vidi kaj administri loke konservitajn OSMinteresejojn/rimarkojn.</string>
<string name="live_monitoring_interval">Intervalo de enreta kurs-registrado</string> <string name="live_monitoring_interval">Ofteco de enreta kursregistrado</string>
<string name="live_monitoring_interval_descr">Difini intervalon de enreta kurs-registrado.</string> <string name="live_monitoring_interval_descr">Difini oftecon de enreta registrado de kurso.</string>
<string name="live_monitoring_url">Adreso de enreta kurs-registrado</string> <string name="live_monitoring_url">Adreso de enreta kurs-registrado</string>
<string name="live_monitoring_url_descr">Difini la retadreson uzante la jenajn argumentojn: <string name="live_monitoring_url_descr">Difini la retadreson uzante la jenajn argumentojn:
\n lat={0} (latitudo), \n lat={0} (latitudo),
@ -2172,7 +2172,7 @@
<string name="route_altitude">Kursa altitudo</string> <string name="route_altitude">Kursa altitudo</string>
<string name="altitude_descent">Malsupreniro</string> <string name="altitude_descent">Malsupreniro</string>
<string name="altitude_ascent">Supreniro</string> <string name="altitude_ascent">Supreniro</string>
<string name="altitude_range">Altituda intervalo</string> <string name="altitude_range">Variejo de altitudo</string>
<string name="average_altitude">Mezuma altitudo</string> <string name="average_altitude">Mezuma altitudo</string>
<string name="shared_string_time">Tempo</string> <string name="shared_string_time">Tempo</string>
<string name="total_distance">Tuta distanco</string> <string name="total_distance">Tuta distanco</string>
@ -3810,7 +3810,7 @@
\n \n
\n</string> \n</string>
<string name="monitoring_control_start">Registri</string> <string name="monitoring_control_start">Registri</string>
<string name="save_global_track_interval_descr">Elektu la intervalon de registrado por la ĝenerala registrado de spuro (aktivigebla per la fenestraĵo “registri spuron” sur la mapo).</string> <string name="save_global_track_interval_descr">Elektu la intertempon de registrado por la ĝenerala registrado de spuro (aktivigebla per la fenestraĵo “registri spuron” sur la mapo).</string>
<string name="simplified_track">Simpligita spuro</string> <string name="simplified_track">Simpligita spuro</string>
<string name="simplified_track_description">Nur la linio de kurso estos konservita, la navigadpunktoj estos forigitaj.</string> <string name="simplified_track_description">Nur la linio de kurso estos konservita, la navigadpunktoj estos forigitaj.</string>
<string name="shared_string_file_name">Dosiernomo</string> <string name="shared_string_file_name">Dosiernomo</string>
@ -3967,4 +3967,9 @@
<string name="select_folder">Elekti dosierujon</string> <string name="select_folder">Elekti dosierujon</string>
<string name="select_folder_descr">Elekti dosierujon aŭ krei novan</string> <string name="select_folder_descr">Elekti dosierujon aŭ krei novan</string>
<string name="shared_string_empty">Malplena</string> <string name="shared_string_empty">Malplena</string>
<string name="analyze_by_intervals">Analizi laŭ intertempoj (dividoj)</string>
<string name="upload_to_openstreetmap">Alŝuti al OpenStreetMap</string>
<string name="edit_track">Redakti spuron</string>
<string name="rename_track">Renomi spuron</string>
<string name="change_folder">Ŝanĝi dosierujon</string>
</resources> </resources>

View file

@ -3966,4 +3966,13 @@
<string name="copy_address">Copiar dirección</string> <string name="copy_address">Copiar dirección</string>
<string name="online_routing_engine">Motor de navegación en línea</string> <string name="online_routing_engine">Motor de navegación en línea</string>
<string name="online_routing_engines">Motores de navegación en línea</string> <string name="online_routing_engines">Motores de navegación en línea</string>
<string name="shared_string_folders">Carpetas</string>
<string name="select_folder">Elegir carpeta</string>
<string name="select_folder_descr">Elegir carpeta o añadir una nueva</string>
<string name="shared_string_empty">Vacío</string>
<string name="analyze_by_intervals">Analizar por intervalos (intervalo de división)</string>
<string name="upload_to_openstreetmap">Subir a OpenStreetMap</string>
<string name="edit_track">Editar traza</string>
<string name="rename_track">Renombrar traza</string>
<string name="change_folder">Cambiar carpeta</string>
</resources> </resources>

View file

@ -3948,4 +3948,31 @@
<string name="profile_type_osmand_string">Perfil de OsmAnd</string> <string name="profile_type_osmand_string">Perfil de OsmAnd</string>
<string name="profile_by_default_description">Elige el perfil que será usado al iniciar la aplicación.</string> <string name="profile_by_default_description">Elige el perfil que será usado al iniciar la aplicación.</string>
<string name="voice_prompts_timetable">Tiempo de indicaciones por voz</string> <string name="voice_prompts_timetable">Tiempo de indicaciones por voz</string>
<string name="select_folder">Elegir carpeta</string>
<string name="shared_string_folders">Carpetas</string>
<string name="change_folder">Cambiar carpeta</string>
<string name="add_online_routing_engine"></string>
<string name="edit_online_routing_engine"></string>
<string name="shared_string_subtype"></string>
<string name="shared_string_vehicle"></string>
<string name="shared_string_api_key"></string>
<string name="shared_string_server_url"></string>
<string name="shared_string_enter_param"></string>
<string name="keep_it_empty_if_not"></string>
<string name="online_routing_example_hint"></string>
<string name="test_route_calculation"></string>
<string name="routing_engine_vehicle_type_driving"></string>
<string name="routing_engine_vehicle_type_foot"></string>
<string name="routing_engine_vehicle_type_bike"></string>
<string name="routing_engine_vehicle_type_car"></string>
<string name="message_error_recheck_parameters"></string>
<string name="copy_address"></string>
<string name="online_routing_engine"></string>
<string name="online_routing_engines"></string>
<string name="select_folder_descr"></string>
<string name="shared_string_empty"></string>
<string name="analyze_by_intervals"></string>
<string name="upload_to_openstreetmap"></string>
<string name="edit_track"></string>
<string name="rename_track"></string>
</resources> </resources>

View file

@ -1097,7 +1097,7 @@
<string name="lang_id">Indonesiano</string> <string name="lang_id">Indonesiano</string>
<string name="lang_it">Italiano</string> <string name="lang_it">Italiano</string>
<string name="lang_ja">Giapponese</string> <string name="lang_ja">Giapponese</string>
<string name="lang_ko">Koreano</string> <string name="lang_ko">Coreano</string>
<string name="lang_lv">Lettone</string> <string name="lang_lv">Lettone</string>
<string name="lang_lt">Lituano</string> <string name="lang_lt">Lituano</string>
<string name="lang_mr">Marathi</string> <string name="lang_mr">Marathi</string>

View file

@ -2757,4 +2757,14 @@
<string name="rendering_attr_surface_fine_gravel_name">ქვიშა</string> <string name="rendering_attr_surface_fine_gravel_name">ქვიშა</string>
<string name="rendering_attr_surface_paving_stones_name">ხრეში</string> <string name="rendering_attr_surface_paving_stones_name">ხრეში</string>
<string name="rendering_attr_surface_grass_paver_name">ბალახიანი</string> <string name="rendering_attr_surface_grass_paver_name">ბალახიანი</string>
<string name="items_added">დამატებულია</string>
<string name="profile_type_custom_string">მორგებული პროფილი</string>
<string name="multimedia_rec_split_title">ჩანაწერის გაყოფა</string>
<string name="rendering_value_walkingRoutesOSMCNodes_name">უჯრედული ქსელები</string>
<string name="layer_osm_edits">OSM ჩასწორებები</string>
<string name="shared_string_osmand_usage">OsmAnd-ის გამოყენება</string>
<string name="gpx_join_gaps">ღრეჩოების შეერთება</string>
<string name="quick_action_add_create_items">შექმნა</string>
<string name="custom_search">მორგებული ძებნა</string>
<string name="shared_string_empty">ცარიელი</string>
</resources> </resources>

View file

@ -3864,4 +3864,21 @@
<string name="routing_attr_allow_streams_name">Tillat bekker og avløp</string> <string name="routing_attr_allow_streams_name">Tillat bekker og avløp</string>
<string name="routing_attr_allow_intermittent_name">Tillat periodiske vannveier</string> <string name="routing_attr_allow_intermittent_name">Tillat periodiske vannveier</string>
<string name="routing_attr_allow_intermittent_description">Tillat periodiske vannveier</string> <string name="routing_attr_allow_intermittent_description">Tillat periodiske vannveier</string>
<string name="shared_string_vehicle">Kjøretøy</string>
<string name="shared_string_api_key">API-nøkkel</string>
<string name="shared_string_server_url">Tjenernettadresse</string>
<string name="test_route_calculation">Test rutekalkulering</string>
<string name="routing_engine_vehicle_type_driving">Kjøring</string>
<string name="routing_engine_vehicle_type_foot">Til fots</string>
<string name="routing_engine_vehicle_type_bike">Sykkel</string>
<string name="routing_engine_vehicle_type_car">Bil</string>
<string name="copy_address">Kopier adresse</string>
<string name="shared_string_folders">Mapper</string>
<string name="select_folder">Velg mappe</string>
<string name="select_folder_descr">Velg mappe eller legg til en ny</string>
<string name="shared_string_empty">Tom</string>
<string name="edit_track">Rediger spor</string>
<string name="upload_to_openstreetmap">Last opp til OpenStreetMap</string>
<string name="rename_track">Gi spor nytt navn</string>
<string name="change_folder">Endre mappe</string>
</resources> </resources>

View file

@ -3962,4 +3962,9 @@
<string name="select_folder">Selecione a pasta</string> <string name="select_folder">Selecione a pasta</string>
<string name="select_folder_descr">Selecione a pasta ou adicione uma nova</string> <string name="select_folder_descr">Selecione a pasta ou adicione uma nova</string>
<string name="shared_string_empty">Vazio</string> <string name="shared_string_empty">Vazio</string>
<string name="analyze_by_intervals">Analisar por intervalos (intervalo de divisão)</string>
<string name="upload_to_openstreetmap">Carregar para OpenStreetMap</string>
<string name="edit_track">Editar trilha</string>
<string name="rename_track">Renomear trilha</string>
<string name="change_folder">Mudar pasta</string>
</resources> </resources>

View file

@ -3934,4 +3934,30 @@
\n• Cores personalizadas para favoritos e pontos de rotas de trilhos \n• Cores personalizadas para favoritos e pontos de rotas de trilhos
\n \n
\n</string> \n</string>
<string name="edit_online_routing_engine">Editar o mecanismo de roteamento online</string>
<string name="shared_string_subtype">Subtipo</string>
<string name="shared_string_vehicle">Veículo</string>
<string name="shared_string_api_key">Chave de API</string>
<string name="shared_string_server_url">URL do servidor</string>
<string name="shared_string_enter_param">Digite o param</string>
<string name="keep_it_empty_if_not">Mantenha-o vazio se não</string>
<string name="online_routing_example_hint">O URL com todos os parâmetros parecerá-se assim:</string>
<string name="test_route_calculation">Cálculo da rota de teste</string>
<string name="routing_engine_vehicle_type_driving">Condução</string>
<string name="routing_engine_vehicle_type_foot"></string>
<string name="routing_engine_vehicle_type_bike">Bicicleta</string>
<string name="routing_engine_vehicle_type_car">Carro</string>
<string name="message_error_recheck_parameters">Erro, verifique novamente os parâmetros</string>
<string name="copy_address">Copiar endereço</string>
<string name="online_routing_engine">Mecanismo de roteamento online</string>
<string name="online_routing_engines">Mecanismos de roteamento online</string>
<string name="shared_string_folders">Pastas</string>
<string name="select_folder">Selecionar pasta</string>
<string name="select_folder_descr">Selecione a pasta ou adicione uma</string>
<string name="shared_string_empty">Vazio</string>
<string name="analyze_by_intervals">Analisar por intervalos (intervalo dividido)</string>
<string name="upload_to_openstreetmap">Enviar ao OpenStreetMap</string>
<string name="edit_track">Editar trilho</string>
<string name="rename_track">Renomear trilho</string>
<string name="change_folder">Mudar pasta</string>
</resources> </resources>

View file

@ -1200,7 +1200,7 @@
<string name="recording_context_menu_precord">Сделать фото</string> <string name="recording_context_menu_precord">Сделать фото</string>
<string name="dropbox_plugin_description">Синхронизация треков и медиазаметок с вашим аккаунтом Dropbox.</string> <string name="dropbox_plugin_description">Синхронизация треков и медиазаметок с вашим аккаунтом Dropbox.</string>
<string name="dropbox_plugin_name">Плагин Dropbox</string> <string name="dropbox_plugin_name">Плагин Dropbox</string>
<string name="osmand_srtm_long_description_1000_chars">Плагин обеспечивает наложение контурных линии и затемняющего слоя (рельефа), которые будут отображаться поверх стандартных карт OsmAnd. Эту функцию оценят спортсмены, туристы, путешественники и все, для кого рельеф местности имеет значение. <string name="osmand_srtm_long_description_1000_chars">Плагин обеспечивает наложение контурных линий и затемняющего слоя (рельефа), которые будут отображаться поверх стандартных карт OsmAnd. Эту функцию оценят спортсмены, туристы, путешественники и все, для кого рельеф местности имеет значение.
\n \n
\nГлобальные данные (между 70° на севере и 70° на юге) основываются на измерениях SRTM (Shuttle Radar Topography Mission) и ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), инструментом визуализации Terra, флагманского спутника Земли системы наблюдения NASA. ASTER является результатом совместных усилий NASA, министерства экономики Японии, торговли и промышленности (METI), космических систем Японии (J-spacesystems).</string> \nГлобальные данные (между 70° на севере и 70° на юге) основываются на измерениях SRTM (Shuttle Radar Topography Mission) и ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), инструментом визуализации Terra, флагманского спутника Земли системы наблюдения NASA. ASTER является результатом совместных усилий NASA, министерства экономики Японии, торговли и промышленности (METI), космических систем Японии (J-spacesystems).</string>
<string name="recording_photo_description">Фото %1$s %2$s</string> <string name="recording_photo_description">Фото %1$s %2$s</string>
@ -2552,7 +2552,7 @@
\n• Пошаговые голосовые подсказки (записанные или синтезированные голоса) \n• Пошаговые голосовые подсказки (записанные или синтезированные голоса)
\n• Полосы движения, отображение названия улицы и приблизительное время прибытия \n• Полосы движения, отображение названия улицы и приблизительное время прибытия
\n• Поддержка промежуточных точек на вашем маршруте \n• Поддержка промежуточных точек на вашем маршруте
\n• Автоматическое перестройка маршрута при отклонении от существующего \n• Автоматическая перестройка маршрута при отклонении от существующего
\n• Поиск мест по адресу, типу (например, ресторан, гостиница, заправка, музей) или географическим координатам \n• Поиск мест по адресу, типу (например, ресторан, гостиница, заправка, музей) или географическим координатам
\n</string> \n</string>
<string name="osmand_plus_extended_description_part3">Просмотр карты <string name="osmand_plus_extended_description_part3">Просмотр карты
@ -2595,7 +2595,7 @@
\n</string> \n</string>
<string name="osmand_plus_extended_description_part6">Возможности для пешеходов и велосипедистов <string name="osmand_plus_extended_description_part6">Возможности для пешеходов и велосипедистов
\n• Просмотр пешеходных, туристических и велосипедных дорожек, прекрасно подходит для активного отдыха \n• Просмотр пешеходных, туристических и велосипедных дорожек, прекрасно подходит для активного отдыха
\n• Специальный режимы маршрутизации и отображения для велосипедистов и пешеходов \n• Специальные режимы маршрутизации и отображения для велосипедистов и пешеходов
\n• Возможность отображения остановок общественного транспорта (автобус, трамвай, поезд), включая названия маршрутов \n• Возможность отображения остановок общественного транспорта (автобус, трамвай, поезд), включая названия маршрутов
\n• Возможность записи путешествие в локальный файл GPX или интернет-сервис \n• Возможность записи путешествие в локальный файл GPX или интернет-сервис
\n• Возможность отображения скорости и высоты \n• Возможность отображения скорости и высоты

View file

@ -3962,4 +3962,9 @@
<string name="select_folder">Zvoľte priečinok</string> <string name="select_folder">Zvoľte priečinok</string>
<string name="select_folder_descr">Zvoľte priečinok alebo pridajte nový</string> <string name="select_folder_descr">Zvoľte priečinok alebo pridajte nový</string>
<string name="shared_string_empty">Prázdne</string> <string name="shared_string_empty">Prázdne</string>
<string name="analyze_by_intervals">Analyzovať podľa intervalov (rozdeliť interval)</string>
<string name="upload_to_openstreetmap">Nahrať do OpenStreetMap</string>
<string name="edit_track">Upraviť stopu</string>
<string name="rename_track">Premenovať stopu</string>
<string name="change_folder">Zmeniť priečinok</string>
</resources> </resources>

View file

@ -3960,4 +3960,9 @@
<string name="select_folder">選取資料夾</string> <string name="select_folder">選取資料夾</string>
<string name="select_folder_descr">選取資料夾或新增</string> <string name="select_folder_descr">選取資料夾或新增</string>
<string name="shared_string_empty"></string> <string name="shared_string_empty"></string>
<string name="analyze_by_intervals">按時間間隔分析(分割時間間隔)</string>
<string name="upload_to_openstreetmap">上傳到 OpenStreetMap</string>
<string name="edit_track">編輯軌跡</string>
<string name="rename_track">重新命名軌跡</string>
<string name="change_folder">變更資料夾</string>
</resources> </resources>

View file

@ -54,7 +54,7 @@
<item name="android:windowBackground">@drawable/first_splash_screen_free</item> <item name="android:windowBackground">@drawable/first_splash_screen_free</item>
</style> </style>
<style name="FirstSplashScreenFreeDev" parent="SplashScreenBaseTheme"> <style name="FirstSplashScreenNightlyFree" parent="SplashScreenBaseTheme">
<item name="android:windowBackground">@drawable/first_splash_screen_free_dev</item> <item name="android:windowBackground">@drawable/first_splash_screen_free_dev</item>
</style> </style>

View file

@ -131,15 +131,17 @@ public class LocationServiceHelperImpl extends LocationServiceHelper {
} }
@Nullable @Nullable
public net.osmand.Location getFirstTimeRunDefaultLocation() { public net.osmand.Location getFirstTimeRunDefaultLocation(@Nullable final LocationCallback locationCallback) {
final net.osmand.Location[] location = {null}; if (locationCallback == null) {
/* return null;
}
try { try {
Task<Location> lastLocation = fusedLocationProviderClient.getLastLocation(); Task<Location> lastLocation = fusedLocationProviderClient.getLastLocation();
lastLocation.addOnSuccessListener(new OnSuccessListener<Location>() { lastLocation.addOnSuccessListener(new OnSuccessListener<Location>() {
@Override @Override
public void onSuccess(Location loc) { public void onSuccess(Location loc) {
location[0] = convertLocation(loc); locationCallback.onLocationResult(loc != null
? Collections.singletonList(convertLocation(loc)) : Collections.<net.osmand.Location>emptyList() );
} }
}); });
} catch (SecurityException e) { } catch (SecurityException e) {
@ -147,8 +149,7 @@ public class LocationServiceHelperImpl extends LocationServiceHelper {
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
LOG.debug("GPS location provider not available"); LOG.debug("GPS location provider not available");
} }
*/ return null;
return location[0];
} }
@Nullable @Nullable

View file

@ -125,7 +125,7 @@ public class LocationServiceHelperImpl extends LocationServiceHelper implements
} }
@Nullable @Nullable
public net.osmand.Location getFirstTimeRunDefaultLocation() { public net.osmand.Location getFirstTimeRunDefaultLocation(@Nullable LocationCallback locationCallback) {
LocationManager locationManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); LocationManager locationManager = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE);
List<String> providers = new ArrayList<>(locationManager.getProviders(true)); List<String> providers = new ArrayList<>(locationManager.getProviders(true));
// note, passive provider is from API_LEVEL 8 but it is a constant, we can check for it. // note, passive provider is from API_LEVEL 8 but it is a constant, we can check for it.

View file

@ -389,8 +389,14 @@ public class OsmAndLocationProvider implements SensorEventListener {
} }
@Nullable @Nullable
public net.osmand.Location getFirstTimeRunDefaultLocation() { public net.osmand.Location getFirstTimeRunDefaultLocation(@Nullable final OsmAndLocationListener locationListener) {
return isLocationPermissionAvailable(app) ? locationServiceHelper.getFirstTimeRunDefaultLocation() : null; return isLocationPermissionAvailable(app)
? locationServiceHelper.getFirstTimeRunDefaultLocation(locationListener != null ? new LocationServiceHelper.LocationCallback() {
@Override
public void onLocationResult(@NonNull List<net.osmand.Location> locations) {
locationListener.updateLocation(locations.isEmpty() ? null : locations.get(0));
}
} : null) : null;
} }
public synchronized void registerOrUnregisterCompassListener(boolean register) { public synchronized void registerOrUnregisterCompassListener(boolean register) {

View file

@ -388,7 +388,7 @@ public abstract class OsmandPlugin {
} }
private static boolean updateMarketPlugin(@NonNull OsmandApplication app, @NonNull Set<String> enabledPlugins, @NonNull OsmandPlugin plugin) { private static boolean updateMarketPlugin(@NonNull OsmandApplication app, @NonNull Set<String> enabledPlugins, @NonNull OsmandPlugin plugin) {
boolean marketEnabled = Version.isMarketEnabled(app); boolean marketEnabled = Version.isMarketEnabled();
boolean pckg = plugin.pluginAvailable(app); boolean pckg = plugin.pluginAvailable(app);
boolean paid = plugin.isPaid(); boolean paid = plugin.isPaid();
if ((Version.isDeveloperVersion(app) || !Version.isProductionVersion(app)) && !paid) { if ((Version.isDeveloperVersion(app) || !Version.isProductionVersion(app)) && !paid) {

View file

@ -1,9 +1,10 @@
package net.osmand.plus; package net.osmand.plus;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import androidx.annotation.NonNull;
import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchaseHelper;
import java.io.File; import java.io.File;
@ -16,26 +17,29 @@ public class Version {
private final String appName; private final String appName;
private final static String FREE_VERSION_NAME = "net.osmand"; private final static String FREE_VERSION_NAME = "net.osmand";
private final static String FREE_DEV_VERSION_NAME = "net.osmand.dev"; private final static String FREE_DEV_VERSION_NAME = "net.osmand.dev";
private final static String FREE_CUSTOM_VERSION_NAME = "net.osmand.freecustom";
private final static String UTM_REF = "&referrer=utm_source%3Dosmand"; private final static String UTM_REF = "&referrer=utm_source%3Dosmand";
public static boolean isGpsStatusEnabled(OsmandApplication ctx) { public static boolean isHuawei() {
return isGooglePlayEnabled(ctx) && !isBlackberry(ctx); return "huawei".contains(getBuildFlavor());
} }
public static boolean isBlackberry(OsmandApplication ctx) { private static boolean isAmazon() {
return ctx.getString(R.string.versionFeatures).contains("+blackberry"); return "amazon".contains(getBuildFlavor());
} }
public static boolean isHuawei(OsmandApplication ctx) { private static String getBuildFlavor() {
return ctx.getPackageName().endsWith(".huawei"); return net.osmand.plus.BuildConfig.FLAVOR;
} }
public static boolean isMarketEnabled(OsmandApplication ctx) { public static boolean isGooglePlayEnabled() {
return isGooglePlayEnabled(ctx) || isAmazonEnabled(ctx); return !isHuawei() && !isAmazon();
} }
public static boolean isGooglePlayInstalled(OsmandApplication ctx) { public static boolean isMarketEnabled() {
return isGooglePlayEnabled() || isAmazon();
}
public static boolean isGooglePlayInstalled(@NonNull OsmandApplication ctx) {
try { try {
ctx.getPackageManager().getPackageInfo("com.android.vending", 0); ctx.getPackageManager().getPackageInfo("com.android.vending", 0);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
@ -44,10 +48,10 @@ public class Version {
return true; return true;
} }
public static String marketPrefix(OsmandApplication ctx) { public static String marketPrefix(@NonNull OsmandApplication ctx) {
if (isAmazonEnabled(ctx)) { if (isAmazon()) {
return "amzn://apps/android?p="; return "amzn://apps/android?p=";
} else if (isGooglePlayEnabled(ctx) && isGooglePlayInstalled(ctx)) { } else if (isGooglePlayEnabled() && isGooglePlayInstalled(ctx)) {
return "market://details?id="; return "market://details?id=";
} }
return "https://osmand.net/apps?id="; return "https://osmand.net/apps?id=";
@ -57,22 +61,11 @@ public class Version {
return marketPrefix(ctx) + appName + UTM_REF; return marketPrefix(ctx) + appName + UTM_REF;
} }
private static boolean isAmazonEnabled(OsmandApplication ctx) {
return ctx.getString(R.string.versionFeatures).contains("+amazon");
}
public static boolean isGooglePlayEnabled(OsmandApplication ctx) {
return ctx.getString(R.string.versionFeatures).contains("+play_market");
}
private Version(OsmandApplication ctx) { private Version(OsmandApplication ctx) {
String appVersion = ""; String appVersion = "";
int versionCode = -1;
try { try {
PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0); PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
appVersion = packageInfo.versionName; //Version suffix ctx.getString(R.string.app_version_suffix) already appended in build.gradle appVersion = packageInfo.versionName; //Version suffix ctx.getString(R.string.app_version_suffix) already appended in build.gradle
versionCode = packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -123,8 +116,7 @@ public class Version {
public static boolean isFreeVersion(OsmandApplication ctx){ public static boolean isFreeVersion(OsmandApplication ctx){
return ctx.getPackageName().equals(FREE_VERSION_NAME) || return ctx.getPackageName().equals(FREE_VERSION_NAME) ||
ctx.getPackageName().equals(FREE_DEV_VERSION_NAME) || ctx.getPackageName().equals(FREE_DEV_VERSION_NAME) ||
ctx.getPackageName().equals(FREE_CUSTOM_VERSION_NAME) || isHuawei();
isHuawei(ctx);
} }
public static boolean isPaidVersion(OsmandApplication ctx) { public static boolean isPaidVersion(OsmandApplication ctx) {

View file

@ -70,6 +70,8 @@ import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
import net.osmand.plus.OnDismissDialogFragmentListener; import net.osmand.plus.OnDismissDialogFragmentListener;
import net.osmand.plus.OsmAndConstants; import net.osmand.plus.OsmAndConstants;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
import net.osmand.plus.OsmAndLocationSimulation; import net.osmand.plus.OsmAndLocationSimulation;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
@ -347,11 +349,17 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
if (!settings.isLastKnownMapLocation()) { if (!settings.isLastKnownMapLocation()) {
// show first time when application ran // show first time when application ran
net.osmand.Location location = app.getLocationProvider().getFirstTimeRunDefaultLocation(); net.osmand.Location location = app.getLocationProvider().getFirstTimeRunDefaultLocation(new OsmAndLocationListener() {
@Override
public void updateLocation(Location location) {
if (app.getLocationProvider().getLastKnownLocation() == null) {
setMapInitialLatLon(location);
}
}
});
mapViewTrackingUtilities.setMapLinkedToLocation(true); mapViewTrackingUtilities.setMapLinkedToLocation(true);
if (location != null) { if (location != null) {
mapView.setLatLon(location.getLatitude(), location.getLongitude()); setMapInitialLatLon(location);
mapView.setIntZoom(14);
} }
} }
addDialogProvider(mapActions); addDialogProvider(mapActions);
@ -376,6 +384,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
mIsDestroyed = false; mIsDestroyed = false;
} }
private void setMapInitialLatLon(@Nullable Location location) {
if (location != null) {
mapView.setLatLon(location.getLatitude(), location.getLongitude());
mapView.setIntZoom(14);
}
}
public void exitFromFullScreen(View view) { public void exitFromFullScreen(View view) {
AndroidUtils.exitFromFullScreen(this, view); AndroidUtils.exitFromFullScreen(this, view);
} }

View file

@ -903,7 +903,7 @@ public class MapActivityActions implements DialogProvider {
} }
}).createItem()); }).createItem());
if (Version.isGooglePlayEnabled(app) || Version.isHuawei(app) || Version.isDeveloperVersion(app)) { if (Version.isGooglePlayEnabled() || Version.isHuawei() || Version.isDeveloperVersion(app)) {
optionsMenuHelper.addItem(new ItemBuilder().setTitleId(R.string.osm_live, mapActivity) optionsMenuHelper.addItem(new ItemBuilder().setTitleId(R.string.osm_live, mapActivity)
.setId(DRAWER_OSMAND_LIVE_ID) .setId(DRAWER_OSMAND_LIVE_ID)
.setIcon(R.drawable.ic_action_osm_live) .setIcon(R.drawable.ic_action_osm_live)

View file

@ -5,7 +5,6 @@ import android.app.Activity;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -16,16 +15,12 @@ import androidx.fragment.app.FragmentManager;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.Version; import net.osmand.plus.Version;
import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseInitCallback; import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseInitCallback;
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseListener; import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseListener;
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType; import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType;
import net.osmand.plus.liveupdates.OsmLiveRestartBottomSheetDialogFragment; import net.osmand.plus.liveupdates.OsmLiveRestartBottomSheetDialogFragment;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -59,7 +54,7 @@ public class OsmandInAppPurchaseActivity extends AppCompatActivity implements In
InAppPurchaseHelper purchaseHelper = app.getInAppPurchaseHelper(); InAppPurchaseHelper purchaseHelper = app.getInAppPurchaseHelper();
if (app.getSettings().isInternetConnectionAvailable() if (app.getSettings().isInternetConnectionAvailable()
&& isInAppPurchaseAllowed() && isInAppPurchaseAllowed()
&& isInAppPurchaseSupported(purchaseHelper)) { && isInAppPurchaseSupported()) {
this.purchaseHelper = purchaseHelper; this.purchaseHelper = purchaseHelper;
} }
} }
@ -160,9 +155,8 @@ public class OsmandInAppPurchaseActivity extends AppCompatActivity implements In
return false; return false;
} }
public boolean isInAppPurchaseSupported(InAppPurchaseHelper purchaseHelper) { public boolean isInAppPurchaseSupported() {
OsmandApplication app = getMyApplication(); return Version.isGooglePlayEnabled() || Version.isHuawei();
return Version.isGooglePlayEnabled(app) || Version.isHuawei(app);
} }
@Override @Override

View file

@ -193,7 +193,7 @@ public class ShareDialog {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
activity.startActivity(intent); activity.startActivity(intent);
} else { } else {
if (Version.isMarketEnabled((OsmandApplication) activity.getApplication())) { if (Version.isMarketEnabled()) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity); AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setMessage(activity.getString(R.string.zxing_barcode_scanner_not_found)); builder.setMessage(activity.getString(R.string.zxing_barcode_scanner_not_found));
builder.setPositiveButton(activity.getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() { builder.setPositiveButton(activity.getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() {

View file

@ -180,7 +180,7 @@ public class StartGPSStatus extends OsmAndAction {
intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.addCategory(Intent.CATEGORY_LAUNCHER);
mapActivity.startActivity(intent); mapActivity.startActivity(intent);
} else { } else {
if (Version.isMarketEnabled(getMyApplication())) { if (Version.isMarketEnabled()) {
AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity); AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
builder.setMessage(mapActivity. getString(R.string.gps_status_app_not_found)); builder.setMessage(mapActivity. getString(R.string.gps_status_app_not_found));
builder.setPositiveButton(mapActivity.getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() { builder.setPositiveButton(mapActivity.getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() {

View file

@ -5,8 +5,6 @@ import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
@ -216,7 +214,7 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
infoDescription.setText(getInfoDescription()); infoDescription.setText(getInfoDescription());
} }
TextViewEx planInfoDescription = (TextViewEx) view.findViewById(R.id.plan_info_description); TextViewEx planInfoDescription = (TextViewEx) view.findViewById(R.id.plan_info_description);
planInfoDescription.setText(Version.isHuawei(app) planInfoDescription.setText(Version.isHuawei()
? R.string.osm_live_payment_subscription_management_hw : R.string.osm_live_payment_subscription_management); ? R.string.osm_live_payment_subscription_management_hw : R.string.osm_live_payment_subscription_management);
ViewGroup osmLiveCard = buildOsmLiveCard(ctx, cardsContainer); ViewGroup osmLiveCard = buildOsmLiveCard(ctx, cardsContainer);
if (osmLiveCard != null) { if (osmLiveCard != null) {

View file

@ -71,7 +71,6 @@ public class DevelopmentSettingsFragment extends BaseSettingsFragment {
private void setupSafeModePref() { private void setupSafeModePref() {
SwitchPreferenceEx safeMode = findPreference(settings.SAFE_MODE.getId()); SwitchPreferenceEx safeMode = findPreference(settings.SAFE_MODE.getId());
if (!Version.isBlackberry(app)) {
safeMode.setDescription(getString(R.string.safe_mode_description)); safeMode.setDescription(getString(R.string.safe_mode_description));
safeMode.setIconSpaceReserved(false); safeMode.setIconSpaceReserved(false);
// disable the switch if the library cannot be used // disable the switch if the library cannot be used
@ -79,9 +78,6 @@ public class DevelopmentSettingsFragment extends BaseSettingsFragment {
safeMode.setEnabled(false); safeMode.setEnabled(false);
safeMode.setChecked(true); safeMode.setChecked(true);
} }
} else {
safeMode.setVisible(false);
}
} }
private void setupSimulateYourLocationPref() { private void setupSimulateYourLocationPref() {

View file

@ -108,7 +108,7 @@ public class RateUsBottomSheetDialogFragment extends MenuBottomSheetDialogFragme
public static boolean shouldShow(OsmandApplication app) { public static boolean shouldShow(OsmandApplication app) {
long firstInstalledDays = app.getAppInitializer().getFirstInstalledDays(); long firstInstalledDays = app.getAppInitializer().getFirstInstalledDays();
//Do not show dialog if not google play version or more than 350 days left from the first start //Do not show dialog if not google play version or more than 350 days left from the first start
if (!Version.isGooglePlayEnabled(app) || firstInstalledDays > 350) { if (!Version.isGooglePlayEnabled() || firstInstalledDays > 350) {
return false; return false;
} }
OsmandSettings settings = app.getSettings(); OsmandSettings settings = app.getSettings();

View file

@ -217,7 +217,7 @@ public class DownloadValidationManager {
AlertDialog.Builder msg = new AlertDialog.Builder(getActivity()); AlertDialog.Builder msg = new AlertDialog.Builder(getActivity());
msg.setTitle(R.string.free_version_title); msg.setTitle(R.string.free_version_title);
msg.setMessage(msgTx); msg.setMessage(msgTx);
if (Version.isMarketEnabled(getMyApplication())) { if (Version.isMarketEnabled()) {
msg.setPositiveButton(R.string.install_paid, new DialogInterface.OnClickListener() { msg.setPositiveButton(R.string.install_paid, new DialogInterface.OnClickListener() {
@Override @Override

View file

@ -110,7 +110,7 @@ public class DayNightHelper implements SensorEventListener {
public SunriseSunset getSunriseSunset() { public SunriseSunset getSunriseSunset() {
Location lastKnownLocation = app.getLocationProvider().getLastKnownLocation(); Location lastKnownLocation = app.getLocationProvider().getLastKnownLocation();
if (lastKnownLocation == null) { if (lastKnownLocation == null) {
lastKnownLocation = app.getLocationProvider().getFirstTimeRunDefaultLocation(); lastKnownLocation = app.getLocationProvider().getFirstTimeRunDefaultLocation(null);
} }
if (lastKnownLocation == null) { if (lastKnownLocation == null) {
return null; return null;

View file

@ -1,6 +1,7 @@
package net.osmand.plus.helpers; package net.osmand.plus.helpers;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import net.osmand.Location; import net.osmand.Location;
@ -25,5 +26,5 @@ public abstract class LocationServiceHelper {
public abstract void removeLocationUpdates(); public abstract void removeLocationUpdates();
public abstract Location getFirstTimeRunDefaultLocation(); public abstract Location getFirstTimeRunDefaultLocation(@Nullable LocationCallback locationCallback);
} }

View file

@ -212,7 +212,7 @@ public abstract class InAppPurchaseHelper {
} }
protected void exec(final @NonNull InAppPurchaseTaskType taskType, final @NonNull InAppCommand command) { protected void exec(final @NonNull InAppPurchaseTaskType taskType, final @NonNull InAppCommand command) {
if (isDeveloperVersion || (!Version.isGooglePlayEnabled(ctx) && !Version.isHuawei(ctx))) { if (isDeveloperVersion || (!Version.isGooglePlayEnabled() && !Version.isHuawei())) {
notifyDismissProgress(taskType); notifyDismissProgress(taskType);
stop(true); stop(true);
return; return;

View file

@ -298,12 +298,9 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
mapEmptyStateAllowedPref.setTitle(getString(R.string.use_trackball)); mapEmptyStateAllowedPref.setTitle(getString(R.string.use_trackball));
mapEmptyStateAllowedPref.setDescription(getString(R.string.use_trackball_descr)); mapEmptyStateAllowedPref.setDescription(getString(R.string.use_trackball_descr));
boolean visible = false;
if (!Version.isBlackberry(app)) {
int nav = getResources().getConfiguration().navigation; int nav = getResources().getConfiguration().navigation;
visible = nav == Configuration.NAVIGATION_DPAD || nav == Configuration.NAVIGATION_TRACKBALL || boolean visible = nav == Configuration.NAVIGATION_DPAD || nav == Configuration.NAVIGATION_TRACKBALL ||
nav == Configuration.NAVIGATION_WHEEL || nav == Configuration.NAVIGATION_UNDEFINED; nav == Configuration.NAVIGATION_WHEEL || nav == Configuration.NAVIGATION_UNDEFINED;
}
mapEmptyStateAllowedPref.setVisible(visible); mapEmptyStateAllowedPref.setVisible(visible);
} }

View file

@ -171,7 +171,6 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
} }
private void setupNativePublicTransport() { private void setupNativePublicTransport() {
if (!Version.isBlackberry(app)) {
SwitchPreferenceEx setupNativePublicTransport = createSwitchPreferenceEx(settings.PT_SAFE_MODE.getId(), SwitchPreferenceEx setupNativePublicTransport = createSwitchPreferenceEx(settings.PT_SAFE_MODE.getId(),
R.string.use_native_pt, R.layout.preference_with_descr_dialog_and_switch); R.string.use_native_pt, R.layout.preference_with_descr_dialog_and_switch);
setupNativePublicTransport.setDescription(getString(R.string.use_native_pt_desc)); setupNativePublicTransport.setDescription(getString(R.string.use_native_pt_desc));
@ -180,7 +179,6 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
setupNativePublicTransport.setIconSpaceReserved(true); setupNativePublicTransport.setIconSpaceReserved(true);
getPreferenceScreen().addPreference(setupNativePublicTransport); getPreferenceScreen().addPreference(setupNativePublicTransport);
} }
}
private void setupOsmLiveForRoutingPref() { private void setupOsmLiveForRoutingPref() {
SwitchPreferenceEx useOsmLiveForRouting = createSwitchPreferenceEx(settings.USE_OSM_LIVE_FOR_ROUTING.getId(), SwitchPreferenceEx useOsmLiveForRouting = createSwitchPreferenceEx(settings.USE_OSM_LIVE_FOR_ROUTING.getId(),

View file

@ -97,10 +97,9 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
setupArrivalAnnouncementPref(); setupArrivalAnnouncementPref();
setupVoiceProviderPref(); setupVoiceProviderPref();
if (!Version.isBlackberry(app)) {
setupAudioStreamGuidancePref(); setupAudioStreamGuidancePref();
setupInterruptMusicPref(); setupInterruptMusicPref();
}
enableDisablePreferences(!settings.VOICE_MUTE.getModeValue(getSelectedAppMode())); enableDisablePreferences(!settings.VOICE_MUTE.getModeValue(getSelectedAppMode()));
setupSpeakCamerasPref(); setupSpeakCamerasPref();
setupSpeedCamerasAlert(); setupSpeedCamerasAlert();