车前引导线 本地调试

This commit is contained in:
lianglihui
2022-01-06 15:06:37 +08:00
parent 542391e225
commit 64d9da5115
4 changed files with 49 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-aspectjx'
apply plugin: 'bugly'
//apply plugin: 'bugly'
apply plugin: 'apm-plugin'
//apply ByteX宿主
@@ -18,10 +18,10 @@ ByteX {
hooklog{
enableLoggerToServer true
}*/
bugly {
appId = 'ac71228f85' // 注册时分配的App ID
appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
}
//bugly {
// appId = 'ac71228f85' // 注册时分配的App ID
// appKey = '3c736249-d6be-4066-b577-b7a6dc975cf7' // 注册时分配的App Key
//}
Properties properties = new Properties();
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())

View File

@@ -28,7 +28,7 @@ buildscript {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31'
classpath "com.alibaba:arouter-register:1.0.12-mogo"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
classpath 'com.tencent.bugly:symtabfileuploader:latest.release'
// classpath 'com.tencent.bugly:symtabfileuploader:latest.release'
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
classpath 'com.volcengine:apm_insight_plugin:1.4.1'

View File

@@ -43,6 +43,7 @@ public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener,
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,this);
intiDrawer();
}
public static MogoRouteOverlayManager getInstance(Context context) {
@@ -56,6 +57,10 @@ public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener,
return sInstance;
}
private void intiDrawer(){
RouteOverlayDrawer.getInstance(mContext).initdraw();
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
if (trajectoryInfos == null || trajectoryInfos.size() == 0) {

View File

@@ -3,6 +3,7 @@ package com.mogo.module.service.routeoverlay;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.util.Log;
import com.mogo.commons.debug.DebugConfig;
@@ -48,7 +49,6 @@ public class RouteOverlayDrawer {
mogoOverlayManager = MogoApisHandler.getInstance().getApis().getMapServiceApi().getOverlayManager(mContext);
endingBitmap = BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon_route_ending);
}
public static RouteOverlayDrawer getInstance(Context context) {
@@ -112,6 +112,8 @@ public class RouteOverlayDrawer {
public void drawTrajectoryList(List<MogoLatLng> routeList) {
// clearMogoRouteOverlay();
long drawstart = System.currentTimeMillis();
mPolylinePointList.clear();
if (routeList != null) {
for (MogoLatLng latLng : routeList) {
@@ -119,7 +121,17 @@ public class RouteOverlayDrawer {
}
mPolylineColors.clear();
// mPolylineColors.addAll(ColorUtils.gradientAlpha_("#FF2AAFFD", "#7b2965ED", "#002965ED", mPolylinePointList.size()));
mPolylineColors.addAll(ColorUtils.gradientAlpha("#FF2AAFFD", "#002965ED", mPolylinePointList.size()));
long start = System.currentTimeMillis();
List<Integer> list = new ArrayList<>();
list = ColorUtils.gradientAlpha("#FF2AAFFD", "#002965ED", mPolylinePointList.size());
// int[] startColor = ColorUtils.hexToArgb("#FF2AAFFD");
// int[] endColor = ColorUtils.hexToArgb("#002965ED");
// list.add(Color.argb(startColor[0],startColor[1],startColor[2],startColor[3]));
// list.add(Color.argb(endColor[0],endColor[1],endColor[2],endColor[3]));
long end = System.currentTimeMillis();
Log.d("lianglihui","get color cost : "+ (end-start));
mPolylineColors.addAll(list);
// 线条粗细,渐变,渐变色值
mPolylineOptions.width(12).useGradient(true).colorValues(mPolylineColors);
if (mMoGoPolyline == null || mMoGoPolyline.isDestroyed()){
@@ -130,5 +142,29 @@ public class RouteOverlayDrawer {
mMoGoPolyline.setOption(mPolylineOptions);
}
}
long drawend = System.currentTimeMillis();
Log.d("lianglihui","drawTrajectoryList cost : "+ (drawend-drawstart));
}
public void initdraw() {
mPolylinePointList.clear();
MogoLatLng latLng = new MogoLatLng(MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat(),MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon());
mPolylinePointList.add(latLng);
mPolylinePointList.add(latLng);
mPolylineColors.clear();
long start = System.currentTimeMillis();
List<Integer> list = new ArrayList<>();
list = ColorUtils.gradientAlpha("#FF2AAFFD", "#002965ED", mPolylinePointList.size());
mPolylineColors.addAll(list);
// 线条粗细,渐变,渐变色值
mPolylineOptions.width(12).useGradient(true).colorValues(mPolylineColors);
if (mMoGoPolyline == null || mMoGoPolyline.isDestroyed()){
mPolylineOptions.points(mPolylinePointList);
mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions);
}else {
mPolylineOptions.points(mPolylinePointList);
mMoGoPolyline.setOption(mPolylineOptions);
}
}
}