Merge remote-tracking branch 'origin/dev_merge_shunyi_vr_map' into dev_merge_shunyi_vr_map

This commit is contained in:
wangcongtao
2020-12-25 10:02:43 +08:00
33 changed files with 936 additions and 271 deletions

View File

@@ -1,26 +0,0 @@
package com.mogo.module.extensions.net;
import com.mogo.commons.data.BaseData;
import java.util.Map;
import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
/**
* 时延验证相关接口
*
* @author tongchenfei
*/
public interface DelayCheckApiServices {
@GET("/yycp-test-service/net/delay/heartbeat")
Observable<BaseData> emptyInterface();
@POST("/yycp-test-service/net/delay/log")
@FormUrlEncoded
Observable<BaseData> uploadDelayCheckData(@FieldMap Map<String, Object> params);
}

View File

@@ -1,142 +0,0 @@
package com.mogo.module.extensions.utils;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.extensions.net.DelayCheckApiServices;
import com.mogo.module.extensions.net.DztHttpConstant;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.network.RequestOptions;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.schedulers.Schedulers;
/**
* 延时验证工具类
*
* @author tongchenfei
*/
public class DelayCheckUtil implements Handler.Callback {
private final Handler handler = new Handler(this);
private static final int MSG_CHECK_NET_CONNECT_STATUS = 1001;
private static final long FIRST_CHECK_NET_CONNECT_STATUS_DELAY = 10 * 60 * 1000;
private static final long CHECK_NET_CONNECT_STATUS_DELAY = 5000L;
private static final int MSG_START_DELAY_CHECK = 1002;
private static final long DELAY_CHECK_DELAY = 10 * 60 * 1000;
private final Context context;
public DelayCheckUtil(Context context) {
this.context = context;
}
/**
* 每5s检查一下网络状态网络状态为连接状态时开始空接口请求以及后续的参数上报
*/
public void waitingForCheck() {
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, FIRST_CHECK_NET_CONNECT_STATUS_DELAY);
}
private long requestTime, netDelay, requestSystemTime;
@Override
public boolean handleMessage(Message msg) {
switch (msg.what) {
case MSG_CHECK_NET_CONNECT_STATUS:
if (NetworkUtils.isConnected(context)) {
handler.sendEmptyMessage(MSG_START_DELAY_CHECK);
} else {
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
return true;
case MSG_START_DELAY_CHECK:
// 请求空接口
startEmptyRequest();
return true;
default:
return false;
}
}
private void startEmptyRequest() {
requestTime = SystemClock.elapsedRealtime();
requestSystemTime = System.currentTimeMillis();
MogoApisHandler.getInstance().getApis().getNetworkApi()
.create(DelayCheckApiServices.class, DztHttpConstant.getBaseUrl())
.emptyInterface().subscribeOn(Schedulers.io()).observeOn(Schedulers.io())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(context)) {
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
netDelay = SystemClock.elapsedRealtime() - requestTime;
startUpload();
}
@Override
public void onError(Throwable e) {
super.onError(e);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
});
}
private void startUpload() {
MogoLocation lastLocation = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
if (lastLocation == null) {
handler.sendEmptyMessageDelayed(MSG_START_DELAY_CHECK, DELAY_CHECK_DELAY);
return;
}
Map<String, Object> params = new HashMap<>(8);
params.put("sn", Utils.getSn());
params.put("startTime", requestSystemTime);
params.put("endTime", System.currentTimeMillis());
params.put("netState", NetworkUtils.netStrengthLevel);
params.put("place", lastLocation.getAddress());
params.put("cityCode", lastLocation.getCityCode());
params.put("lat", lastLocation.getLatitude());
params.put("lon", lastLocation.getLongitude());
MogoApisHandler.getInstance().getApis().getNetworkApi()
.create(DelayCheckApiServices.class, DztHttpConstant.getBaseUrl())
.uploadDelayCheckData(params).observeOn(Schedulers.io()).subscribeOn(Schedulers.io())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(context)) {
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
handler.sendEmptyMessageDelayed(MSG_START_DELAY_CHECK, DELAY_CHECK_DELAY);
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
@Override
public void onError(Throwable e) {
super.onError(e);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
});
}
}

View File

@@ -292,12 +292,12 @@ public class TopViewAnimHelper {
int scene = 0;
if (animNavInfoView.isVisible()) {
scene = Scene.NAVI_WITH_ROAD_EVENT;
animNavInfoView.animate().translationY(computeNaviMarginTop(child.getHeight())).start();
animNavInfoView.animate().translationY(computeNaviMarginTop(params.height)).start();
animNavInfoView.exchangeToSmall(true);
} else {
scene = Scene.AIMLESS_WITH_ROAD_EVENT;
}
topContainer.animate().translationY(child.getHeight()).setListener(mainAnimListener).start();
topContainer.animate().translationY(params.height).setListener(mainAnimListener).start();
Logger.d(TAG, "show top setMapCenterPointByScene: " + scene);
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
} catch (Exception e) {

View File

@@ -0,0 +1,39 @@
package com.mogo.module.main.delaycheck;
import com.mogo.commons.data.BaseData;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
/**
* 时延验证相关接口
*
* @author tongchenfei
*/
public interface DelayCheckApiServices {
/**
* 空接口
* @return 什么都不返回
*/
@GET("/yycp-test-service/net/delay/heartbeat")
Observable<BaseData> emptyInterface();
/**
* 时延上报接口 接口文档如下
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48967034
* @param params 相关参数,详见文档
* @return 相关返回值,详见文档
*/
@POST("/yycp-test-service/net/delay/log")
@Headers({"Content-type:application/json;charset=UTF-8"})
Observable<DelayCheckResponse> uploadDelayCheckData(@Body RequestBody params);
}

View File

@@ -0,0 +1,28 @@
package com.mogo.module.main.delaycheck;
import com.mogo.commons.debug.DebugConfig;
/**
* dzt base url
*
* @author tongchenfei
*/
public class DelayCheckHttpConstant {
public static final String HOST_DEV = "http://dzt-test.zhidaozhixing.com";
public static final String HOST_TEST = "http://dzt-test.zhidaozhixing.com";
public static final String HOST_DEMO = "http://dzt-show.zhidaozhixing.com";
public static final String HOST_PRODUCT = "http://dzt.zhidaozhixing.com";
public static String getBaseUrl(){
switch ( DebugConfig.getNetMode() ) {
case DebugConfig.NET_MODE_DEV:
return HOST_DEV;
case DebugConfig.NET_MODE_QA:
return HOST_TEST;
case DebugConfig.NET_MODE_DEMO:
return HOST_DEMO;
default:
return HOST_PRODUCT;
}
}
}

View File

@@ -0,0 +1,29 @@
package com.mogo.module.main.delaycheck;
import com.mogo.commons.data.BaseData;
/**
* 延迟检测response
*
* @author tongchenfei
*/
public class DelayCheckResponse extends BaseData {
private DelayCheckResult result;
public DelayCheckResult getResult() {
return result;
}
public void setResult(DelayCheckResult result) {
this.result = result;
}
@Override
public String toString() {
return "DelayCheckResponse{" +
"result=" + result +
", code=" + code +
", msg='" + msg + '\'' +
'}';
}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.module.main.delaycheck;
/**
* 延迟检查返回结果
*
* @author tongchenfei
*/
public class DelayCheckResult {
/**
* 是否保持心跳
*/
private boolean necessary;
/**
* 心跳间隔,单位 s
*/
private int beatSeconds;
public boolean isNecessary() {
return necessary;
}
public void setNecessary(boolean necessary) {
this.necessary = necessary;
}
public int getBeatSeconds() {
return beatSeconds;
}
public void setBeatSeconds(int beatSeconds) {
this.beatSeconds = beatSeconds;
}
@Override
public String toString() {
return "DelayCheckResult{" +
"necessary=" + necessary +
", beatSeconds=" + beatSeconds +
'}';
}
}

View File

@@ -0,0 +1,111 @@
package com.mogo.module.main.delaycheck;
/**
* 时延检测上报请求参数
*
* @author tongchenfei
*/
public class DelayCheckUploadRequest {
private String sn;
private long startTime;
private long endTime;
/**
* 请求时长
*/
private long burning;
/**
* 信号强度
*/
private int netState;
private String place;
private String cityCode;
private double lat;
private double lon;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public long getStartTime() {
return startTime;
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public long getBurning() {
return burning;
}
public void setBurning(long burning) {
this.burning = burning;
}
public int getNetState() {
return netState;
}
public void setNetState(int netState) {
this.netState = netState;
}
public String getPlace() {
return place;
}
public void setPlace(String place) {
this.place = place;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
@Override
public String toString() {
return "DelayCheckUploadRequest{" +
"sn='" + sn + '\'' +
", startTime=" + startTime +
", endTime=" + endTime +
", burning=" + burning +
", netState=" + netState +
", place='" + place + '\'' +
", cityCode='" + cityCode + '\'' +
", lat=" + lat +
", lon=" + lon +
'}';
}
}

View File

@@ -0,0 +1,160 @@
package com.mogo.module.main.delaycheck;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.schedulers.Schedulers;
import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
* 延时验证工具类
*
* @author tongchenfei
*/
public class DelayCheckUtil implements Handler.Callback {
private static final String TAG = "DelayCheckUtil";
private final Handler handler = new Handler(this);
private static final int MSG_CHECK_NET_CONNECT_STATUS = 1001;
/**
* 首次延时检测时间间隔暂定10分钟等待机器稳定后再做打算
*/
private static final long FIRST_CHECK_NET_CONNECT_STATUS_DELAY = 10 * 60 * 1000;
private static final long CHECK_NET_CONNECT_STATUS_DELAY = 5000L;
private static final int MSG_START_DELAY_CHECK = 1002;
/**
* 默认检测时间间隔,若服务端正确返回,以服务端返回为主
*/
private static final long DELAY_CHECK_DELAY = 10 * 60 * 1000;
private final Context context;
public DelayCheckUtil(Context context) {
this.context = context;
}
/**
* 每5s检查一下网络状态网络状态为连接状态时开始空接口请求以及后续的参数上报
*/
public void waitingForCheck() {
Logger.d(TAG, "waitingForCheck===");
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, FIRST_CHECK_NET_CONNECT_STATUS_DELAY);
}
private long requestTime, netDelay, requestStartSystemTime,requestEndSystem;
@Override
public boolean handleMessage(Message msg) {
switch (msg.what) {
case MSG_CHECK_NET_CONNECT_STATUS:
if (NetworkUtils.isConnected(context)) {
handler.sendEmptyMessage(MSG_START_DELAY_CHECK);
} else {
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
return true;
case MSG_START_DELAY_CHECK:
// 请求空接口
startEmptyRequest();
return true;
default:
return false;
}
}
private void startEmptyRequest() {
Logger.d(TAG, "start empty request");
requestTime = SystemClock.elapsedRealtime();
requestStartSystemTime = System.currentTimeMillis();
MogoApisHandler.getInstance().getApis().getNetworkApi()
.create(DelayCheckApiServices.class, DelayCheckHttpConstant.getBaseUrl())
.emptyInterface().subscribeOn(Schedulers.io()).observeOn(Schedulers.io())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(context)) {
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
requestEndSystem = System.currentTimeMillis();
netDelay = SystemClock.elapsedRealtime() - requestTime;
startUpload();
}
@Override
public void onError(Throwable e) {
super.onError(e);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
});
}
private void startUpload() {
Logger.d(TAG, "start upload");
MogoLocation lastLocation = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation();
if (lastLocation == null) {
handler.sendEmptyMessageDelayed(MSG_START_DELAY_CHECK, DELAY_CHECK_DELAY);
return;
}
Logger.d(TAG, "lastLocation: " + lastLocation);
DelayCheckUploadRequest request = new DelayCheckUploadRequest();
request.setSn(Utils.getSn());
request.setStartTime(requestStartSystemTime);
request.setEndTime(requestEndSystem);
request.setNetState(NetworkUtils.netStrengthLevel);
request.setPlace(lastLocation.getAddress());
request.setCityCode(lastLocation.getCityCode());
request.setLat(lastLocation.getLatitude());
request.setLon(lastLocation.getLongitude());
request.setBurning(netDelay);
RequestBody params = RequestBody.create(MediaType.get("application/json"), GsonUtil.jsonFromObject(request));
MogoApisHandler.getInstance().getApis().getNetworkApi()
.create(DelayCheckApiServices.class, DelayCheckHttpConstant.getBaseUrl())
.uploadDelayCheckData(params).observeOn(Schedulers.io()).subscribeOn(Schedulers.io())
.subscribe(new SubscribeImpl<DelayCheckResponse>(RequestOptions.create(context)) {
@Override
public void onSuccess(DelayCheckResponse o) {
super.onSuccess(o);
Logger.d(TAG, "上报时延成功 " + o);
DelayCheckResult result = o.getResult();
if(result.isNecessary()) {
handler.sendEmptyMessageDelayed(MSG_START_DELAY_CHECK, result.getBeatSeconds() * 1000);
}
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
@Override
public void onError(Throwable e) {
super.onError(e);
handler.sendEmptyMessageDelayed(MSG_CHECK_NET_CONNECT_STATUS, CHECK_NET_CONNECT_STATUS_DELAY);
}
});
}
}

View File

@@ -14,6 +14,7 @@ import com.mogo.map.location.MogoLocation;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.main.EventDispatchCenter;
import com.mogo.module.main.cards.MogoModulesManager;
import com.mogo.module.main.delaycheck.DelayCheckUtil;
import com.mogo.service.IMogoServiceApis;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
@@ -48,6 +49,9 @@ class MogoMainService extends Service implements IMogoLocationListener {
initGpsSimulatorListener();
}, 2_000L
);
// 开启延时检测
DelayCheckUtil delayCheckUtil = new DelayCheckUtil(this);
delayCheckUtil.waitingForCheck();
}
@Nullable

View File

@@ -1,4 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.small.map">
<application>
<service
android:name=".SmallMapService"
android:exported="false"
android:process=":smallMap"/>
</application>
</manifest>

View File

@@ -0,0 +1,134 @@
package com.mogo.module.small.map;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.view.Gravity;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.mogo.module.common.entity.MogoSnapshotSetData;
import com.mogo.module.common.machinevision.IMachineVisionInterface;
import com.mogo.module.common.wm.WindowManagerView;
import com.mogo.utils.logger.Logger;
/**
* @author donghongyu
* @date 12/10/20 1:35 PM
*/
public class SmallMapService extends Service {
private static final String TAG = "MachineVisionMapService";
private IBinder mBinder;
private WindowManagerView mWindowManagerView;
private SmallMapDirectionView mSmallMapDirectionView;
@Override
public void onCreate() {
super.onCreate();
Logger.d(TAG, "onCreate");
addSmallMapView();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
Logger.d(TAG, "onBind");
mBinder = new SmallMapServiceBinder();
return mBinder;
}
@Override
public void onRebind(Intent intent) {
super.onRebind(intent);
addSmallMapView();
Logger.d(TAG, "onRebind");
}
@Override
public boolean onUnbind(Intent intent) {
Logger.d(TAG, "onUnbind");
if (mWindowManagerView != null && mWindowManagerView.isShowing()) {
mWindowManagerView.dismiss();
}
mWindowManagerView = null;
return true;
}
@Override
public void onDestroy() {
super.onDestroy();
Logger.d(TAG, "onDestroy");
if (mWindowManagerView != null) {
mWindowManagerView.dismiss();
}
}
/**
* 添加小地图View
*/
private void addSmallMapView() {
Logger.d(TAG, "addSmallMapView");
// 初始化小地图控件
mSmallMapDirectionView = new SmallMapDirectionView(getApplicationContext());
mWindowManagerView = new WindowManagerView.Builder(getApplicationContext())
.contentView(mSmallMapDirectionView)
.size(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
.position(
getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_x),
getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_y)
)
.gravity(Gravity.TOP | Gravity.LEFT)
.showInWindowManager();
mWindowManagerView.show();
}
/**
* 小地图与大地图之间进程通讯
*/
public class SmallMapServiceBinder extends IMachineVisionInterface.Stub {
@Override
public void linkToDeath(@NonNull DeathRecipient recipient, int flags) {
super.linkToDeath(recipient, flags);
Logger.d(TAG, "linkToDeath");
}
@Override
public boolean unlinkToDeath(@NonNull DeathRecipient recipient, int flags) {
Logger.d(TAG, "unlinkToDeath");
return super.unlinkToDeath(recipient, flags);
}
@Override
public void postData(MogoSnapshotSetData data) throws RemoteException {
Logger.d(TAG, "postData");
}
@Override
public void hideViewIfExist() throws RemoteException {
Logger.d(TAG, "hideViewIfExist");
}
@Override
public void showViewIfExist() throws RemoteException {
Logger.d(TAG, "showViewIfExist");
}
}
}

View File

@@ -1,24 +1,22 @@
package com.mogo.module.small.map;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.wm.WindowManagerView;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.map.IMogoSmallMapProvider;
import com.mogo.service.module.ModuleType;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.logger.Logger;
/**
* @author donghongyu
@@ -28,11 +26,9 @@ import com.mogo.utils.logger.Logger;
public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusChangedListener {
private final String TAG = "SmallVisionProvider";
private Intent mSmallMapServiceIntent;
private Context mContext;
private WindowManagerView mWindowManagerView;
private SmallMapDirectionView mSmallMapDirectionView;
@Override
public Fragment createFragment(Context context, Bundle data) {
return null;
@@ -80,22 +76,22 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
public void onDestroy() {
Log.d(TAG, "小地图模块销毁……");
hidePanel();
// 释放组件内存
mSmallMapDirectionView = null;
mWindowManagerView = null;
}
@Override
public void showPanel() {
Log.d(TAG, "小地图模块触发展示……");
addSmallMapView();
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
mSmallMapServiceIntent = new Intent(mContext, SmallMapService.class);
mContext.startService(mSmallMapServiceIntent);
}
}
@Override
public void hidePanel() {
Log.d(TAG, "小地图模块触发隐藏……");
if (mWindowManagerView != null && mWindowManagerView.isShowing()) {
mWindowManagerView.dismiss();
if (mSmallMapServiceIntent != null) {
AbsMogoApplication.getApp().stopService(mSmallMapServiceIntent);
}
}
@@ -126,33 +122,4 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
}
}
}
/**
* 添加小地图View
*/
private void addSmallMapView() {
Logger.d(TAG, "addSmallMapView");
// 初始化小地图控件
if (mSmallMapDirectionView == null) {
mSmallMapDirectionView = new SmallMapDirectionView(mContext);
}
if (mWindowManagerView == null) {
mWindowManagerView = new WindowManagerView.Builder(mContext)
.contentView(mSmallMapDirectionView)
.size(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
.position(
mContext.getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_x),
mContext.getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_y)
)
.gravity(Gravity.TOP | Gravity.LEFT)
.showInWindowManager();
}
mWindowManagerView.show();
}
}

View File

@@ -111,19 +111,19 @@ public class V2XAlarmServer {
}
// 进行提醒
if (!isAlreadyAlert) {
Logger.w(MODULE_NAME, "V2X预警--车辆与事件信息:" +
"\n事件详情ID" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
"\n事件详情" + GsonUtil.jsonFromObject(v2XRoadEventEntity.getNoveltyInfo()) +
"\n距离" + v2XRoadEventEntity.getDistance() + "" +
"\n是否已经提醒" + isAlreadyAlert +
"\n当前车辆-经度:" + currentLocation.getLongitude() +
"\n当前车辆-经度:" + currentLocation.getLatitude() +
"\n当前车辆-角度:" + currentLocation.getBearing() +
"\n道路事件-经度:" + eventLocation.getLon() +
"\n道路事件-经度:" + eventLocation.getLat() +
"\n道路事件-角度:" + eventLocation.getAngle() +
"\n夹角角度" + eventAngle + ""
);
// Logger.w(MODULE_NAME, "V2X预警--车辆与事件信息:" +
// "\n事件详情ID" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
// "\n事件详情" + GsonUtil.jsonFromObject(v2XRoadEventEntity.getNoveltyInfo()) +
// "\n距离" + v2XRoadEventEntity.getDistance() + "米" +
// "\n是否已经提醒" + isAlreadyAlert +
// "\n当前车辆-经度:" + currentLocation.getLongitude() +
// "\n当前车辆-经度:" + currentLocation.getLatitude() +
// "\n当前车辆-角度:" + currentLocation.getBearing() +
// "\n道路事件-经度:" + eventLocation.getLon() +
// "\n道路事件-经度:" + eventLocation.getLat() +
// "\n道路事件-角度:" + eventLocation.getAngle() +
// "\n夹角角度" + eventAngle + " 度"
// );
mAlertRoadEventList.put(v2XRoadEventEntity, TimeUtils.getNowString());
return v2XRoadEventEntity;
}
@@ -141,13 +141,13 @@ public class V2XAlarmServer {
// );
}
} else {
Logger.w(MODULE_NAME,
"V2X预警--车头方向与事件方向角度不一致:" +
"\n事件详情" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
"\n车头方向 " + carBearing +
"\n事件方向" + eventBearing +
"\n角度差值" + diffAngle
);
// Logger.w(MODULE_NAME,
// "V2X预警--车头方向与事件方向角度不一致:" +
// "\n事件详情" + v2XRoadEventEntity.getNoveltyInfo().getInfoId() +
// "\n车头方向 " + carBearing +
// "\n事件方向" + eventBearing +
// "\n角度差值" + diffAngle
// );
}
} else {
// Logger.w(MODULE_NAME, "V2X预警--车辆距离事件距离大于500米了" +
@@ -156,10 +156,10 @@ public class V2XAlarmServer {
// );
}
} else {
Logger.e(MODULE_NAME,
"V2X预警--道路事件没有角度信息" +
"\n事件详情" + v2XRoadEventEntity.getNoveltyInfo().getInfoId()
);
// Logger.e(MODULE_NAME,
// "V2X预警--道路事件没有角度信息" +
// "\n事件详情" + v2XRoadEventEntity.getNoveltyInfo().getInfoId()
// );
}
}
}

View File

@@ -80,6 +80,14 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
super.draw(canvas);
}
@Override
public void setBackgroundResource(int resId) {
super.setBackgroundResource(resId);
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.onSetBackgroundResource(resId);
}
}
@Override
public void applySkin() {
if (mBackgroundTintHelper != null) {