Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ dependencies {
//高德搜索
implementation rootProject.ext.dependencies["amap_search"]
implementation rootProject.ext.dependencies["amap_navi"]
// implementation rootProject.ext.dependencies["amap_navi_v810"]
// implementation rootProject.ext.dependencies["amap_navi_v801"]
implementation project(':dokit-amap-api')
//腾讯地图定位
// implementation rootProject.ext.dependencies["tencent_location"]
// implementation rootProject.ext.dependencies["tencent_map"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.amap.api.navi.model.AMapNaviLocation
import com.amap.api.navi.model.NaviLatLng
import com.didichuxing.doraemondemo.R
import com.didichuxing.doraemondemo.comm.CommBaseFragment
import com.didichuxing.doraemonkit.amap_api.AMapWrap

/**
* ================================================
Expand Down Expand Up @@ -147,8 +148,8 @@ class AMapRouterFragment : CommBaseFragment() {
//aMap.getUiSettings().setMyLocationButtonEnabled(true);设置默认定位按钮是否显示,非必需设置。
// 设置为true表示启动显示定位蓝点,false表示隐藏定位蓝点并不进行定位,默认是false。
mAmap.isMyLocationEnabled = true
//规划路径
mAMapNavi = AMapNavi.getInstance(activity?.application)
//AMapWrap 类用于适配高德地图隐私合规接口
mAMapNavi = AMapWrap.createAMapNavi(activity?.application!!)
val startList = mutableListOf<NaviLatLng>()
startList.add(mStartPoint)
val endList = mutableListOf<NaviLatLng>()
Expand Down Expand Up @@ -186,4 +187,4 @@ class AMapRouterFragment : CommBaseFragment() {
super.onSaveInstanceState(outState)
mapView.onSaveInstanceState(outState)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import io.reactivex.disposables.Disposable
* 修订历史:
* ================================================
*/
class DefaultNaviListener(val mAMap: AMap, val mAMapNavi: AMapNavi, val context: Context) :
class DefaultNaviListener(val mAMap: AMap, private val mAMapNavi: AMapNavi, val context: Context) :
AMapNaviListener {
// private var mNaviRouteOverlay: NaviRouteOverlay? = null
//
Expand Down Expand Up @@ -197,4 +197,4 @@ class DefaultNaviListener(val mAMap: AMap, val mAMapNavi: AMapNavi, val context:
disp!!.dispose()
}
}
}
}
4 changes: 4 additions & 0 deletions Android/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ ext {
"annotation" : "androidx.annotation:annotation:1.1.0",
"kotlin_v13" : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${android["kotlin_version_v13"]}",
"kotlin_v14" : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${android["kotlin_version_v14"]}",
"kotlin_junit_v13" : "org.jetbrains.kotlin:kotlin-test-junit:${android["kotlin_version_v13"]}",
"kotlin_junit_v14" : "org.jetbrains.kotlin:kotlin-test-junit:${android["kotlin_version_v14"]}",
"coroutines-core_v13" : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${android["kotlinx_coroutines_version_v13"]}",
"coroutines-core_v14" : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${android["kotlinx_coroutines_version_v14"]}",
"coroutines-android_v13" : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${android["kotlinx_coroutines_version_v13"]}",
Expand Down Expand Up @@ -134,6 +136,8 @@ ext {
"amap_map3d" : 'com.amap.api:map3d:latest.integration',
"amap_search" : 'com.amap.api:search:latest.integration',
"amap_navi" : 'com.amap.api:navi-3dmap:latest.integration',
"amap_navi_v810" : 'com.amap.api:navi-3dmap:8.1.0_3dmap8.1.0',
"amap_navi_v801" : 'com.amap.api:navi-3dmap:8.0.1_3dmap8.0.1',
//新四地图
"dmap" : 'com.didi.nav.driving:sdk:0.0.2065',
//腾讯地图定位
Expand Down
1 change: 1 addition & 0 deletions Android/dokit-amap-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
50 changes: 50 additions & 0 deletions Android/dokit-amap-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: '../upload.gradle'

android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]

defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion_16"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}

buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

}


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
//高德导航
compileOnly rootProject.ext.dependencies["amap_navi"]
implementation project(':dokit-amap-no-privacy')
implementation project(':dokit-amap-with-privacy')
compileOnly project(':dokit-util')

}

1 change: 1 addition & 0 deletions Android/dokit-amap-api/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ARTIFACT_ID=dokit-amap-api
21 changes: 21 additions & 0 deletions Android/dokit-amap-api/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# 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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original from file name.
#-renamesourcefileattribute SourceFile
5 changes: 5 additions & 0 deletions Android/dokit-amap-api/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.didichuxing.doraemonkit.amap_api">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.didichuxing.doraemonkit.amap_api

import android.app.Application
import android.util.Log
import com.amap.api.navi.AMapNavi
import com.didichuxing.doraemonkit.util.VersionUtils


/**
* ================================================
* 作 者:jaydroid(王学杰)
* 版 本:1.0
* 创建日期:2021/11/17-14:55
* 描 述:
* 修订历史:
* ================================================
*/
object AMapWrap {

const val TAG = "AMapWrap"

private val isAMapNaviVersionGreaterV810: Boolean by lazy {
val aMapNaviVersion = AMapNavi.getVersion()
// Log.v(TAG, "aMapNaviVersion: $aMapNaviVersion")
//由于个人信息保护法的实施,从8.1.0版本开始,请务必确保调用SDK任何接口前先调用更新隐私合规updatePrivacyShow、updatePrivacyAgree两个接口
val compareResult = VersionUtils.compareVersion(aMapNaviVersion, "8.1.0")
// Log.v(TAG, "compareResult: $compareResult")
compareResult != -1
}

fun createAMapNavi(application: Application): AMapNavi {
return if (isAMapNaviVersionGreaterV810) {
AMapWrapWithPrivacy.createAMapNavi(application)
} else {
AMapWrapNoPrivacy.createAMapNavi(application)
}
}


}
6 changes: 6 additions & 0 deletions Android/dokit-amap-api/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
echo -n "please enter bintray userid ->"
read userid_bintray
echo -n "please enter bintray apikey ->"
read apikey_bintray
../gradlew clean build --stacktrace --info bintrayUpload -PbintrayUser=${userid_bintray} -PbintrayKey=${apikey_bintray} -PdryRun=false
1 change: 1 addition & 0 deletions Android/dokit-amap-no-privacy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
47 changes: 47 additions & 0 deletions Android/dokit-amap-no-privacy/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: '../upload.gradle'

android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]

defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion_16"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}

buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

}


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
//高德导航
compileOnly rootProject.ext.dependencies["amap_navi_v801"]

}

1 change: 1 addition & 0 deletions Android/dokit-amap-no-privacy/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ARTIFACT_ID=dokit-amap-no-privacy
21 changes: 21 additions & 0 deletions Android/dokit-amap-no-privacy/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# 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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original from file name.
#-renamesourcefileattribute SourceFile
5 changes: 5 additions & 0 deletions Android/dokit-amap-no-privacy/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.didichuxing.doraemonkit.amap_no_privacy">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.didichuxing.doraemonkit.amap_api

import android.app.Application
import com.amap.api.navi.AMapNavi


/**
* ================================================
* 作 者:jaydroid(王学杰)
* 版 本:1.0
* 创建日期:2021/11/17-14:55
* 描 述:
* 修订历史:
* ================================================
*/
object AMapWrapNoPrivacy {

fun createAMapNavi(application: Application): AMapNavi {
return AMapNavi.getInstance(application)
}

}
6 changes: 6 additions & 0 deletions Android/dokit-amap-no-privacy/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
echo -n "please enter bintray userid ->"
read userid_bintray
echo -n "please enter bintray apikey ->"
read apikey_bintray
../gradlew clean build --stacktrace --info bintrayUpload -PbintrayUser=${userid_bintray} -PbintrayKey=${apikey_bintray} -PdryRun=false
1 change: 1 addition & 0 deletions Android/dokit-amap-with-privacy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
47 changes: 47 additions & 0 deletions Android/dokit-amap-with-privacy/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: '../upload.gradle'

android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]

defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion_16"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}

buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}

}


dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
if (needKotlinV14()) {
implementation rootProject.ext.dependencies["kotlin_v14"]
} else {
implementation rootProject.ext.dependencies["kotlin_v13"]
}
//高德导航
compileOnly rootProject.ext.dependencies["amap_navi_v810"]

}

1 change: 1 addition & 0 deletions Android/dokit-amap-with-privacy/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ARTIFACT_ID=dokit-amap-with-privacy
21 changes: 21 additions & 0 deletions Android/dokit-amap-with-privacy/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# 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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original from file name.
#-renamesourcefileattribute SourceFile
5 changes: 5 additions & 0 deletions Android/dokit-amap-with-privacy/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.didichuxing.doraemonkit.amap_with_privacy">

</manifest>
Loading