Merge branch 'dev_merge_shunyi_vr_map' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into dev_merge_shunyi_vr_map

This commit is contained in:
tongchenfei
2020-12-14 16:11:38 +08:00
41 changed files with 414 additions and 102 deletions

View File

@@ -123,7 +123,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
}
// f系列-分体机
f80x {
@@ -148,6 +149,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
}
// f系列-分体机-高德
f8Amap {
@@ -172,6 +175,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
}
// e系列采用Launcher方案
e8xx {
@@ -196,6 +201,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// 同上
em4 {
@@ -220,6 +227,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// e系列-2+32对标D系列2+32采用独立app的形式
em3 {
@@ -244,6 +253,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// e系列-1+16对标D系列1+16采用独立app形式
em1 {
@@ -268,6 +279,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'false'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// e系列-1+16对标D系列1+16采用独立app形式
em2 {
@@ -292,6 +305,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'false'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// d系列
d8xx {
@@ -316,6 +331,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'true'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// d系列 2 + 32
d80x {
@@ -340,6 +357,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'true'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// d系列 1+16 版本
d82x {
@@ -364,6 +383,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'false'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'true'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
// 比亚迪
bydauto {
@@ -388,6 +409,8 @@ android {
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'false'
}
qa {
dimension "env"

View File

@@ -35,8 +35,8 @@
-dontskipnonpubliclibraryclasses
# 指定不去忽略包可见的库类的成员
-dontskipnonpubliclibraryclassmembers
#进行优化,建议使用此选项,
-dontoptimize
# class 进行优化,默认是开启优化的由于优化会进行类合并内联等,使用热修复的应用,建议关闭优化
#-dontoptimize
# 不进行预校验,Android不需要,可加快混淆速度
-dontpreverify

View File

@@ -141,6 +141,7 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setMapBased( BuildConfig.IS_MAP_BASED );
DebugConfig.setNeedLoadGuideModule( BuildConfig.IS_NEED_LOAD_GUIDE_MODULE );
DebugConfig.setNeedHideAdasWhenShare( BuildConfig.IS_NEED_HIDE_ADAS_WHEN_SHARE );
DebugConfig.setNeedUploadCoordinatesInTime( BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME );
// DebugConfig.setObuType( BuildConfig.OBU_TYPE );
}

View File

@@ -183,7 +183,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
WebSocketData webSocketData = GsonUtil.objectFromJson(message, WebSocketData.class);
int msgType = webSocketData.getMsgType();
Logger.d(TAG, "websocket received msg type = " + msgType);
// Logger.d("liyz", "websocket received msg = " + message + "----type = " + msgType);
//服务端下发数据返回,上传数据回执默认不返回
if (msgType == MSG_TYPE_DOWNLINK_CAR_DATA.getMsgType()) {
List<IMogoOnWebSocketMessageListener> listeners = mListeners.get(msgType);
@@ -192,6 +192,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
while (iterator.hasNext()) {
IMogoOnWebSocketMessageListener listener = iterator.next();
if (listener != null) {
// Logger.d("liyz", "received msgId = " + webSocketData.getSeq() + ", content = " + webSocketData.getData());
Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = " + webSocketData.getData());
Object receiveObj = GsonUtil.objectFromJson(webSocketData.getData(),listener.target());
listener.onMsgReceived(receiveObj);

View File

@@ -1,6 +1,7 @@
package com.mogo.commons;
import android.app.Application;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -24,6 +25,7 @@ import com.mogo.commons.storage.SpStorage;
import com.mogo.httpdns.IMogoHttpDns;
import com.mogo.httpdns.MogoHttpDnsHandler;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.TipDrawable;
import com.mogo.utils.TipToast;
import com.mogo.utils.network.NetConfig;
import com.mogo.utils.storage.SharedPrefsMgr;
@@ -85,25 +87,33 @@ public abstract class AbsMogoApplication extends Application {
if ( TextUtils.isEmpty( message ) ) {
return null;
}
View contentView;
if ( tipDrawable == null ) {
contentView = LayoutInflater.from( context ).inflate( R.layout.module_commons_layout_toast, null );
TextView txt = contentView.findViewById( R.id.module_commons_toast_msg );
txt.setText( message );
} else {
// 有图片,使用带图片的布局,当前只实现了左侧图片
contentView = LayoutInflater.from( context ).inflate( R.layout.module_commons_layout_toast_with_left_drawable, null );
TextView txt = contentView.findViewById( R.id.module_commons_toast_msg );
ImageView img = contentView.findViewById( R.id.module_commons_toast_left_drawable );
img.setImageDrawable( tipDrawable.getDrawable() );
ViewGroup.LayoutParams params = img.getLayoutParams();
params.width = tipDrawable.getWidth();
params.height = tipDrawable.getHeight();
txt.setText( message );
try {
View contentView = generateToastView( context, message, tipDrawable );
return contentView;
} catch ( Exception e ) {
}
return contentView;
return null;
} ) );
DebugConfig.setUseCustomMap( SharedPrefsMgr.getInstance( this ).getBoolean( "useCustomMap", false ) );
}
private View generateToastView( Context context, String message, TipDrawable tipDrawable){
View contentView;
if(tipDrawable==null) {
contentView = LayoutInflater.from(context).inflate(R.layout.module_commons_layout_toast, null);
TextView txt = contentView.findViewById(R.id.module_commons_toast_msg);
txt.setText(message);
}else{
// 有图片,使用带图片的布局,当前只实现了左侧图片
contentView = LayoutInflater.from(context).inflate(R.layout.module_commons_layout_toast_with_left_drawable, null);
TextView txt = contentView.findViewById(R.id.module_commons_toast_msg);
ImageView img = contentView.findViewById(R.id.module_commons_toast_left_drawable);
img.setImageDrawable(tipDrawable.getDrawable());
ViewGroup.LayoutParams params = img.getLayoutParams();
params.width = tipDrawable.getWidth();
params.height = tipDrawable.getHeight();
txt.setText(message);
}
return contentView;
}
/**

View File

@@ -371,4 +371,17 @@ public class DebugConfig {
public static void setNeedHideAdasWhenShare( boolean isNeedHideAdas ) {
DebugConfig.isNeedHideAdasWhenShare = isNeedHideAdas;
}
/**
* 是否需要实时上报坐标位置
*/
private static boolean sIsNeedUploadCoordinatesInTime = false;
public static boolean isNeedUploadCoordinatesDurationInTime() {
return sIsNeedUploadCoordinatesInTime;
}
public static void setNeedUploadCoordinatesInTime( boolean sIsNeedUploadCoordinatesInTime ) {
DebugConfig.sIsNeedUploadCoordinatesInTime = sIsNeedUploadCoordinatesInTime;
}
}

View File

@@ -138,9 +138,9 @@ HTTPDNS_NOOP_VERSION = 2.0.12
######## 外部依赖引用
# 车聊聊
CARCHATTING_VERSION=2.2.11
CARCHATTING_VERSION=2.2.14
# 车聊聊接口
CARCHATTINGPROVIDER_VERSION=1.1.7
CARCHATTINGPROVIDER_VERSION=1.1.8
# loglib
LOGLIB_VERSION = 1.0.4

View File

@@ -35,6 +35,7 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
private void init( Context context ) {
addMapView( context );
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
}
protected abstract void addMapView( Context context );

View File

@@ -0,0 +1,90 @@
package com.mogo.module.common.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.mogo.module.common.R;
import com.mogo.skin.support.IMogoSkinCompatSupportable;
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/3/25 11:39 AM
* desc :
* version: 1.0
*/
public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSupportable {
private float roundLayoutRadius = 14f;
private Path roundPath;
private RectF rectF;
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
public RoundLayout(Context context) {
this(context, null);
}
public RoundLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RoundLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundLayout);
roundLayoutRadius = typedArray.getDimensionPixelSize(R.styleable.RoundLayout_roundLayoutRadius, (int) roundLayoutRadius);
typedArray.recycle();
init();
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
}
private void init() {
setWillNotDraw(false);//如果你继承的是ViewGroup,注意此行,否则draw方法是不会回调的;
roundPath = new Path();
rectF = new RectF();
}
private void setRoundPath() {
//添加一个圆角矩形到path中, 如果要实现任意形状的View, 只需要手动添加path就行
roundPath.addRoundRect(rectF, roundLayoutRadius, roundLayoutRadius, Path.Direction.CW);
}
public void setRoundLayoutRadius(float roundLayoutRadius) {
this.roundLayoutRadius = roundLayoutRadius;
setRoundPath();
postInvalidate();
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
rectF.set(0f, 0f, getMeasuredWidth(), getMeasuredHeight());
setRoundPath();
}
@Override
public void draw(Canvas canvas) {
if (roundLayoutRadius > 0f) {
canvas.clipPath(roundPath);
}
super.draw(canvas);
}
@Override
public void applySkin() {
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.applySkin();
}
}
}

View File

@@ -27,4 +27,8 @@
<item name="android:progressDrawable">@drawable/module_commons_heart_ratingbar_drawable</item>
</style>
<declare-styleable name="RoundLayout">
<attr name="roundLayoutRadius" format="dimension" />
</declare-styleable>
</resources>

View File

@@ -34,7 +34,6 @@ public class EntranceProvider implements IMogoModuleProvider {
public Fragment createFragment( Context context, Bundle data ) {
mFragment = new EntranceFragment();
mFragment.setArguments( data );
Log.d("liyz", " createFragment ------> ");
ExtensionServiceManager.init(context);
return mFragment;
}
@@ -77,7 +76,6 @@ public class EntranceProvider implements IMogoModuleProvider {
@Override
public void init( Context context ) {
Log.d("liyz", " EntranceProvider init ------> ");
ExtensionServiceManager.init(context);
}

View File

@@ -28,7 +28,7 @@ import com.tencent.rtmp.ui.TXCloudVideoView;
* V2XLiveGSYVideoView
*/
public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkinCompatSupportable {
private static final String TAG = "CameraLiveGSYVideoView";
private static final String TAG = "liyz";
private TXCloudVideoView mTxcVideoView;
private ProgressBar mLoading;
@@ -150,6 +150,7 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
}
} catch (Exception e) {
e.printStackTrace();
Logger.w(TAG, "播放器onNetStatus e = " + e);
mLoading.setVisibility(GONE);
mClLoadError.setVisibility(VISIBLE);
}

View File

@@ -17,28 +17,28 @@ import com.mogo.utils.logger.Logger;
* 路边摄像头直播控制 V2XPushLiveCarScenario
*/
public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implements IMogoTopViewStatusListener {
private static final String TAG = "CameraLiveManager";
private static CameraLiveManager mCameraLiveCarScenario;
private static final String TAG = "liyz";
private static CameraLiveManager mCameraLiveManager;
private boolean isShowWindow;
private CameraLiveManager() {
}
public static CameraLiveManager getInstance() {
if (mCameraLiveCarScenario == null) {
if (mCameraLiveManager == null) {
synchronized (CameraLiveManager.class) {
if (mCameraLiveCarScenario == null) {
mCameraLiveCarScenario = new CameraLiveManager();
mCameraLiveCarScenario.setV2XWindow(new PushCameraLiveWindow());
if (mCameraLiveManager == null) {
mCameraLiveManager = new CameraLiveManager();
mCameraLiveManager.setV2XWindow(new PushCameraLiveWindow());
}
}
}
return mCameraLiveCarScenario;
return mCameraLiveManager;
}
@Override
public void init(@Nullable CloudRoadData cloudRoadData) {
Log.d(TAG, "CameraLiveManager init -----> ");
Log.d(TAG, "CameraLiveManager init -----> isShowWindow = " + isShowWindow);
if (isShowWindow) {
close();
}
@@ -54,11 +54,10 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
@Override
public void showWindow() {
Log.d(TAG, "CameraLiveManager showWindow --------");
Log.d(TAG, "CameraLiveManager showWindow getV2XWindow = " + getV2XWindow());
if (getV2XWindow() != null) {
ViewGroup.LayoutParams layoutParams =
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
(int) AbsMogoApplication.getApp().getResources()
.getDimension(R.dimen.module_video_window_height_content));
@@ -67,7 +66,6 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
getV2XWindow().show(getmCloudRoadData());
isShowWindow = true;
// ExtensionServiceManager.getMoGoV2XStatusManager().setRoadLiveCarWindowShow(TAG, true);
}
}
@@ -77,7 +75,6 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
getV2XWindow().close();
}
isShowWindow = false;
// ExtensionServiceManager.getMoGoV2XStatusManager().setRoadLiveCarWindowShow(TAG, false);
}
@Override

View File

@@ -77,7 +77,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
Logger.w(TAG, "更新直播信息 show entity = " + entity);
if (!TextUtils.isEmpty(entity.getRtmpUrl())) {
Logger.w(TAG, "entity.getRtmpUrl() = " + entity.getRtmpUrl());
mIvReportHead.setVisibility(VISIBLE);
mIvReportHead.setVisibility(INVISIBLE);
ExtensionServiceManager.getImageLoader()
.displayImage(entity.getRtmpUrl(), mIvReportHead);
mLiveGSYVideoView.startLive(entity.getRtmpUrl());

View File

@@ -3,13 +3,12 @@ package com.mogo.module.extensions.utils;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.entity.CloudRoadData;
import com.mogo.module.common.entity.MogoSnapshotSetData;
import com.mogo.module.extensions.R;
@@ -18,6 +17,7 @@ import com.mogo.module.extensions.live.ExtensionServiceManager;
import com.mogo.module.extensions.live.PushDataType;
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
import com.mogo.service.connection.WebSocketMsgType;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
@@ -26,15 +26,25 @@ import com.mogo.utils.logger.Logger;
*
*/
public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<MogoSnapshotSetData> {
private static final String TAG = "CameraLiveNoticeHelper";
private static final String TAG = "liyz";
private Context mContext;
private static IMogoMarker mMogoMarker;
private CloudRoadData mCloudRoadData;
public void init(Context context) {
Logger.d(TAG, "init====");
Logger.d(TAG, "init ======= ");
mContext = context;
//test
// UiThreadHandler.postDelayed( () -> {
// mCloudRoadData = new CloudRoadData();
// mCloudRoadData.setRtmpUrl("rtmp://58.200.131.2:1935/livetv/hunantv");
// mCloudRoadData.setLat(40.200353);
// mCloudRoadData.setLon(116.745467);
// CameraLiveManager.getInstance().init(mCloudRoadData);
// }, 2_000 );
ExtensionServiceManager
.getMogoRegisterCenter().registerMogoMarkerClickListener(PushDataType.TYPE_PUSH_CAMERA_DATA, new IMogoMarkerClickListener() {
@Override
@@ -66,23 +76,19 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
* @param roadData
*/
private void addCameraMarker(CloudRoadData roadData) {
Logger.d(TAG, "addCameraMarker ------ ");
Logger.d(TAG, "addCameraMarker ------lat = " + roadData.getLat() + "--lon =" + roadData.getLon());
MogoMarkerOptions options = new MogoMarkerOptions()
.object(roadData)
.latitude(roadData.getLat())
.longitude(roadData.getLon());
options.anchor(0.5f, 0.5f);
// options.anchor(0.5f, 0.5f);
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.module_camera_real_time_traffic, null);
options.icon(bitmap);
mMogoMarker = MogoApisHandler
.getInstance()
.getApis()
.getMapServiceApi()
.getMarkerManager(AbsMogoApplication.getApp())
.addMarker(DataTypes.TYPE_MARKER_PUSH_DATA, options);
mMogoMarker = ExtensionServiceManager.getMapService().getMarkerManager(mContext)
.addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
//TODO
ExtensionServiceManager.getMapService().getMarkerManager(mContext).addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
}
private void removeCameraMarker() {
@@ -102,19 +108,28 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
return MogoSnapshotSetData.class;
}
/**
*
* @param obj
*/
@Override
public void onMsgReceived(MogoSnapshotSetData obj) {
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
mCloudRoadData = obj.getTrafficLight();
if (mCloudRoadData != null) {
Logger.d(TAG, "onMsgReceived cameralive : ");
//添加marker TODO
addCameraMarker(mCloudRoadData);
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
if (obj != null) {
mCloudRoadData = obj.getCamera();
if (mCloudRoadData != null) {
Logger.d(TAG, "onMsgReceived getRtmpUrl = " + mCloudRoadData.getRtmpUrl());
//添加marker TODO
addCameraMarker(mCloudRoadData);
} else {
//删除marker TODO
UiThreadHandler.postDelayed( () -> {
removeCameraMarker();
}, 2_000 );
}
} else {
//删除marker TODO
removeCameraMarker();
Log.e(TAG, "onMsgReceived obj == null ");
}
}

View File

@@ -10,10 +10,9 @@
<com.mogo.module.extensions.live.CameraLiveGSYVideoView
android:id="@+id/videoPlayer"
android:layout_width="match_parent"
android:layout_height="@dimen/v2x_video_window_height_content"
android:layout_height="@dimen/module_video_window_height_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:roundLayoutRadius="@dimen/dp_30" />
@@ -32,6 +31,6 @@
app:miv_placeHolder="@drawable/icon_default_user_head"
app:miv_shape="circle"
app:miv_shapeBorderWidth="@dimen/dp_4"
tools:visibility="visible" />
tools:visibility="invisible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rlRoadEventDetail"
android:layout_width="match_parent"
android:layout_height="@dimen/v2x_video_window_height_content"
android:layout_height="@dimen/module_video_window_height_content"
android:clipToPadding="false">
<include

View File

@@ -4,5 +4,6 @@
<dimen name="module_common_btn_bottom">0px</dimen>
<dimen name="module_entrance_id_button_marginLeft">-6px</dimen>
<dimen name="module_event_live_error_text_size">20px</dimen>
<dimen name="module_video_window_height_content">370px</dimen>
<dimen name="module_video_window_height_content">300px</dimen>
<dimen name="module_video_window_width_content">400px</dimen>
</resources>

View File

@@ -14,6 +14,6 @@
<dimen name="module_ext_navi_width">-1</dimen>
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
<dimen name="module_event_live_error_text_size">20px</dimen>
<dimen name="module_video_window_height_content">370px</dimen>
<dimen name="module_video_window_height_content">300px</dimen>
<dimen name="module_video_window_width_content">400px</dimen>
</resources>

View File

@@ -161,5 +161,6 @@
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
<dimen name="module_event_live_error_text_size">36px</dimen>
<dimen name="module_video_window_height_content">664px</dimen>
<dimen name="module_video_window_height_content">393px</dimen>
<dimen name="module_video_window_width_content">700px</dimen>
</resources>

View File

@@ -178,6 +178,7 @@
<dimen name="module_ext_navi_small_margin_right">20px</dimen>
<dimen name="module_event_live_error_text_size">36px</dimen>
<dimen name="module_video_window_height_content">664px</dimen>
<dimen name="module_video_window_height_content">393px</dimen>
<dimen name="module_video_window_width_content">700px</dimen>
</resources>

View File

@@ -238,7 +238,8 @@
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_txt_size">36px</dimen>
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_unit_size">21px</dimen>
<dimen name="module_ext_navi_in_vr_traffic_light_no_time_margin_top">21px</dimen>
<dimen name="module_video_window_width_content">400px</dimen>
<dimen name="module_video_window_height_content">300px</dimen>
<dimen name="module_video_window_height_content">370px</dimen>
</resources>

View File

@@ -19,6 +19,7 @@ import com.mogo.map.navi.MogoCongestionInfo;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
import com.mogo.utils.logger.Logger;
@@ -274,6 +275,13 @@ public class EventDispatchCenter implements
}
}
}
if ( ui == EnumMapUI.Type_VR ) {
MogoApisHandler.getInstance().getApis().getStatusManagerApi()
.setVrMode( TAG, true );
} else {
MogoApisHandler.getInstance().getApis().getStatusManagerApi()
.setVrMode( TAG, false );
}
}
@Override

View File

@@ -122,6 +122,10 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
}
if (descriptor == StatusDescriptor.VR_MODE) {
if (mWindowView == null) {
return;
}
ServiceMediaHandler.getMogoWindowManager().removeView(mWindowView);
mHasAddWindow = false;
addWindowView();

View File

@@ -10,10 +10,12 @@ import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.service.location.MogoRTKLocation;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoModuleProvider;
@@ -97,7 +99,9 @@ public class MogoServiceProvider implements IMogoModuleProvider {
public void init( Context context ) {
Logger.d( TAG, "init" );
MarkerServiceHandler.init( context );
MogoRTKLocation.getInstance().init();
if ( DebugConfig.isNeedUploadCoordinatesDurationInTime() ) {
MogoRTKLocation.getInstance().init();
}
MogoServices.getInstance().preInit( context );
UiThreadHandler.postDelayed( () -> {
MogoServices.getInstance().init( AbsMogoApplication.getApp() );

View File

@@ -1,15 +1,9 @@
package com.mogo.module.service.ttsConfig;
import com.mogo.commons.data.BaseData;
import com.mogo.module.service.network.bean.TtsConfigEntity;
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 zhuangyan

View File

@@ -4,7 +4,10 @@ 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;
@@ -19,16 +22,22 @@ import com.mogo.utils.logger.Logger;
public class SmallMapService extends Service {
private static final String TAG = "MachineVisionMapService";
private IBinder mBinder;
private WindowManagerView mWindowManagerView;
private SmallMapView mMapView;
@Override
public void onCreate() {
super.onCreate();
Logger.d(TAG, "onCreate");
addMachineVisionMapView();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
mBinder = new SmallMapServiceBinder();
addMachineVisionMapView();
Logger.d(TAG, "onBind");
mBinder = new SmallMapServiceBinder();
return mBinder;
}
@@ -41,17 +50,39 @@ public class SmallMapService extends Service {
@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();
}
}
private void addMachineVisionMapView() {
Logger.d(TAG, "addMachineVisionMapView");
mWindowManagerView = new WindowManagerView.Builder(getApplicationContext())
.contentView(R.layout.module_small_map_view)
.size(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT
)
.position(
getResources().getDimensionPixelOffset( R.dimen.module_mvision_view_x ),
getResources().getDimensionPixelOffset( R.dimen.module_mvision_view_y )
)
.gravity(Gravity.TOP | Gravity.LEFT)
.showInWindowManager();
mWindowManagerView.show();
}
@@ -61,19 +92,38 @@ public class SmallMapService extends Service {
*/
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

@@ -2,18 +2,19 @@ package com.mogo.module.small.map;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.map.MogoBaseMapView;
import com.mogo.utils.logger.Logger;
/**
* @author donghongyu
* @date 12/10/20 1:35 PM
*/
public class SmallMapView extends MogoBaseMapView {
private final String TAG = "SmallMapView";
private static final String TAG = "SmallMapView";
public SmallMapView(Context context) {
this(context, null);
@@ -28,7 +29,7 @@ public class SmallMapView extends MogoBaseMapView {
}
@Override
protected void addMapView( Context context ) {
protected void addMapView(Context context) {
Logger.d(TAG, "addMapView");
}
}
}

View File

@@ -1,6 +1,7 @@
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.View;
@@ -9,6 +10,7 @@ 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.service.module.ModuleType;
/**
@@ -19,6 +21,8 @@ import com.mogo.service.module.ModuleType;
public class SmallVisionProvider implements IMogoSmallMapProvider {
private final String TAG = "SmallVisionProvider";
private Intent mSmallMapServiceIntent;
@Override
public Fragment createFragment(Context context, Bundle data) {
return null;
@@ -43,12 +47,15 @@ public class SmallVisionProvider implements IMogoSmallMapProvider {
@Override
public void init(Context context) {
Log.d(TAG, "小地图模块初始化……");
mSmallMapServiceIntent = new Intent(context, SmallMapService.class);
context.startService(mSmallMapServiceIntent);
}
@Override
public void onDestroy() {
Log.d(TAG, "小地图模块销毁……");
if (mSmallMapServiceIntent != null) {
AbsMogoApplication.getApp().stopService(mSmallMapServiceIntent);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.module.common.view.RoundLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/module_small_map_view_border"
android:gravity="center"
app:roundLayoutRadius="360dp">
<com.mogo.module.small.map.SmallMapView
android:id="@+id/tv"
android:layout_width="@dimen/module_mvision_view_width"
android:layout_height="@dimen/module_mvision_view_height"
android:gravity="center"/>
</com.mogo.module.common.view.RoundLayout>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_mvision_view_width">400px</dimen>
<dimen name="module_mvision_view_height">400px</dimen>
<dimen name="module_mvision_view_x">1490px</dimen>
<dimen name="module_mvision_view_y">650px</dimen>
<dimen name="module_mvision_big_view_x">0px</dimen>
<dimen name="module_mvision_big_view_y">0px</dimen>
<dimen name="module_mvision_big_view_width">1920px</dimen>
<dimen name="module_mvision_big_view_height">1080px</dimen>
</resources>

View File

@@ -26,6 +26,9 @@ import com.mogo.module.v2x.voice.V2XVoiceManager;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
@@ -129,7 +132,11 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder<V2XEventShowEntity> {
mExploreWay.getPoiType(),
2);
}
delayedCloseWindow();
if (!V2XServiceManager.getMoGoStatusManager().isVrMode()) {
delayedCloseWindow();
} else {
mIlIllegalParkingLike.setClickable(false);
}
}
/**
@@ -142,6 +149,10 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder<V2XEventShowEntity> {
mExploreWay.getPoiType(),
3);
}
delayedCloseWindow();
if (!V2XServiceManager.getMoGoStatusManager().isVrMode()) {
delayedCloseWindow();
} else {
mIIllegalParkingUnLike.setClickable(false);
}
}
}

View File

@@ -26,7 +26,9 @@ class OptimalSpeedMarker implements IV2XMarker<MogoLatLng> {
.latitude(entity.getLat())
.longitude(entity.getLon()).anchor(0.5f,0.9f).icon(ViewUtils.fromView(new OptimalSpeedMarkerView(V2XServiceManager.getContext())));
optimalMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_OPTIMAL_SPEED_MARKER, optionsRipple);
optimalMarker.setClickable(false);
if (optimalMarker != null) {
optimalMarker.setClickable(false);
}
}
@Override

View File

@@ -3,6 +3,7 @@ package com.mogo.module.v2x.scenario.scene.test;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
@@ -257,6 +258,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
});
mBtnTriggerParkEvent.setOnClickListener(v -> {
Log.d("触发违章停车事件", "00");
V2XMessageEntity<List<MarkerExploreWay>> v2XMessageEntity =
TestOnLineCarUtils.getV2XIllegalParkData();

View File

@@ -5,7 +5,10 @@ import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -26,6 +29,7 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi
private AnimatorSet mAnimatorSet;
private OnClickCallListener mOnClickCallListener;
private boolean isAnimator = false;
private ImageView animationImageView;
public HeartUnLikeView(Context context) {
this(context, null);
@@ -39,7 +43,7 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi
super(context, attrs, defStyleAttr);
inflate(context, V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.layout.view_heart_unlike_vr : R.layout.view_heart_unlike, this);
mIllegalParkingUnLike = findViewById(R.id.ivIllegalParkingUnLike);
animationImageView = findViewById(R.id.animationImage);
setOnClickListener(v -> {
if (!isAnimator) {
isAnimator = true;
@@ -53,6 +57,12 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi
}
mAnimatorSet.start();
}
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
animationImageView.setVisibility(View.VISIBLE);
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.v2x_unlike_heart_scale_ani_vr);
animationImageView.startAnimation(animation);
animationImageView.setVisibility(View.GONE);
}
});
}

View File

@@ -0,0 +1,16 @@
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="2000">
<scale
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="0"
android:toXScale="4"
android:toYScale="4"></scale>
<alpha
android:fromAlpha="1.4"
android:repeatCount="0"
android:toAlpha="0.0"></alpha>
</set>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -6,16 +6,17 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:background="@drawable/v2x_bg_pop_up"
android:layout_marginTop="@dimen/dp_8"
android:paddingEnd="@dimen/dp_62">
<ImageView
android:id="@+id/leftImageView"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
android:id="@+id/leftImageView"
android:src="@drawable/bg_v2x_red_two_round_vr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/bg_v2x_red_two_round_vr"/>
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/ivIconP"
@@ -23,9 +24,9 @@
android:layout_height="@dimen/module_v2x_event_icon_size_vr"
android:src="@drawable/icon_illegal_parking"
app:layout_constraintBottom_toBottomOf="@+id/leftImageView"
app:layout_constraintEnd_toEndOf="@+id/leftImageView"
app:layout_constraintStart_toStartOf="@+id/leftImageView"
app:layout_constraintTop_toTopOf="@+id/leftImageView"
app:layout_constraintEnd_toEndOf="@+id/leftImageView"/>
app:layout_constraintTop_toTopOf="@+id/leftImageView" />
<TextView
android:id="@+id/tagEventType"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llIllegalParkingUnLike"
android:layout_width="@dimen/module_v2x_event_button_size"
android:layout_height="@dimen/module_v2x_event_button_size"
@@ -10,5 +10,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/module_common_unlike_vr" />
</LinearLayout>
<ImageView
android:id="@+id/animationImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/ivIllegalParkingUnpaLike"
android:layout_alignTop="@+id/ivIllegalParkingUnLike"
android:layout_alignEnd="@+id/ivIllegalParkingUnLike"
android:layout_alignBottom="@+id/ivIllegalParkingUnLike"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="9dp"
android:layout_marginBottom="10dp"
android:visibility="invisible"
android:src="@drawable/v2x_icon_unlike_animation_vr" />
</RelativeLayout>

View File

@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvRoadEventList"