Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
DoraemonKit
提交
725faeae
D
DoraemonKit
项目概览
DiDi
/
DoraemonKit
12 个月 前同步成功
通知
166
Star
19623
Fork
3062
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DoraemonKit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
725faeae
编写于
5月 26, 2021
作者:
J
jackjintai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify:
[Android]-发布dokit v3.4.0-alpha03版本
上级
0a9f42af
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
116 addition
and
56 deletion
+116
-56
Android/java/app/build.gradle
Android/java/app/build.gradle
+1
-1
Android/java/app/src/main/java/com/didichuxing/doraemondemo/AopTest.java
...p/src/main/java/com/didichuxing/doraemondemo/AopTest.java
+0
-2
Android/java/app/src/main/java/com/didichuxing/doraemondemo/MapActivityBak.kt
.../main/java/com/didichuxing/doraemondemo/MapActivityBak.kt
+0
-2
Android/java/app/src/main/java/com/didichuxing/doraemondemo/amap/DefaultNaviListener.kt
.../com/didichuxing/doraemondemo/amap/DefaultNaviListener.kt
+0
-1
Android/java/app/src/main/java/com/didichuxing/doraemondemo/amap/NaviRouteOverlay.kt
...ava/com/didichuxing/doraemondemo/amap/NaviRouteOverlay.kt
+2
-4
Android/java/app/src/release/java/com/didichuxing/doraemondemo/App.kt
.../app/src/release/java/com/didichuxing/doraemondemo/App.kt
+109
-8
Android/java/app/src/release/java/com/didichuxing/doraemondemo/MainReleaseActivity.kt
.../java/com/didichuxing/doraemondemo/MainReleaseActivity.kt
+3
-37
Android/java/config.gradle
Android/java/config.gradle
+1
-1
未找到文件。
Android/java/app/build.gradle
浏览文件 @
725faeae
...
...
@@ -190,7 +190,7 @@ dependencies {
// implementation files('libs/BaiduLBS_Android.jar')
//腾讯x5
implementation
rootProject
.
ext
.
dependencies
[
"tbs"
]
i
mplementation
rootProject
.
ext
.
dependencies
[
"leakcanary_android"
]
debugI
mplementation
rootProject
.
ext
.
dependencies
[
"leakcanary_android"
]
implementation
'io.reactivex.rxjava2:rxandroid:2.0.1'
}
...
...
Android/java/app/src/main/java/com/didichuxing/doraemondemo/AopTest.java
浏览文件 @
725faeae
package
com.didichuxing.doraemondemo
;
import
com.didichuxing.doraemonkit.aop.OkHttpHook
;
/**
* ================================================
* 作 者:jint(金台)
...
...
Android/java/app/src/main/java/com/didichuxing/doraemondemo/MapActivityBak.kt
浏览文件 @
725faeae
...
...
@@ -12,7 +12,6 @@ import com.amap.api.services.route.RouteSearch.DriveRouteQuery
import
com.amap.api.services.route.RouteSearch.FromAndTo
import
com.didichuxing.doraemondemo.amap.AMapUtil
import
com.didichuxing.doraemondemo.amap.DrivingRouteOverLay
import
com.didichuxing.doraemonkit.util.LogHelper
/**
...
...
@@ -110,7 +109,6 @@ class MapActivityBak : AppCompatActivity(), RouteSearch.OnRouteSearchListener {
* 驾车路径规划完成
*/
override
fun
onDriveRouteSearched
(
result
:
DriveRouteResult
?,
errorCode
:
Int
)
{
LogHelper
.
i
(
TAG
,
"===onDriveRouteSearched==="
)
if
(
errorCode
==
AMapException
.
CODE_AMAP_SUCCESS
)
{
result
?.
let
{
val
drivePath
=
it
.
paths
[
0
]
...
...
Android/java/app/src/main/java/com/didichuxing/doraemondemo/amap/DefaultNaviListener.kt
浏览文件 @
725faeae
...
...
@@ -10,7 +10,6 @@ import com.amap.api.navi.enums.NaviType
import
com.amap.api.navi.model.*
import
com.didichuxing.doraemondemo.amap.mockroute.LogUtils
import
com.didichuxing.doraemondemo.amap.mockroute.MockGPSTaskManager
import
com.didichuxing.doraemonkit.util.LogHelper
import
io.reactivex.disposables.Disposable
/**
...
...
Android/java/app/src/main/java/com/didichuxing/doraemondemo/amap/NaviRouteOverlay.kt
浏览文件 @
725faeae
...
...
@@ -12,8 +12,6 @@ import com.amap.api.navi.model.RouteOverlayOptions
import
com.amap.api.navi.view.RouteOverLay
import
com.blankj.utilcode.util.ConvertUtils
import
com.blankj.utilcode.util.ReflectUtils
import
com.didichuxing.doraemonkit.kit.lbs.route.NaviSettings.ROUTE_NORMAL_Z_INDEX
import
com.didichuxing.doraemonkit.kit.lbs.route.NaviSettings.ROUTE_SHADOW_Z_INDEX
/**
* 地图上的导航路径
...
...
@@ -42,10 +40,10 @@ class NaviRouteOverlay(
val
options
:
RouteOverlayOptions
if
(
shadow
)
{
options
=
customShadowRouteTexture
()
setZindex
(
ROUTE_SHADOW_Z_INDEX
)
//
setZindex(ROUTE_SHADOW_Z_INDEX)
}
else
{
options
=
customRouteTexture
()
setZindex
(
ROUTE_NORMAL_Z_INDEX
)
//
setZindex(ROUTE_NORMAL_Z_INDEX)
}
options
.
setOnRouteCameShow
(
false
)
routeOverlayOptions
=
options
...
...
Android/java/app/src/release/java/com/didichuxing/doraemondemo/App.kt
浏览文件 @
725faeae
...
...
@@ -4,10 +4,22 @@ import android.app.Activity
import
android.app.Application
import
android.content.Context
import
android.content.Intent
import
android.view.View
import
android.view.accessibility.AccessibilityEvent
import
androidx.multidex.MultiDex
import
com.baidu.mapapi.CoordType
import
com.baidu.mapapi.SDKInitializer
import
com.didichuxing.doraemonkit.DoKit
import
com.didichuxing.doraemonkit.DoKitCallBack
import
com.didichuxing.doraemonkit.DoraemonKit
import
com.didichuxing.doraemonkit.kit.AbstractKit
import
com.didichuxing.doraemonkit.kit.core.MCInterceptor
import
com.didichuxing.doraemonkit.kit.network.bean.NetworkRecord
import
com.didichuxing.doraemonkit.kit.network.okhttp.interceptor.DokitExtInterceptor
import
com.didichuxing.doraemonkit.kit.webdoor.WebDoorManager
import
com.facebook.drawee.backends.pipeline.Fresco
import
okhttp3.Interceptor
import
okhttp3.Response
/**
* Created by zhangweida on 2018/6/22.
...
...
@@ -15,22 +27,111 @@ import com.facebook.drawee.backends.pipeline.Fresco
class
App
:
Application
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
SDKInitializer
.
initialize
(
this
)
SDKInitializer
.
setCoordType
(
CoordType
.
BD09LL
)
//测试环境:a49842eeebeb1989b3f9565eb12c276b
//线上环境:749a0600b5e48dd77cf8ee680be7b1b7
DoraemonKit
.
disableUpload
()
//
DoraemonKit.disableUpload()
//是否显示入口icon
//DoraemonKit.setAwaysShowMainIcon(false);
DoraemonKit
.
install
(
this
,
"a49842eeebeb1989b3f9565eb12c276b"
)
// DoraemonKit.setAwaysShowMainIcon(false);
DoraemonKit
.
setWebDoorCallback
(
WebDoorManager
.
WebDoorCallback
{
context
,
url
->
})
val
kits
:
MutableList
<
AbstractKit
>
=
ArrayList
()
// kits.add(DemoKit())
// kits.add(TestSimpleDokitFloatViewKit())
// kits.add(TestSimpleDokitFragmentKit())
val
mapKits
:
LinkedHashMap
<
String
,
List
<
AbstractKit
>>
=
linkedMapOf
()
// mapKits["业务专区1"] = mutableListOf<AbstractKit>().apply {
// add(DemoKit())
// add(TestSimpleDokitFloatViewKit())
// add(TestSimpleDokitFragmentKit())
// }
//mapKits["业务专区2"] = mutableListOf<AbstractKit>(DemoKit())
//老的初始化方式
// DoraemonKit.setDatabasePass(mapOf("Person.db" to "a_password"))
// DoraemonKit.disableUpload()
// DoraemonKit.setFileManagerHttpPort(9001)
// DoraemonKit.setDatabasePass(mapOf("Person.db" to "a_password"))
// DoraemonKit.setMCIntercept(object : MCInterceptor {
// override fun onIntercept(
// view: View,
// accessibilityEvent: AccessibilityEvent
// ): Boolean {
// return false
// }
//
// override fun serverParams(
// view: View,
// accessibilityEvent: AccessibilityEvent
// ): Map<String, String> {
// return mapOf()
// }
//
// override fun clientProcess(view: View, params: Map<String, String>): Boolean {
// return false
// }
// })
// DoraemonKit.setMCWSPort(5555)
// DoraemonKit.install(this, mapKits = mapKits, productId = "749a0600b5e48dd77cf8ee680be7b1b7")
//
DoKit
.
Builder
(
this
)
.
productId
(
"749a0600b5e48dd77cf8ee680be7b1b7"
)
.
disableUpload
()
.
customKits
(
mapKits
)
.
fileManagerHttpPort
(
9001
)
.
databasePass
(
mapOf
(
"Person.db"
to
"a_password"
))
.
mcWSPort
(
5555
)
.
awaysShowMainIcon
(
true
)
.
callBack
(
object
:
DoKitCallBack
{
override
fun
onCpuCallBack
(
value
:
Float
,
filePath
:
String
)
{
super
.
onCpuCallBack
(
value
,
filePath
)
}
override
fun
onFpsCallBack
(
value
:
Float
,
filePath
:
String
)
{
super
.
onFpsCallBack
(
value
,
filePath
)
}
override
fun
onMemoryCallBack
(
value
:
Float
,
filePath
:
String
)
{
super
.
onMemoryCallBack
(
value
,
filePath
)
}
override
fun
onNetworkCallBack
(
record
:
NetworkRecord
)
{
super
.
onNetworkCallBack
(
record
)
}
})
.
netExtInterceptor
(
object
:
DokitExtInterceptor
.
DokitExtInterceptorProxy
{
override
fun
intercept
(
chain
:
Interceptor
.
Chain
):
Response
{
return
chain
.
proceed
(
chain
.
request
())
}
})
.
mcIntercept
(
object
:
MCInterceptor
{
override
fun
onIntercept
(
view
:
View
,
accessibilityEvent
:
AccessibilityEvent
):
Boolean
{
return
false
}
override
fun
serverParams
(
view
:
View
,
accessibilityEvent
:
AccessibilityEvent
):
Map
<
String
,
String
>
{
return
mapOf
()
}
override
fun
clientProcess
(
view
:
View
,
params
:
Map
<
String
,
String
>):
Boolean
{
return
false
}
})
.
build
()
Fresco
.
initialize
(
this
)
//严格检查模式
//StrictMode.enableDefaults();
}
override
fun
attachBaseContext
(
base
:
Context
)
{
...
...
Android/java/app/src/release/java/com/didichuxing/doraemondemo/MainReleaseActivity.kt
浏览文件 @
725faeae
...
...
@@ -26,12 +26,10 @@ import com.baidu.location.BDAbstractLocationListener
import
com.baidu.location.BDLocation
import
com.baidu.location.LocationClient
import
com.baidu.location.LocationClientOption
import
com.didichuxing.doraemonkit.util.ConvertUtils
import
com.didichuxing.doraemonkit.util.ThreadUtils
import
com.didichuxing.doraemonkit.util.ThreadUtils.SimpleTask
import
com.blankj.utilcode.util.ConvertUtils
import
com.blankj.utilcode.util.ThreadUtils
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.didichuxing.doraemondemo.MainReleaseActivity
import
com.didichuxing.doraemonkit.DoraemonKit
import
com.facebook.drawee.backends.pipeline.Fresco
import
com.facebook.drawee.view.SimpleDraweeView
...
...
@@ -41,10 +39,6 @@ import com.lzy.okgo.model.Response
import
com.nostra13.universalimageloader.core.ImageLoader
import
com.squareup.picasso.MemoryPolicy
import
com.squareup.picasso.Picasso
import
com.tencent.map.geolocation.TencentLocation
import
com.tencent.map.geolocation.TencentLocationListener
import
com.tencent.map.geolocation.TencentLocationManager
import
com.tencent.map.geolocation.TencentLocationRequest
import
okhttp3.*
import
pub.devrel.easypermissions.EasyPermissions
import
pub.devrel.easypermissions.PermissionRequest
...
...
@@ -60,8 +54,6 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
private
var
mLocationClient
:
AMapLocationClient
?
=
null
private
var
mBaiduLocationClient
:
LocationClient
?
=
null
private
var
mMapOption
:
AMapLocationClientOption
?
=
null
private
var
mTencentLocationRequest
:
TencentLocationRequest
?
=
null
private
var
mTencentLocationManager
:
TencentLocationManager
?
=
null
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
...
...
@@ -71,9 +63,6 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
findViewById
<
View
>(
R
.
id
.
btn_jump
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_show_tool_panel
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_location
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_location_amap
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_location_tencent
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_location_baidu
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_load_img
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_okhttp_mock
).
setOnClickListener
(
this
)
findViewById
<
View
>(
R
.
id
.
btn_connection_mock
).
setOnClickListener
(
this
)
...
...
@@ -90,8 +79,6 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
mLocationClient
=
AMapLocationClient
(
applicationContext
)
mMapOption
=
AMapLocationClientOption
()
//腾讯地图
mTencentLocationRequest
=
TencentLocationRequest
.
create
()
mTencentLocationManager
=
TencentLocationManager
.
getInstance
(
applicationContext
)
//百度地图
mBaiduLocationClient
=
LocationClient
(
this
)
//通过LocationClientOption设置LocationClient相关参数
...
...
@@ -189,24 +176,7 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
mLocationClient
!!
.
startLocation
()
}
private
var
mTencentLocationListener
:
TencentLocationListener
=
object
:
TencentLocationListener
{
override
fun
onLocationChanged
(
tencentLocation
:
TencentLocation
,
error
:
Int
,
errorInfo
:
String
)
{
Log
.
i
(
TAG
,
"腾讯定位===onLocationChanged===lat==>"
+
tencentLocation
.
latitude
+
" lng==>"
+
tencentLocation
.
longitude
+
" error===>"
+
error
+
" errorInfo===>"
+
errorInfo
)
}
override
fun
onStatusUpdate
(
name
:
String
,
status
:
Int
,
desc
:
String
)
{
Log
.
i
(
TAG
,
"腾讯定位===onStatusUpdate==> name===>$name status===$status desc===$desc"
)
}
}
/**
* 启动腾讯地图定位
*/
private
fun
startTencentLocation
()
{
//mTencentLocationManager.requestLocationUpdates(mTencentLocationRequest, mTencentLocationListener);
//获取获取当前单次定位
mTencentLocationManager
!!
.
requestSingleFreshLocation
(
mTencentLocationRequest
,
mTencentLocationListener
,
Looper
.
myLooper
())
}
private
var
mbdLocationListener
:
BDAbstractLocationListener
=
object
:
BDAbstractLocationListener
()
{
override
fun
onReceiveLocation
(
bdLocation
:
BDLocation
)
{
...
...
@@ -229,9 +199,6 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
R
.
id
.
btn_show_tool_panel
->
//直接调起工具面板
DoraemonKit
.
showToolPanel
()
R
.
id
.
btn_location
->
startNormaLocation
()
R
.
id
.
btn_location_amap
->
startAmapLocation
()
R
.
id
.
btn_location_tencent
->
startTencentLocation
()
R
.
id
.
btn_location_baidu
->
startBaiDuLocation
()
R
.
id
.
btn_load_img
->
{
//Glide 加载
val
picassoImgUrl
=
"http://b-ssl.duitang.com/uploads/item/201808/27/20180827043223_twunu.jpg"
...
...
@@ -289,7 +256,7 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
}
private
fun
requestByGet
(
path
:
String
)
{
ThreadUtils
.
executeByIo
(
object
:
SimpleTask
<
String
?>()
{
ThreadUtils
.
executeByIo
(
object
:
ThreadUtils
.
SimpleTask
<
String
?
>()
{
@Throws
(
Throwable
::
class
)
override
fun
doInBackground
():
String
{
try
{
...
...
@@ -412,7 +379,6 @@ class MainReleaseActivity : AppCompatActivity(), View.OnClickListener {
super
.
onDestroy
()
okHttpClient
!!
.
dispatcher
().
cancelAll
()
mLocationManager
!!
.
removeUpdates
(
mLocationListener
)
mTencentLocationManager
!!
.
removeUpdates
(
mTencentLocationListener
)
mBaiduLocationClient
!!
.
stop
()
}
...
...
Android/java/config.gradle
浏览文件 @
725faeae
...
...
@@ -12,7 +12,7 @@ ext {
// group_id : 'com.didichuxing.doraemonkit',
group_id
:
'io.github.didi.dokit'
,
// version : '3.4.0-SNAPSHOT'
version
:
'3.4.0-alpha0
2
'
version
:
'3.4.0-alpha0
3
'
]
android
=
[
compileSdkVersion
:
29
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录