diff --git a/.idea/misc.xml b/.idea/misc.xml index e082ea7475..733acb1920 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,10 +1,14 @@ + + + + - + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 64f79ab72b..0dc3d23dba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -486,6 +486,7 @@ dependencies { implementation rootProject.ext.dependencies.moduleextensions implementation rootProject.ext.dependencies.modulemap implementation rootProject.ext.dependencies.moduleSmallMap + implementation rootProject.ext.dependencies.httpdnsnoop } else { implementation project(':foudations:mogo-commons') implementation project(':foudations:mogo-base-websocket-sdk') @@ -503,6 +504,7 @@ dependencies { implementation project(':modules:mogo-module-extensions') implementation project(':modules:mogo-module-map') implementation project(':modules:mogo-module-smp') + implementation project(':foudations:httpdns-noop') } apply from: "./functions/basedmap.gradle" @@ -515,7 +517,7 @@ dependencies { apply from: "./functions/crashreport.gradle" apply from: "./functions/widgets.gradle" apply from: "./functions/tts.gradle" - apply from: "./functions/httpdns.gradle" +// apply from: "./functions/httpdns.gradle" apply from: "./functions/backwidget.gradle" apply from: "./functions/mediaui.gradle" apply from: "./functions/bizguide.gradle" diff --git a/app/functions/httpdns.gradle b/app/functions/httpdns.gradle index 176938bc92..0da084c406 100644 --- a/app/functions/httpdns.gradle +++ b/app/functions/httpdns.gradle @@ -8,10 +8,10 @@ project.dependencies { d8xxImplementation rootProject.ext.dependencies.httpdnsnoop d80xImplementation rootProject.ext.dependencies.httpdnsnoop em4Implementation rootProject.ext.dependencies.httpdnsnoop - e8xxImplementation rootProject.ext.dependencies.httpdnstencent - f8xxImplementation rootProject.ext.dependencies.httpdnstencent - f80xImplementation rootProject.ext.dependencies.httpdnstencent - f8AmapImplementation rootProject.ext.dependencies.httpdnstencent + e8xxImplementation rootProject.ext.dependencies.httpdnsnoop + f8xxImplementation rootProject.ext.dependencies.httpdnsnoop + f80xImplementation rootProject.ext.dependencies.httpdnsnoop + f8AmapImplementation rootProject.ext.dependencies.httpdnsnoop em3Implementation rootProject.ext.dependencies.httpdnsnoop } else { bydautoImplementation project(':foudations:httpdns-noop') @@ -20,10 +20,10 @@ project.dependencies { d8xxImplementation project(':foudations:httpdns-noop') d80xImplementation project(':foudations:httpdns-noop') em4Implementation project(':foudations:httpdns-noop') - e8xxImplementation project(':foudations:httpdns-tencent') - f8xxImplementation project(':foudations:httpdns-tencent') - f80xImplementation project(':foudations:httpdns-tencent') - f8AmapImplementation project(':foudations:httpdns-tencent') + e8xxImplementation project(':foudations:httpdns-noop') + f8xxImplementation project(':foudations:httpdns-noop') + f80xImplementation project(':foudations:httpdns-noop') + f8AmapImplementation project(':foudations:httpdns-noop') em3Implementation project(':foudations:httpdns-noop') } } \ No newline at end of file diff --git a/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java b/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java index fdf50007aa..5cd0e7df49 100644 --- a/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java +++ b/foudations/httpdns-noop/src/main/java/com/mogo/httpdns/noop/HttpDnsNoop.java @@ -26,13 +26,13 @@ class HttpDnsNoop implements IMogoHttpDns { @Override public String getCachedHttpDnsIps( String host,int type ) { - return null; + return host; } @Override public void getHttpDnsIp( String host,int type, boolean useCache, IHttpDnsCallback callback ) { if ( callback != null ) { - callback.onParsed( null ); + callback.onParsed( host ); } } diff --git a/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java b/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java index f0e5ec13b7..df1706b0c5 100644 --- a/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java +++ b/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketConstant.java @@ -8,11 +8,11 @@ import com.mogo.commons.debug.DebugConfig; @Keep public class WebSocketConstant { - private static final String HOST_DEV = "ws://62.234.196.121"; - private static final String HOST_QA = "ws://62.234.196.121"; - private static final String HOST_DEMO = "ws://62.234.196.121"; + private static final String HOST_DEV = "ws://119.45.249.167"; + private static final String HOST_QA = "ws://119.45.249.167"; + private static final String HOST_DEMO = "ws://119.45.249.167"; @Keep - private static final String HOST_RELEASE = "ws://62.234.196.121"; + private static final String HOST_RELEASE = "ws://119.45.249.167"; // private static final String PORT = ":14001/ws"; @Keep public static final String PATH = "/ws"; diff --git a/foudations/mogo-utils/src/main/java/com/mogo/utils/ViewUtils.java b/foudations/mogo-utils/src/main/java/com/mogo/utils/ViewUtils.java index dfd92bd7e1..195de14f7c 100644 --- a/foudations/mogo-utils/src/main/java/com/mogo/utils/ViewUtils.java +++ b/foudations/mogo-utils/src/main/java/com/mogo/utils/ViewUtils.java @@ -20,11 +20,12 @@ public class ViewUtils { view.destroyDrawingCache(); view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)); view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); - Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas( bitmap ); - view.draw( canvas ); - return bitmap; -// return (bitmap = view.getDrawingCache()) != null ? bitmap.copy(Bitmap.Config.ARGB_8888, false) : null; +// Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); +// Canvas canvas = new Canvas( bitmap ); +// view.draw( canvas ); +// return bitmap; + Bitmap bitmap = null; + return (bitmap = view.getDrawingCache()) != null ? bitmap.copy(Bitmap.Config.ARGB_8888, false) : null; } public static void processChildView(View view) { diff --git a/gradle.properties b/gradle.properties index 29181c377e..27d1d9dc3c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -139,7 +139,7 @@ HTTPDNS_NOOP_VERSION = 2.0.12 ######## 外部依赖引用 # 车聊聊 -CARCHATTING_VERSION=2.2.42 +CARCHATTING_VERSION=2.2.50 # 车聊聊接口 CARCHATTINGPROVIDER_VERSION=1.1.8 # websocket diff --git a/libraries/map-custom/build.gradle b/libraries/map-custom/build.gradle index b4e3a6729c..b7408bfcc7 100644 --- a/libraries/map-custom/build.gradle +++ b/libraries/map-custom/build.gradle @@ -67,7 +67,7 @@ dependencies { implementation project(':foudations:mogo-commons') } - implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.5.3' + implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.5.7' // implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.5-log-1' } diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 09633693d8..5ec595594c 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -85,6 +85,8 @@ public class AMapViewWrapper implements IMogoMapView, private Location mLastDriveLocationShadow = null; private EnumMapUI mCurrentUI; + private boolean mIsLightStyle = false; + private boolean mMapLoaded = false; public AMapViewWrapper( MapAutoView mMapView ) { startTime = System.currentTimeMillis(); @@ -327,10 +329,12 @@ public class AMapViewWrapper implements IMogoMapView, case Type_Light: mMapView.getMapAutoViewHelper().setAutoSwitchStyle( false ); mMapView.getMapAutoViewHelper().setMapStyle( MapAutoApi.MAP_STYLE_DAY ); + mIsLightStyle = true; break; case Type_Night: mMapView.getMapAutoViewHelper().setAutoSwitchStyle( false ); mMapView.getMapAutoViewHelper().setMapStyle( MapAutoApi.MAP_STYLE_NIGHT ); + mIsLightStyle = false; break; case Type_AUTO_LIGHT_Night: mMapView.getMapAutoViewHelper().setAutoSwitchStyle( true ); @@ -342,7 +346,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void moveToCenter( MogoLatLng latLng ) { - + moveToCenter( latLng, true ); } private void setUIMode( EnumMapUI ui ) { @@ -573,6 +577,10 @@ public class AMapViewWrapper implements IMogoMapView, if ( !checkAMapView() ) { return; } + if ( mCurrentUI == EnumMapUI.Type_VR ) { + Logger.w( TAG, "vr 模式下忽略该设置" ); + return; + } Logger.i( TAG, "showBounds:%s -%s-%s- %b ", tag, carPosition.toString(), bound.toShortString(), lockCarPosition ); try { if ( DebugConfig.isDebug() ) { @@ -691,7 +699,12 @@ public class AMapViewWrapper implements IMogoMapView, } NaviClient.getInstance( getContext() ).syncCarLocation( sysLocation ); - MapStyleController.getInstance().onLocationChanged( location, this ); + if ( checkAMapView() && mMapLoaded ) { + // 避免设置之后被其他初始化给重置为其他模式 + UiThreadHandler.postDelayed( () -> { + MapStyleController.getInstance().onLocationChanged( location, this ); + }, 5_000L ); + } } @Override @@ -706,6 +719,7 @@ public class AMapViewWrapper implements IMogoMapView, public void onMapLoaded() { Logger.i( TAG, "autoop--onMapLoaded: " ); MogoMapListenerHandler.getInstance().onMapLoaded(); + mMapLoaded = true; CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition(); if ( cameraPosition != null ) { Trace.beginSection( "timer.onCameraChangeFinish" ); @@ -715,9 +729,6 @@ public class AMapViewWrapper implements IMogoMapView, cameraPosition.getBearing() ); Trace.endSection(); } - - getMap().getUIController().setAnchorRate( 0.01f ); - getMap().getUIController().setAnchorScale( 1.2f, 2.7f ); } @Override @@ -776,6 +787,9 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void onChangeMapStyle( int i ) { + + EnumMapUI last = mCurrentUI; + if ( i == MapAutoApi.MAP_STYLE_DAY || i == MapAutoApi.MAP_STYLE_DAY_NAV ) { mCurrentUI = EnumMapUI.Type_Light; @@ -789,6 +803,14 @@ public class AMapViewWrapper implements IMogoMapView, } else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) { mCurrentUI = EnumMapUI.CarUp_3D; } + + // vr 模式切换到普通模式下,保持之前的白天模式 wtf. + if ( last == EnumMapUI.Type_VR && mCurrentUI != last ) { + if ( mIsLightStyle ) { + changeMapMode( EnumMapUI.Type_Light ); + return; + } + } if ( mCurrentUI != null ) { UiThreadHandler.post( () -> { try { @@ -817,7 +839,11 @@ public class AMapViewWrapper implements IMogoMapView, } else { if ( mCurrentUI == EnumMapUI.Type_VR ) { changeZoom( 16 ); - changeMapMode( EnumMapUI.Type_Night ); + if ( mIsLightStyle ) { + changeMapMode( EnumMapUI.Type_Light ); + } else { + changeMapMode( EnumMapUI.Type_Night ); + } Logger.d( TAG, "自动切换为2D模式" ); } } diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java index 2dd9320480..5660221fb5 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/CustomMapApiBuilder.java @@ -3,6 +3,7 @@ package com.mogo.map.impl.custom; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.debug.DebugConfig; import com.mogo.map.CoordinatesTransformer; import com.mogo.map.IMogoMapApiBuilder; import com.mogo.map.IMogoMapView; @@ -92,14 +93,20 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder { @Override public IMogoMapView getMapView( Context context ) { NavAutoApi.INSTANCE.init( context, MapParams.Companion.init() - .setDebugMode( true ) + .setDebugMode( DebugConfig.isDebug() ) .setCoordinateType( MapParams.COORDINATETYPE_GCJ02 ) .setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D ) .setZoom( 16 ) .setPointToCenter( 0.734375f, 0.5f ) .setStyleMode( MapParams.MAP_STYLE_NIGHT ), NavParams.Companion.init() ); - MapAutoView mapAutoView = new MapAutoView( context ); - IMogoMapView mapView = new AMapViewWrapper( mapAutoView ); + MapAutoView mapAutoView = new MapAutoView(context); + Logger.w(TAG, "mapAutoView==" + mapAutoView); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + IMogoMapView mapView = new AMapViewWrapper(mapAutoView); return mapView; } diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/HttpConstants.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/HttpConstants.kt index 9778b0b1c2..dd539098ab 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/HttpConstants.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/HttpConstants.kt @@ -7,7 +7,7 @@ class HttpConstants { companion object { const val DEV_BASE_URL_OWNER = "http://dzt-test.zhidaozhixing.com/" - const val RELEASE_BASE_URL_OWNER = "http://dzt.zhidaohulian.com/" + const val RELEASE_BASE_URL_OWNER = "http://dzt.zhidaozhixing.com/" const val SHOW_BASE_URL_OWNER = "http://dzt-show.zhidaozhixing.com/" fun getBaseUrl(): String { diff --git a/main-extensions/mogo-module-main-launcher/src/main/java/com/zhidao/mogo/module/main/launcher/MainLauncherActivity.java b/main-extensions/mogo-module-main-launcher/src/main/java/com/zhidao/mogo/module/main/launcher/MainLauncherActivity.java index 5582493834..1c73531d6c 100644 --- a/main-extensions/mogo-module-main-launcher/src/main/java/com/zhidao/mogo/module/main/launcher/MainLauncherActivity.java +++ b/main-extensions/mogo-module-main-launcher/src/main/java/com/zhidao/mogo/module/main/launcher/MainLauncherActivity.java @@ -131,7 +131,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis mLeftShadowFrame.setVisibility(View.GONE); mApps.setVisibility(View.GONE); }else{ - entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft_out_vr_mode ); + entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_id_entrance_fragment_container_marginLeft ); mLeftShadowFrame.setVisibility(View.VISIBLE); mApps.setVisibility(View.VISIBLE); } diff --git a/main-extensions/mogo-module-main-launcher/src/main/res/values-ldpi/dimens.xml b/main-extensions/mogo-module-main-launcher/src/main/res/values-ldpi/dimens.xml new file mode 100644 index 0000000000..4b84e40d04 --- /dev/null +++ b/main-extensions/mogo-module-main-launcher/src/main/res/values-ldpi/dimens.xml @@ -0,0 +1,5 @@ + + + 0px + 444px + \ No newline at end of file diff --git a/main-extensions/mogo-module-main-launcher/src/main/res/values-mdpi/dimens.xml b/main-extensions/mogo-module-main-launcher/src/main/res/values-mdpi/dimens.xml new file mode 100644 index 0000000000..4b84e40d04 --- /dev/null +++ b/main-extensions/mogo-module-main-launcher/src/main/res/values-mdpi/dimens.xml @@ -0,0 +1,5 @@ + + + 0px + 444px + \ No newline at end of file diff --git a/main-extensions/mogo-module-main-launcher/src/main/res/values-xhdpi/dimens.xml b/main-extensions/mogo-module-main-launcher/src/main/res/values-xhdpi/dimens.xml new file mode 100644 index 0000000000..25247f638b --- /dev/null +++ b/main-extensions/mogo-module-main-launcher/src/main/res/values-xhdpi/dimens.xml @@ -0,0 +1,5 @@ + + + 0px + 800px + \ No newline at end of file diff --git a/modules/mogo-module-common/build.gradle b/modules/mogo-module-common/build.gradle index 99e827b866..e6efc88b0b 100644 --- a/modules/mogo-module-common/build.gradle +++ b/modules/mogo-module-common/build.gradle @@ -12,7 +12,6 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } - buildTypes { release { minifyEnabled false @@ -34,6 +33,7 @@ dependencies { implementation rootProject.ext.dependencies.androidxconstraintlayout implementation rootProject.ext.dependencies.arouter implementation rootProject.ext.dependencies.callchatprovider + api "com.mogo.libs:hook:1.0" if (Boolean.valueOf(RELEASE)) { api rootProject.ext.dependencies.mogomap api rootProject.ext.dependencies.mogomapapi diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierAnimationView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierAnimationView.java index 2bed0dae80..2e3b93492d 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierAnimationView.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/animation/BezierAnimationView.java @@ -73,11 +73,27 @@ public class BezierAnimationView extends RelativeLayout implements View.OnClickL runnable.run(); } + public void bezierAnimationStart(){ + runnable = new Runnable() { + @Override + public void run() { + try { + Log.d("点赞--", ""); + bezierAnimation(resource); + handler.postDelayed(this, 500); + } catch (Exception e) { + e.printStackTrace(); + } + } + }; + runnable.run(); + } + private void bezierAnimation(int resource) { final ImageView imageView = new ImageView(context); imageView.setBackgroundResource(animation_drawable[resource]); RelativeLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - params.addRule(ALIGN_BOTTOM); +// params.addRule(ALIGN_BOTTOM); params.addRule(CENTER_HORIZONTAL); imageView.setLayoutParams(params); addView(imageView); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java index 8a130a1f59..7ec3052510 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerAdapter.java @@ -50,10 +50,10 @@ public class MapMarkerAdapter { * @return MarkerView */ public static IMarkerView getMarkerInfoWindowView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) { - if ( markerShowEntity.isChecked() ) { - return new MapMarkerInfoView( context, markerShowEntity, options ); - } else { - return new MapMarkerView( context, markerShowEntity, options ); - } +// if ( markerShowEntity.isChecked() ) { +// return new MapMarkerInfoView( context, markerShowEntity, options ); +// } else { +// } + return new MapMarkerView( context, markerShowEntity, options ); } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java index 2bacde6a7e..627b15f3a9 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerInfoView.java @@ -52,7 +52,11 @@ public class MapMarkerInfoView extends MapMarkerBaseView { public MapMarkerInfoView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) { super( context ); mOptions = options; - updateView( markerShowEntity ); + try { + updateView( markerShowEntity ); + } catch ( Exception e ) { + e.printStackTrace(); + } } @Override @@ -60,7 +64,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView { LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout_info, this ); ivUserHead = findViewById( R.id.ivUserHead ); // ivIcon = findViewById( R.id.ivIcon ); - ivIcon = findViewById(R.id.ivIcon); + ivIcon = findViewById( R.id.ivIcon ); clMarkerContent = findViewById( R.id.clMarkerContent ); ivReverseTriangle = findViewById( R.id.ivReverseTriangle ); ivCar = findViewById( R.id.ivCar ); @@ -69,84 +73,80 @@ public class MapMarkerInfoView extends MapMarkerBaseView { @Override public void updateView( MarkerShowEntity markerShowEntity ) { - try { - Object bindObj = markerShowEntity.getBindObj(); + Object bindObj = markerShowEntity.getBindObj(); - if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { - ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow_vr ); - } else { - ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow ); - } - clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info ); - ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow ); - switch ( markerShowEntity.getMarkerType() ) { - case ModuleNames.CARD_TYPE_CARS_CHATTING: - case ModuleNames.CARD_TYPE_USER_DATA: - ivUserHead.setVisibility( View.VISIBLE ); - ivIcon.setVisibility( View.INVISIBLE ); - loadImageWithMarker( markerShowEntity ); - ivCar.setImageResource( R.drawable.icon_map_marker_car_gray ); - //ivCar.setRotation(new Random().nextInt(360)); - ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() ); - break; - case ModuleNames.CARD_TYPE_ROAD_CONDITION: - case ModuleNames.CARD_TYPE_NOVELTY: - ivUserHead.setVisibility( View.INVISIBLE ); - ivIcon.setVisibility( View.VISIBLE ); - - if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) { - // 根据poiType获取对应的图片 - String poiType = ((MarkerExploreWay) bindObj).getPoiType(); - PoiWrapper poiWrapper = - CloudPoiManager.getInstance().getWrapperByPoiType(poiType); - if (poiWrapper != null) { - // 加载图片 - loadPoiTypeIcon(poiWrapper.getIconInfoUrl(),poiWrapper.getIconInfoRes()); - }else{ - Logger.e(TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType); - } - } - break; - case ModuleNames.CARD_TYPE_SHARE_MUSIC: - ivUserHead.setVisibility( View.INVISIBLE ); - ivIcon.setVisibility( View.VISIBLE ); - - if ( bindObj instanceof MarkerShareMusic ) { - // 2 为书籍听书,3 为新闻,1 为qq音乐,int - switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) { - case 1: - ivIcon.setImageResource( R.drawable.icon_map_marker_misic ); - break; - case 2: - ivIcon.setImageResource( R.drawable.icon_map_marker_book ); - break; - case 3: - ivIcon.setImageResource( R.drawable.icon_map_marker_news ); - break; - default: - ivIcon.setImageResource( R.drawable.icon_map_marker_misic ); - break; - } - } - - break; - default: - break; - } - if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) { - String content; - if ( markerShowEntity.getTextContent().length() > 8 ) { - content = markerShowEntity.getTextContent().substring( 0, 7 ) + "..."; - } else { - content = markerShowEntity.getTextContent(); - } - tvMarkerContent.setText( content ); - } - - } catch ( Exception e ) { - e.printStackTrace(); + if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { + ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow_vr ); + } else { + ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow ); } + clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info ); + ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow ); + switch ( markerShowEntity.getMarkerType() ) { + case ModuleNames.CARD_TYPE_CARS_CHATTING: + case ModuleNames.CARD_TYPE_USER_DATA: + ivUserHead.setVisibility( View.VISIBLE ); + ivIcon.setVisibility( View.INVISIBLE ); + loadImageWithMarker( markerShowEntity ); + ivCar.setImageResource( R.drawable.icon_map_marker_car_gray ); + //ivCar.setRotation(new Random().nextInt(360)); + ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() ); + break; + case ModuleNames.CARD_TYPE_ROAD_CONDITION: + case ModuleNames.CARD_TYPE_NOVELTY: + ivUserHead.setVisibility( View.INVISIBLE ); + ivIcon.setVisibility( View.VISIBLE ); + + if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) { + // 根据poiType获取对应的图片 + String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType(); + PoiWrapper poiWrapper = + CloudPoiManager.getInstance().getWrapperByPoiType( poiType ); + if ( poiWrapper != null ) { + // 加载图片 + loadPoiTypeIcon( poiWrapper.getIconInfoUrl(), poiWrapper.getIconInfoRes() ); + } else { + Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType ); + } + } + break; + case ModuleNames.CARD_TYPE_SHARE_MUSIC: + ivUserHead.setVisibility( View.INVISIBLE ); + ivIcon.setVisibility( View.VISIBLE ); + + if ( bindObj instanceof MarkerShareMusic ) { + // 2 为书籍听书,3 为新闻,1 为qq音乐,int + switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) { + case 1: + ivIcon.setImageResource( R.drawable.icon_map_marker_misic ); + break; + case 2: + ivIcon.setImageResource( R.drawable.icon_map_marker_book ); + break; + case 3: + ivIcon.setImageResource( R.drawable.icon_map_marker_news ); + break; + default: + ivIcon.setImageResource( R.drawable.icon_map_marker_misic ); + break; + } + } + + break; + default: + break; + } + if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) { + String content; + if ( markerShowEntity.getTextContent().length() > 8 ) { + content = markerShowEntity.getTextContent().substring( 0, 7 ) + "..."; + } else { + content = markerShowEntity.getTextContent(); + } + tvMarkerContent.setText( content ); + } + } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java index 694414bf7b..9201252762 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/MapMarkerView.java @@ -24,11 +24,11 @@ import com.mogo.utils.logger.Logger; * desc : 地图Marker图标 * version: 1.0 */ -public class -MapMarkerView extends MapMarkerBaseView { +public class MapMarkerView extends MapMarkerBaseView { private String TAG = "MapMarkerView"; private FrameLayout clMarkerTopView; + private MarkerShowEntity mMarkerShowEntity; public MapMarkerView( Context context ) { super( context ); @@ -45,7 +45,12 @@ MapMarkerView extends MapMarkerBaseView { public MapMarkerView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) { super( context ); mOptions = options; - updateView( markerShowEntity ); + mMarkerShowEntity = markerShowEntity; + try { + updateView( markerShowEntity ); + } catch ( Exception e ) { + e.printStackTrace(); + } } @Override @@ -55,37 +60,35 @@ MapMarkerView extends MapMarkerBaseView { } else { LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout, this ); } - ivIcon = findViewById( R.id.ivIcon ); clMarkerTopView = findViewById( R.id.clMarkerTopView ); + ivIcon = findViewById( R.id.ivIcon ); ivCar = findViewById( R.id.ivCar ); } @Override public void updateView( MarkerShowEntity markerShowEntity ) { - try { - Object bindObj = markerShowEntity.getBindObj(); - switch ( markerShowEntity.getMarkerType() ) { - case ModuleNames.CARD_TYPE_ROAD_CONDITION: - case ModuleNames.CARD_TYPE_NOVELTY: - if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) { - // 根据poiType获取对应的图片 - String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType(); - PoiWrapper poiWrapper = - CloudPoiManager.getInstance().getWrapperByPoiType( poiType ); - if ( poiWrapper != null ) { - // 加载图片 - loadPoiTypeIcon( poiWrapper.getIconUrl(), poiWrapper.getIconRes() ); - } else { - Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染marker====" + poiType ); - } + Object bindObj = markerShowEntity.getBindObj(); + switch ( markerShowEntity.getMarkerType() ) { + case ModuleNames.CARD_TYPE_ROAD_CONDITION: + case ModuleNames.CARD_TYPE_NOVELTY: + if ( mMarkerShowEntity != null && mMarkerShowEntity.isChecked() ) { + clMarkerTopView.setBackgroundResource( R.drawable.module_services_marker_vr_bkg_checked ); + } + if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) { + // 根据poiType获取对应的图片 + String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType(); + PoiWrapper poiWrapper = + CloudPoiManager.getInstance().getWrapperByPoiType( poiType ); + if ( poiWrapper != null ) { + // 加载图片 + loadPoiTypeIcon( poiWrapper.getIconUrl(), poiWrapper.getIconRes() ); + } else { + Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染marker====" + poiType ); } - break; - default: - break; - } - - } catch ( Exception e ) { - e.printStackTrace(); + } + break; + default: + break; } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java index 4b6d621d60..636e4ea87a 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java @@ -35,6 +35,9 @@ public class V2XEventShowEntity implements Serializable { // 违章停车 private MarkerExploreWay v2XIllegalPark; + // 基于目的地道路推荐详情 + private V2XRecommendRouteEntity v2XRecommendRouteEntity; + public int getViewType() { return viewType; } @@ -83,6 +86,14 @@ public class V2XEventShowEntity implements Serializable { this.v2XIllegalPark = v2XIllegalPark; } + public V2XRecommendRouteEntity getV2XRecommendRouteEntity() { + return v2XRecommendRouteEntity; + } + + public void setV2XRecommendRouteEntity(V2XRecommendRouteEntity v2XRecommendRouteEntity) { + this.v2XRecommendRouteEntity = v2XRecommendRouteEntity; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -97,14 +108,15 @@ public class V2XEventShowEntity implements Serializable { Objects.equals(v2XLiveCarInfoRes, that.v2XLiveCarInfoRes) && Objects.equals(v2XLiveCarList, that.v2XLiveCarList) && Objects.equals(v2XPushMessageEntity, that.v2XPushMessageEntity) && - Objects.equals(v2XIllegalPark, that.v2XIllegalPark); + Objects.equals(v2XIllegalPark, that.v2XIllegalPark) && + Objects.equals(v2XRecommendRouteEntity, that.v2XRecommendRouteEntity); } @Override public int hashCode() { return Objects.hash(viewType, v2XRoadEventEntity, v2XLiveCarInfoRes, v2XLiveCarList, - v2XPushMessageEntity, v2XIllegalPark); + v2XPushMessageEntity, v2XIllegalPark, v2XRecommendRouteEntity); } @@ -119,6 +131,7 @@ public class V2XEventShowEntity implements Serializable { V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_LIVE_CAR_WARNING, V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING, V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP, + V2XMessageEntity.V2XTypeEnum.ALERT_RECOMMEND_ROUTE, }) @Target({ ElementType.PARAMETER, diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java index 8019c7547b..fce034aab3 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java @@ -141,8 +141,10 @@ public class V2XMessageEntity implements Serializable { int ALERT_EVENT_UGC_WARNING = 1_009; // 呼叫、请求直播事件 int ALERT_VOICE_CALL_FOR_LIVECAR_SHOW = 1_010; - // 基于目的地预判的道路事件 - int ALERT_PREJECTED_ROAD_WARNING = 1_011; + // 基于预判目的地道路事件的路线推荐 + int ALERT_RECOMMEND_ROUTE = 1_011; + // 基于预判目的地违章高发停车场推荐 + int ALERT_RECOMMEND_PARKING = 1_012; // 推送VR消息展示 int ALERT_PUSH_VR_SHOW = 2_000; // 自车求助 @@ -164,7 +166,8 @@ public class V2XMessageEntity implements Serializable { V2XTypeEnum.ALERT_EVENT_UGC_WARNING, V2XTypeEnum.ALERT_CAR_FOR_HELP, V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW, - V2XTypeEnum.ALERT_PREJECTED_ROAD_WARNING, + V2XTypeEnum.ALERT_RECOMMEND_ROUTE, + V2XTypeEnum.ALERT_RECOMMEND_PARKING, V2XTypeEnum.ALERT_PUSH_VR_SHOW, V2XTypeEnum.ALERT_OBU_EVENT, }) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPrejectedRoadEventEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPrejectedRoadEventEntity.java deleted file mode 100644 index 68733947a3..0000000000 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPrejectedRoadEventEntity.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.mogo.module.common.entity; - -/** - * created by wujifei on 2020/12/24 15:33 - * describe:基于目的地预判的道路事件 - */ -public class V2XPrejectedRoadEventEntity { - -} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRecommendRouteEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRecommendRouteEntity.java new file mode 100644 index 0000000000..1ba43ddd4c --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRecommendRouteEntity.java @@ -0,0 +1,39 @@ +package com.mogo.module.common.entity; + +import java.util.List; + +/** + * created by wujifei on 2020/12/31 18:45 + * describe:基于目的地预判的道路事件 + */ +public class V2XRecommendRouteEntity { + private List toPoint; //目的地坐标 + private String formatAddress; //目的地地址 + private String tts; //播报内容 + + public V2XRecommendRouteEntity(List toPoint, String formatAddress) { + this.toPoint = toPoint; + this.formatAddress = formatAddress; + } + + public List getToPoint() { + return toPoint; + } + + public void setToPoint(List toPoint) { + this.toPoint = toPoint; + } + + public String getFormatAddress() { + return formatAddress; + } + + public void setFormatAddress(String formatAddress) { + this.formatAddress = formatAddress; + } + + public String getTts() { + tts = "主人,我发现前往" + formatAddress + "沿途有拥堵,推荐你导航最优路线,现在开启导航吗?"; + return tts; + } +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java index 7e8a557f30..4e86f84941 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/map/MapCenterPointStrategy.java @@ -270,6 +270,10 @@ public class MapCenterPointStrategy { if ( controller == null ) { return; } + if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { + Logger.w( TAG, "vr 模式下忽略该设置" ); + return; + } Logger.e( TAG, "scene"+scene ); Map< Integer, Map< String, MapCenterPoint > > strategies = sCommonStrategies; if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { diff --git a/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png new file mode 100644 index 0000000000..b82a2b5226 Binary files /dev/null and b/modules/mogo-module-common/src/main/res/drawable-xhdpi/module_services_marker_vr_bkg_checked.png differ diff --git a/modules/mogo-module-common/src/main/res/layout/module_common_bezier_layout.xml b/modules/mogo-module-common/src/main/res/layout/module_common_bezier_layout.xml new file mode 100644 index 0000000000..f5838417a5 --- /dev/null +++ b/modules/mogo-module-common/src/main/res/layout/module_common_bezier_layout.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-media/src/main/res/drawable/module_media_circle_bg.xml b/modules/mogo-module-media/src/main/res/drawable/module_media_circle_bg.xml new file mode 100644 index 0000000000..4f0286a260 --- /dev/null +++ b/modules/mogo-module-media/src/main/res/drawable/module_media_circle_bg.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/modules/mogo-module-media/src/main/res/layout/module_media_music_window_alert_layout_new.xml b/modules/mogo-module-media/src/main/res/layout/module_media_music_window_alert_layout_new.xml index 2469ea2ba7..9002881140 100644 --- a/modules/mogo-module-media/src/main/res/layout/module_media_music_window_alert_layout_new.xml +++ b/modules/mogo-module-media/src/main/res/layout/module_media_music_window_alert_layout_new.xml @@ -7,45 +7,59 @@ - + app:layout_constraintTop_toTopOf="parent" /> + - - - - - - - - + + + + + + + + - + app:layout_constraintTop_toTopOf="parent"> + + + + + diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java index bcfe822ff2..dcb08560b4 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java @@ -927,16 +927,26 @@ public class MogoServices implements IMogoMapListener, return mLastCarLocation; } + private boolean mLastStatusIsVr = false; + @Override public void onMapModeChanged( EnumMapUI ui ) { if ( ui == EnumMapUI.Type_VR ) { - MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true ); - MapCenterPointStrategy.resetByChangeMode(); - MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); + if ( !mLastStatusIsVr ) { + MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true ); + MapCenterPointStrategy.resetByChangeMode(); + MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); + AIAssist.getInstance( mContext ).speakTTSVoice( "你已进入鹰眼模式" ); + mLastStatusIsVr = true; + } } else { - MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false ); - MapCenterPointStrategy.resetByChangeMode(); - MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); + if ( mLastStatusIsVr ) { + mLastStatusIsVr = false; + MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false ); + MapCenterPointStrategy.resetByChangeMode(); + MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); + AIAssist.getInstance( mContext ).speakTTSVoice( "你已离开鹰眼模式" ); + } } } } diff --git a/modules/mogo-module-smp/src/main/AndroidManifest.xml b/modules/mogo-module-smp/src/main/AndroidManifest.xml index 32b078729c..33c6adff88 100644 --- a/modules/mogo-module-smp/src/main/AndroidManifest.xml +++ b/modules/mogo-module-smp/src/main/AndroidManifest.xml @@ -2,10 +2,10 @@ - + \ No newline at end of file diff --git a/modules/mogo-module-smp/src/main/java/com/amap/api/col/n3/le2.java b/modules/mogo-module-smp/src/main/java/com/amap/api/col/n3/le2.java new file mode 100644 index 0000000000..cd406be8a7 --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/amap/api/col/n3/le2.java @@ -0,0 +1,186 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by Fernflower decompiler) +// + +package com.amap.api.col.n3; + +import android.content.Context; +import android.content.res.Resources; +import android.content.res.Resources.Theme; +import android.util.AttributeSet; +import android.util.Log; +import android.view.ContextThemeWrapper; +import android.view.LayoutInflater; +import android.view.LayoutInflater.Factory; +import android.view.View; +import android.view.ViewStub; + +import com.android.internal.policy.MyPhoneLayoutInflater; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.HashSet; + +public final class le2 extends ContextThemeWrapper { + private Resources a = lg.a(); + private Theme b; + private LayoutInflater c; + private ClassLoader d; + private int e; + private static final String[] f = new String[]{"android.widget", "android.webkit", "android.app"}; + private le2.a g = new le2.a(); + private Factory h = new Factory() { + public final View onCreateView(String var1, Context var2, AttributeSet var3) { + return le2.this.a(var1, var2, var3); + } + }; + + public le2(Context var1, int var2, ClassLoader var3) { + super(var1, var2); + this.d = var3; + this.b = lg.b(); + this.e = var2; + super.onApplyThemeResource(this.b, this.e, true); + (new StringBuilder("classloader:")).append(this.d); + } + + public final Resources getResources() { + return this.a != null ? this.a : super.getResources(); + } + + public final void a(int var1) { + if (var1 != this.e) { + this.e = var1; + super.onApplyThemeResource(this.b, this.e, true); + } + + } + + public final Theme getTheme() { + return this.b != null ? this.b : super.getTheme(); + } + + public final Object getSystemService(String var1) { + if ("layout_inflater".equals(var1)) { + if (this.c == null) { + // 这里构建一个自己对的布局填充器 + // 与已经被修改的context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) + // 隔离从而保证高德地图SDK能正常初始化 + LayoutInflater var2 = new MyPhoneLayoutInflater(getBaseContext()); + this.c = var2.cloneInContext(this); + this.c.setFactory(this.h); + this.c = this.c.cloneInContext(this); + } + + return this.c; + } else { + return super.getSystemService(var1); + } + } + + private final View a(String var1, Context var2, AttributeSet var3) { + if (this.g.a.contains(var1)) { + return null; + } else { + Constructor var4; + if ((var4 = (Constructor) this.g.b.get(var1)) == null) { + Class var5 = null; + boolean var6 = false; + String var7 = "api.navi"; + + label71: + { + label70: + { + Throwable var10000; + label79: + { + boolean var10001; + try { + if (var1.contains(var7)) { + var5 = this.d.loadClass(var1); + } else { + String[] var17; + int var8 = (var17 = f).length; + int var9 = 0; + + while (var9 < var8) { + String var10 = var17[var9]; + + try { + var5 = this.d.loadClass(var10 + "." + var1); + break; + } catch (Throwable var13) { + ++var9; + } + } + } + + if (var5 == null) { + break label71; + } + } catch (Throwable var15) { + var10000 = var15; + var10001 = false; + break label79; + } + + if (var5 == ViewStub.class) { + break label71; + } + + try { + if (var5.getClassLoader() != this.d) { + break label71; + } + break label70; + } catch (Throwable var14) { + var10000 = var14; + var10001 = false; + } + } + + Throwable var18 = var10000; + (new StringBuilder("load view err:")).append(Log.getStackTraceString(var18)); + break label71; + } + + var6 = true; + } + + if (!var6) { + this.g.a.add(var1); + return null; + } + + try { + var4 = var5.getConstructor(Context.class, AttributeSet.class); + this.g.b.put(var1, var4); + } catch (Throwable var12) { + (new StringBuilder("create view err:")).append(Log.getStackTraceString(var12)); + } + } + + try { + View var16 = null; + if (var4 != null) { + var16 = (View) var4.newInstance(var2, var3); + } + + return var16; + } catch (Throwable var11) { + (new StringBuilder("create view err:")).append(Log.getStackTraceString(var11)); + return null; + } + } + } + + public static class a { + public HashSet a = new HashSet(); + public HashMap> b = new HashMap(); + + public a() { + } + } +} diff --git a/modules/mogo-module-smp/src/main/java/com/amap/api/col/n3/lg2.java b/modules/mogo-module-smp/src/main/java/com/amap/api/col/n3/lg2.java new file mode 100644 index 0000000000..347f98ddc6 --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/amap/api/col/n3/lg2.java @@ -0,0 +1,40 @@ +package com.amap.api.col.n3; + +import android.content.Context; +import android.content.res.XmlResourceParser; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +/** + * 这里是为了解决 使用换肤框架后,高德地图初始化有问题加入的 + * 问题原因是: + * skin 框架会替换 LayoutInflater 中的 setFactory2 从而导致高德 le 中的 setFactory 失效。 + * 解决方案为: + * 直接通过内存地址替换整个 ArtMethod,来将需要修改的高德SDK中的方法指向我们修改过后的方法。 + */ +public class lg2 extends lg { + static le2 b; + + public static View a(Context var0, int var1, ViewGroup var2) { + XmlResourceParser var9 = a().getXml(var1); + if (!a) { + return LayoutInflater.from(var0).inflate(var9, var2); + } else { + try { + if (b == null) { + b = new le2(var0, c == -1 ? 0 : c, lg.class.getClassLoader()); + } + b.a(c == -1 ? 0 : c); + View var3 = LayoutInflater.from(b).inflate(var9, var2); + return var3; + } catch (Throwable var7) { + var7.printStackTrace(); + np.c(var7, "ResourcesUtil", "selfInflate(Activity activity, int resource, ViewGroup root)"); + } finally { + var9.close(); + } + return null; + } + } +} diff --git a/modules/mogo-module-smp/src/main/java/com/android/internal/policy/MyPhoneLayoutInflater.java b/modules/mogo-module-smp/src/main/java/com/android/internal/policy/MyPhoneLayoutInflater.java new file mode 100644 index 0000000000..4a2d262764 --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/android/internal/policy/MyPhoneLayoutInflater.java @@ -0,0 +1,60 @@ +package com.android.internal.policy; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; + +/** + * @author donghongyu + * @date 12/25/20 5:12 PM + */ +public class MyPhoneLayoutInflater extends LayoutInflater { + private static final String[] sClassPrefixList = { + "android.widget.", + "android.webkit.", + "android.app." + }; + + /** + * Instead of instantiating directly, you should retrieve an instance + * through {@link Context#getSystemService} + * + * @param context The Context in which in which to find resources and other + * application-specific things. + * @see Context#getSystemService + */ + public MyPhoneLayoutInflater(Context context) { + super(context); + } + + protected MyPhoneLayoutInflater(LayoutInflater original, Context newContext) { + super(original, newContext); + } + + /** + * Override onCreateView to instantiate names that correspond to the + * widgets known to the Widget factory. If we don't find a match, + * call through to our super class. + */ + @Override + protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException { + for (String prefix : sClassPrefixList) { + try { + View view = createView(name, prefix, attrs); + if (view != null) { + return view; + } + } catch (ClassNotFoundException e) { + // In this case we want to let the base class take a crack + // at it. + } + } + + return super.onCreateView(name, attrs); + } + + public LayoutInflater cloneInContext(Context newContext) { + return new MyPhoneLayoutInflater(this, newContext); + } +} \ No newline at end of file diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java index dec53d8d38..2d945b972f 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapDirectionView.java @@ -37,6 +37,7 @@ public class SmallMapDirectionView extends RelativeLayout { private AMapNaviView mAMapNaviView; private DirectionRotateAnimation mRotateAnimation; private int lastAngle = 0; + private int zoomLevel = 17; public SmallMapDirectionView(Context context) { this(context, null); @@ -133,19 +134,19 @@ public class SmallMapDirectionView extends RelativeLayout { options.setNaviArrowVisible(false); // 通过路线是否自动置灰,仅支持驾车导航 options.setAfterRouteAutoGray(false); - options.setZoom(((int) 9)); + //options.setZoom(((int) 9)); //options.setPointToCenter(0.7D, 0.5D); // 2D模式 options.setTilt(0); // 黑夜模式 -// options.setNaviNight(true); + //options.setNaviNight(true); // 自定义地图样式 options.setCustomMapStylePath(styleFilePath); mAMapNaviView.setViewOptions(options); } //设置希望展示的地图缩放级别 - CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12); + CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); aMap.moveCamera(cameraUpdate); aMap.setOnCameraChangeListener(new AMap.OnCameraChangeListener() { @@ -175,7 +176,7 @@ public class SmallMapDirectionView extends RelativeLayout { } //设置希望展示的地图缩放级别 - CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12); + CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); aMap.moveCamera(cameraUpdate); } }); @@ -218,7 +219,7 @@ public class SmallMapDirectionView extends RelativeLayout { } //设置希望展示的地图缩放级别 - CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12); + CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel); aMap.moveCamera(cameraUpdate); } } diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java index 10fb9139b9..98e6bef0a9 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java @@ -1,22 +1,30 @@ 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.ViewGroup; +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.amap.api.col.n3.lg; +import com.amap.api.col.n3.lg2; +import com.mogo.hook.HookManager; 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; + +import java.lang.reflect.Method; /** * @author donghongyu @@ -26,9 +34,11 @@ import com.mogo.service.statusmanager.StatusDescriptor; 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; @@ -55,6 +65,15 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh Log.d(TAG, "小地图模块初始化……"); mContext = context; + try { + // 替换高德地图的方法,解决因为加入换肤框架导致地图初始化失败 + Method srcMethod = lg.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class); + Method destMethod = lg2.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class); + HookManager.get().hookMethod(srcMethod, destMethod); + } catch (Exception e) { + e.printStackTrace(); + } + MogoApisHandler.getInstance() .getApis() .getStatusManagerApi() @@ -76,22 +95,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, "小地图模块触发展示……"); - if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { - mSmallMapServiceIntent = new Intent(mContext, SmallMapService.class); - mContext.startService(mSmallMapServiceIntent); - } + addSmallMapView(); } @Override public void hidePanel() { Log.d(TAG, "小地图模块触发隐藏……"); - if (mSmallMapServiceIntent != null) { - AbsMogoApplication.getApp().stopService(mSmallMapServiceIntent); + if (mWindowManagerView != null && mWindowManagerView.isShowing()) { + mWindowManagerView.dismiss(); } } @@ -122,4 +141,33 @@ 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(); + } + } diff --git a/modules/mogo-module-v2x/build.gradle b/modules/mogo-module-v2x/build.gradle index 47ab18a430..2eaadb3a28 100644 --- a/modules/mogo-module-v2x/build.gradle +++ b/modules/mogo-module-v2x/build.gradle @@ -60,6 +60,9 @@ dependencies { implementation rootProject.ext.dependencies.androidxviewpager2 implementation rootProject.ext.dependencies.localbroadcastmanager + implementation rootProject.ext.dependencies.coroutinescore + implementation rootProject.ext.dependencies.coroutinesandroid + implementation rootProject.ext.dependencies.videoarmv7 implementation rootProject.ext.dependencies.videoarm64 implementation rootProject.ext.dependencies.videojava diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java index 621795f269..216a7b9b08 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XConst.java @@ -133,4 +133,5 @@ public class V2XConst { * 绿波车速marker */ public static final String V2X_OPTIMAL_SPEED_MARKER = "V2X_OPTIMAL_SPEED_MARKER"; + } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java index 66dd23a818..26c35201d5 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XRoadEventAdapter.java @@ -13,6 +13,7 @@ import com.mogo.module.v2x.adapter.holder.V2XIllegalParkVH; import com.mogo.module.v2x.adapter.holder.V2XLiveVideoVH; import com.mogo.module.v2x.adapter.holder.V2XOtherSeekHelpVH; import com.mogo.module.v2x.adapter.holder.V2XPushEventVH; +import com.mogo.module.v2x.adapter.holder.V2XRecommendRouteVH; import com.mogo.module.v2x.adapter.holder.V2XRoadEventVH; import com.mogo.module.v2x.scenario.view.IV2XWindow; @@ -70,6 +71,10 @@ public class V2XRoadEventAdapter extends RecyclerView.Adapter) : V2XBaseViewHolder( + LayoutInflater.from(viewGroup.context).inflate(R.layout.item_v2x_recommend_route, viewGroup, false), v2XWindow), V2XVoiceCallbackListener { + private var mTvAddress: TextView? = null + private var mIvToNav: ImageView? = null + private var mIvClose: ImageView? = null + private var mNoveltyInfo: MarkerExploreWay? = null + private val mainScope = MainScope() + + init { + mTvAddress = itemView.findViewById(R.id.tvAddress) + mIvToNav = itemView.findViewById(R.id.ivToNav) + mIvClose = itemView.findViewById(R.id.ivClose) + mIvToNav?.setOnClickListener { triggerStartNavi(mNoveltyInfo) } + mIvClose?.setOnClickListener { delayedCloseWindow() } + itemView.addOnAttachStateChangeListener(object : View.OnAttachStateChangeListener { + override fun onViewAttachedToWindow(view: View) { + registerUnwakeNavi() + mainScope.launch { + delay(1000 * 20) + delayedCloseWindow() + } + } + + override fun onViewDetachedFromWindow(view: View) { + unRegisterUnwakeNavi() + AIAssist.getInstance(V2XUtils.getApp()).breakOffSpeak() + mainScope.cancel() + } + }) + } + + + override fun initView(viewData: V2XEventShowEntity?) { + viewData?.let { + val markerLocation = MarkerLocation() + markerLocation.lon = it.getV2XRecommendRouteEntity().toPoint.get(0) + markerLocation.lat = it.getV2XRecommendRouteEntity().toPoint.get(1) + mNoveltyInfo = MarkerExploreWay() + mNoveltyInfo?.setLocation(markerLocation) + mTvAddress!!.text = "前往 ${it.getV2XRecommendRouteEntity().formatAddress}" + AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice(it.getV2XRecommendRouteEntity().tts, VoicePreemptType.PREEMPT_TYPE_IMMEADIATELY, null) + } + + } + + override fun onCallback(command: String?, intent: Intent?) { + when (command) { + V2XVoiceConstants.V2X_CONFIRM_ACTION -> triggerStartNavi(mNoveltyInfo) + V2XVoiceConstants.V2X_CANCLE_ACTION -> delayedCloseWindow() + } + } + + + private fun registerUnwakeNavi() { + registerUnWakeVoice(V2XVoiceConstants.V2X_CONFIRM_ACTION, this) + registerUnWakeVoice(V2XVoiceConstants.V2X_CANCLE_ACTION, this) + } + + private fun unRegisterUnwakeNavi() { + unRegisterUnWakeVoice(V2XVoiceConstants.V2X_CONFIRM_ACTION) + unRegisterUnWakeVoice(V2XVoiceConstants.V2X_CANCLE_ACTION) + } +} \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java index f269856f7b..d94f0c7d15 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java @@ -3,6 +3,7 @@ package com.mogo.module.v2x.adapter.holder; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; +import android.os.Handler; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; @@ -10,11 +11,13 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.WindowManager; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; +import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; import com.mogo.module.common.animation.BezierAnimationView; import com.mogo.module.common.entity.MarkerExploreWay; @@ -23,6 +26,7 @@ import com.mogo.module.common.entity.V2XEventShowEntity; import com.mogo.module.common.entity.V2XLiveCarInfoEntity; import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.common.entity.V2XRoadEventEntity; +import com.mogo.module.common.wm.WindowManagerView; import com.mogo.module.v2x.R; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.entity.net.V2XUserInfoRes; @@ -81,7 +85,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { private HeartLikeView ivEventZan; private ViewGroup mViewGroup; - + private WindowManagerView mWindowManagerView; // 上传事件的用户信息 private MarkerUserInfo mUserInfo; @@ -312,7 +316,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { e.printStackTrace(); } } - + /* * 展示事件的图片/视频资源 * */ @@ -364,6 +368,53 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { } } + private void bezierAnimation(int[] loc) { + if (mWindowManagerView == null) { + Log.d(TAG, "bezierAnimation:null"); + mWindowManagerView = new WindowManagerView.Builder(mContext.getApplicationContext()) + .contentView(R.layout.module_common_bezier_layout) + .size(WindowManager.LayoutParams.WRAP_CONTENT, + WindowManager.LayoutParams.WRAP_CONTENT) + .position(loc[0], loc[1]) + .gravity(Gravity.TOP | Gravity.LEFT) + .showInWindowManager(); + } + try { + if (mWindowManagerView.isShowing()) { + return; + } + mWindowManagerView.show(); + } catch (Exception e) { + e.printStackTrace(); + } + BezierAnimationView bezierAnimationView = mWindowManagerView.findViewById(R.id.bezier_view); + bezierAnimationView.bezierAnimationStart(); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { +// mWindowManagerView.dismiss(); + } + }, 2000); + + } + + public int[] getLocation(View v) { + int[] loc = new int[4]; + int[] location = new int[2]; + v.getLocationOnScreen(location); + loc[0] = location[0]; + loc[1] = location[1]; + int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); + int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); + v.measure(w, h); + + loc[2] = v.getMeasuredWidth(); + loc[3] = v.getMeasuredHeight(); + + //base = computeWH(); + return loc; + } + /** * 为了给车聊聊更多的信息需要重新查询一次 * diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java index d42c409a80..10b0be5657 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/alarm/V2XAlarmServer.java @@ -249,7 +249,7 @@ public class V2XAlarmServer { LocationUtils.geoCodeSearch(location, new IMogoGeoSearchListener() { @Override public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) { - //Logger.i(MODULE_NAME, "根据经纬度查询结果为:" + regeocodeResult.getRegeocodeAddress().getFormatAddress()); + Logger.i(MODULE_NAME, "根据经纬度查询结果为:" + regeocodeResult.getRegeocodeAddress().getFormatAddress()); String keyword = "停车场"; boolean isHighWay = false; if (regeocodeResult == null || regeocodeResult.getRegeocodeAddress() == null || diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XRoadDataRes.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XRoadDataRes.java index be15736bda..348453cb7b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XRoadDataRes.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/entity/net/V2XRoadDataRes.java @@ -30,20 +30,18 @@ public class V2XRoadDataRes extends BaseData { } public static class ResultDTO { - + private String formatAddress; private List fromPoint; private List topPoint; private List poiData; private List illegalParkingData; - @Override - public String toString() { - return "ResultDTO{" + - "fromPoint=" + fromPoint + - ", topPoint=" + topPoint + - ", poiData=" + poiData + - ", illegalParkingData=" + illegalParkingData + - '}'; + public String getFormatAddress() { + return formatAddress; + } + + public void setFormatAddress(String formatAddress) { + this.formatAddress = formatAddress; } public List getFromPoint() { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java index eab482be1b..a2991cf351 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java @@ -12,17 +12,21 @@ import com.mogo.commons.data.BaseData; import com.mogo.commons.network.ParamsProvider; import com.mogo.commons.network.SubscribeImpl; import com.mogo.commons.network.Utils; +import com.mogo.commons.voice.AIAssist; import com.mogo.map.MogoLatLng; import com.mogo.map.location.MogoLocation; +import com.mogo.map.search.geo.IMogoGeoSearchListener; +import com.mogo.map.search.geo.MogoGeocodeResult; +import com.mogo.map.search.geo.MogoRegeocodeResult; import com.mogo.module.common.entity.MarkerResponse; import com.mogo.module.common.entity.V2XMessageEntity; -import com.mogo.module.common.entity.V2XPrejectedRoadEventEntity; -import com.mogo.module.common.entity.V2XRoadEventEntity; +import com.mogo.module.common.entity.V2XPoiTypeEnum; +import com.mogo.module.common.entity.V2XPushMessageEntity; +import com.mogo.module.common.entity.V2XRecommendRouteEntity; import com.mogo.module.service.ServiceConst; import com.mogo.module.service.network.RefreshBody; import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.V2XServiceManager; -import com.mogo.module.v2x.alarm.V2XAlarmServer; import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes; import com.mogo.module.v2x.entity.net.V2XLiveCarBroadcastReq; import com.mogo.module.v2x.entity.net.V2XLiveCarRes; @@ -32,7 +36,7 @@ import com.mogo.module.v2x.entity.net.V2XRoadDataRes; import com.mogo.module.v2x.entity.net.V2XSeekHelpRes; import com.mogo.module.v2x.entity.net.V2XStrategyPushRes; import com.mogo.module.v2x.entity.net.V2XUserInfoRes; -import com.mogo.module.v2x.utils.TimeUtils; +import com.mogo.module.v2x.utils.LocationUtils; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.service.MogoServicePaths; import com.mogo.service.network.IMogoNetwork; @@ -42,14 +46,13 @@ import com.mogo.utils.network.utils.GsonUtil; import java.util.Map; -import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.annotations.NonNull; -import io.reactivex.disposables.Disposable; +import io.reactivex.functions.Function; import io.reactivex.schedulers.Schedulers; import okhttp3.RequestBody; -import static com.mogo.module.v2x.V2XConst.MODULE_NAME; +import static com.mogo.module.v2x.V2XServiceManager.getContext; /** @@ -684,32 +687,85 @@ public class V2XRefreshModel { @Override public void onNext(V2XRoadDataRes v2XRoadDataRes) { super.onNext(v2XRoadDataRes); - Logger.d("queryRoadData:onSuccess", v2XRoadDataRes.toString()); - if (v2XRoadDataRes == null || v2XRoadDataRes.getResult() == null) { + if (v2XRoadDataRes == null + || v2XRoadDataRes.getResult() == null + || v2XRoadDataRes.getResult().getTopPoint() == null + || v2XRoadDataRes.getResult().getTopPoint().isEmpty()) { return; } - if (v2XRoadDataRes.getResult().getPoiData() != null && v2XRoadDataRes.getResult().getPoiData().size() > 0) { - V2XPrejectedRoadEventEntity v2XPrejectedRoadEventEntity = new V2XPrejectedRoadEventEntity(); - V2XMessageEntity v2xMessageEntity = new V2XMessageEntity<>(); - // 控制类型 - v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PREJECTED_ROAD_WARNING); - // 设置数据 - v2xMessageEntity.setContent(v2XPrejectedRoadEventEntity); - // 控制展示状态 - v2xMessageEntity.setShowState(true); + MogoLocation mogoLocation = new MogoLocation(); + mogoLocation.setLongitude(v2XRoadDataRes.getResult().getTopPoint().get(0)); + mogoLocation.setLatitude(v2XRoadDataRes.getResult().getTopPoint().get(1)); + LocationUtils.geoCodeSearch(mogoLocation, new IMogoGeoSearchListener() { + @Override + public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) { + if (regeocodeResult == null || regeocodeResult.getRegeocodeAddress() == null) { + return; + } + try { + String province = regeocodeResult.getRegeocodeAddress().getProvince(); + String city = regeocodeResult.getRegeocodeAddress().getCity(); + v2XRoadDataRes.getResult().setFormatAddress(regeocodeResult.getRegeocodeAddress().getFormatAddress().replaceAll(province, "").replaceAll(city, "")); + sendBroadcast(v2XRoadDataRes); + } catch (Exception e) { + e.printStackTrace(); + } - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2xMessageEntity); - LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent); - } - } - - @Override - public void onError(Throwable e) { - super.onError(e); - Logger.d("queryRoadData:onError", e.toString()); + } + }); } }); } } + + private void sendBroadcast(V2XRoadDataRes v2XRoadDataRes) { + boolean isSendRecommendRoute = false; + if (v2XRoadDataRes.getResult().getPoiData() != null && v2XRoadDataRes.getResult().getPoiData().size() > 0) { + for (V2XRoadDataRes.ResultDTO.PoiDataDTO poiDataDTO : v2XRoadDataRes.getResult().getPoiData()) { + if (!V2XPoiTypeEnum.FOURS_LIVING.equals(poiDataDTO.getPoiType())) { + isSendRecommendRoute = true; + break; + } + } + } + if (isSendRecommendRoute) { + V2XMessageEntity v2xMessageEntity = new V2XMessageEntity<>(); + // 控制类型 + v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_RECOMMEND_ROUTE); + // 设置数据 + v2xMessageEntity.setContent(new V2XRecommendRouteEntity(v2XRoadDataRes.getResult().getTopPoint(), v2XRoadDataRes.getResult().getFormatAddress())); + // 控制展示状态 + v2xMessageEntity.setShowState(true); + + Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2xMessageEntity); + LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent); + } + + if (!isSendRecommendRoute && v2XRoadDataRes.getResult().getIllegalParkingData() != null && v2XRoadDataRes.getResult().getIllegalParkingData().size() > 0) { + try { + V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>(); + v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_RECOMMEND_PARKING); + // 设置数据 + V2XRoadDataRes.ResultDTO.IllegalParkingDataDTO parkingDataDTO = v2XRoadDataRes.getResult().getIllegalParkingData().get(0); + V2XPushMessageEntity pushMessageEntity = new V2XPushMessageEntity(); + pushMessageEntity.setAddress(parkingDataDTO.getAddr()); + pushMessageEntity.setAlarmContent("停车场推荐"); + pushMessageEntity.setLat(parkingDataDTO.getLat()); + pushMessageEntity.setLon(parkingDataDTO.getLon()); + String tts = "主人,我发现" + v2XRoadDataRes.getResult().getFormatAddress() + "停车容易违章,推荐你导航到附近停车场,开始导航吗?"; + AIAssist.getInstance(getContext()).speakTTSVoice(tts); + pushMessageEntity.setExpireTime(20000); + // 控制展示状态 + v2XMessageEntity.setContent(pushMessageEntity); + v2XMessageEntity.setShowState(true); + + Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); + LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent); + } catch (Exception e) { + e.printStackTrace(); + } + } + } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java index c33e5ab8d8..f46bc7a74b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/impl/V2XScenarioManager.java @@ -1,6 +1,7 @@ package com.mogo.module.v2x.scenario.impl; import android.content.Intent; +import android.util.Log; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -9,7 +10,7 @@ import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.scenario.IV2XScenarioManager; import com.mogo.module.v2x.scenario.scene.animation.V2XAnimationScenario; -import com.mogo.module.v2x.scenario.scene.destination.V2XPrejectedRoadEventScenario; +import com.mogo.module.v2x.scenario.scene.destination.V2XRecommendRouteScenario; import com.mogo.module.v2x.scenario.scene.fatigue.V2XFatigueDrivingScenario; import com.mogo.module.v2x.scenario.scene.help.V2XCarForHelpScenario; import com.mogo.module.v2x.scenario.scene.livecar.V2XPushLiveCarScenario; @@ -24,6 +25,7 @@ import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.utils.TipToast; import com.mogo.utils.logger.Logger; +import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_RECOMMEND_PARKING; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; /** @@ -73,7 +75,8 @@ public class V2XScenarioManager implements IV2XScenarioManager { case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING: mV2XScenario = new V2XSeekHelpScenario(); break; - case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING: + case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING : + case ALERT_RECOMMEND_PARKING : mV2XScenario = new V2XFatigueDrivingScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING: @@ -92,13 +95,13 @@ public class V2XScenarioManager implements IV2XScenarioManager { mV2XScenario = new V2XIllegalParkScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING: - mV2XScenario = new V2XEventUgcScenario(); + mV2XScenario = V2XServiceManager.getMoGoStatusManager().isVrMode() ? null : new V2XEventUgcScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW: mV2XScenario = new V2XVoiceCallLiveScenario(); break; - case V2XMessageEntity.V2XTypeEnum.ALERT_PREJECTED_ROAD_WARNING: - mV2XScenario = new V2XPrejectedRoadEventScenario(); + case V2XMessageEntity.V2XTypeEnum.ALERT_RECOMMEND_ROUTE: + mV2XScenario = new V2XRecommendRouteScenario(); break; case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW: mV2XScenario = new V2XPushVREventScenario(); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XPrejectedRoadEventScenario.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XPrejectedRoadEventScenario.kt deleted file mode 100644 index d741864f2a..0000000000 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XPrejectedRoadEventScenario.kt +++ /dev/null @@ -1,64 +0,0 @@ -package com.mogo.module.v2x.scenario.scene.destination - -import com.mogo.module.common.entity.V2XMessageEntity -import com.mogo.module.common.entity.V2XPrejectedRoadEventEntity -import com.mogo.module.v2x.scenario.impl.AbsV2XScenario - -/** - * created by wujifei on 2020/12/25 14:15 - * describe:基于目的地预判的道路事件场景 - */ -class V2XPrejectedRoadEventScenario : AbsV2XScenario() { - - init { - v2XWindow = V2XPrejectedRoadEventWindow() - } - - override fun init(v2XMessageEntity: V2XMessageEntity?) { - v2XMessageEntity?.content.let { - if (v2XMessageEntity!!.isShowState) { - if (!isSameScenario(v2XMessageEntity)) { - // 更新要提醒的数据 - setV2XMessageEntity(v2XMessageEntity) - show() - } else { - // 更新要提醒的数据 - setV2XMessageEntity(v2XMessageEntity) - } - } else { - close() - } - } - } - - - override fun show() { - TODO("Not yet implemented") - } - - override fun showWindow() { - TODO("Not yet implemented") - } - - override fun closeWindow() { - TODO("Not yet implemented") - } - - override fun showButton() { - TODO("Not yet implemented") - } - - override fun closeButton() { - TODO("Not yet implemented") - } - - override fun drawPOI() { - TODO("Not yet implemented") - } - - override fun clearPOI() { - TODO("Not yet implemented") - } - - -} \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendParkingLotScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendParkingLotScenario.java new file mode 100644 index 0000000000..b3b5cd8daa --- /dev/null +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendParkingLotScenario.java @@ -0,0 +1,8 @@ +package com.mogo.module.v2x.scenario.scene.destination; + +/** + * 基于目的地违章高发情况的停车推荐 + * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48958095 + */ +public class V2XRecommendParkingLotScenario { +} diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendRouteScenario.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendRouteScenario.kt new file mode 100644 index 0000000000..01b1cb6788 --- /dev/null +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendRouteScenario.kt @@ -0,0 +1,76 @@ +package com.mogo.module.v2x.scenario.scene.destination + +import android.view.ViewGroup +import com.mogo.module.common.entity.V2XMessageEntity +import com.mogo.module.common.entity.V2XRecommendRouteEntity +import com.mogo.module.v2x.R +import com.mogo.module.v2x.V2XServiceManager +import com.mogo.module.v2x.scenario.impl.AbsV2XScenario +import com.mogo.module.v2x.utils.V2XUtils + +/** + * created by wujifei on 2020/12/29 17:57 + * describe:基于目的地预判的道路事件提醒、路线推荐 + */ +class V2XRecommendRouteScenario : AbsV2XScenario() { + + init { + v2XWindow = V2XRecommendRouteWindow() + } + + override fun init(v2XMessageEntity: V2XMessageEntity?) { + v2XMessageEntity?.content?.let { + if (v2XMessageEntity!!.isShowState) { + if (!isSameScenario(v2XMessageEntity)) { + setV2XMessageEntity(v2XMessageEntity) + show() + } else { + setV2XMessageEntity(v2XMessageEntity) + } + } else { + close() + } + } + } + + + override fun show() { + if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume) { + showWindow() + } + } + + override fun showWindow() { + v2XWindow?.let { + val layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, + V2XUtils.getApp().resources.getDimension(R.dimen.module_v2x_fatigue_driving_window_height_ground).toInt()) + V2XServiceManager.getMogoTopViewManager().addView(it.view, layoutParams) + it.show(v2XMessageEntity.content) + + } + } + + override fun closeWindow() { + v2XWindow?.let { + it.close() + } + } + + override fun showButton() { + TODO("Not yet implemented") + } + + override fun closeButton() { + TODO("Not yet implemented") + } + + override fun drawPOI() { + TODO("Not yet implemented") + } + + override fun clearPOI() { + TODO("Not yet implemented") + } + + +} \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XPrejectedRoadEventWindow.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendRouteWindow.kt similarity index 58% rename from modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XPrejectedRoadEventWindow.kt rename to modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendRouteWindow.kt index 15100946aa..717301dbeb 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XPrejectedRoadEventWindow.kt +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/destination/V2XRecommendRouteWindow.kt @@ -4,34 +4,33 @@ import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater import android.view.View -import android.widget.ImageView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.PagerSnapHelper import androidx.recyclerview.widget.RecyclerView import com.mogo.module.common.entity.V2XEventShowEntity -import com.mogo.module.common.entity.V2XRoadEventEntity +import com.mogo.module.common.entity.V2XMessageEntity +import com.mogo.module.common.entity.V2XRecommendRouteEntity import com.mogo.module.v2x.R import com.mogo.module.v2x.V2XServiceManager import com.mogo.module.v2x.adapter.V2XRoadEventAdapter import com.mogo.module.v2x.listener.V2XWindowStatusListener import com.mogo.module.v2x.scenario.scene.V2XBasWindow import com.mogo.module.v2x.scenario.view.IV2XWindow -import java.util.* /** * created by wujifei on 2020/12/25 11:45 * describe:基于目的地预判的道路事件场景弹窗 */ -class V2XPrejectedRoadEventWindow @JvmOverloads constructor( +class V2XRecommendRouteWindow @JvmOverloads constructor( context: Context = V2XServiceManager.getContext(), attrs: AttributeSet? = null, - defStyleAttr: Int = 0) : V2XBasWindow(context, attrs, defStyleAttr), IV2XWindow { - private var rvPrejectedRoadEventList: RecyclerView? = null - private var btnCloseWindow: ImageView? = null + defStyleAttr: Int = 0) : V2XBasWindow(context, attrs, defStyleAttr), IV2XWindow { + + private var rvRoadEventList: RecyclerView? = null + private var mV2XRoadEventAdapter: V2XRoadEventAdapter? = null // 列表展示 - private val mItemList: List = ArrayList() - private var mV2XRoadEventAdapter: V2XRoadEventAdapter? = null + private val mItemList = mutableListOf() init { initView(context) @@ -39,17 +38,15 @@ class V2XPrejectedRoadEventWindow @JvmOverloads constructor( private fun initView(context: Context) { // 填充布局 - LayoutInflater.from(context).inflate(R.layout.window_prejected_road_event_detail, this) - rvPrejectedRoadEventList = findViewById(R.id.rvPrejectedRoadEventList) as RecyclerView - btnCloseWindow = findViewById(R.id.btnCloseWindow) as ImageView - btnCloseWindow!!.setOnClickListener { close() } + LayoutInflater.from(context).inflate(R.layout.window_fault_help, this) + rvRoadEventList = findViewById(R.id.rvRoadEventList); mV2XRoadEventAdapter = V2XRoadEventAdapter(mItemList, this) - rvPrejectedRoadEventList!!.adapter = mV2XRoadEventAdapter + rvRoadEventList?.setAdapter(mV2XRoadEventAdapter) // 设置切换样式 - PagerSnapHelper().attachToRecyclerView(rvPrejectedRoadEventList) + PagerSnapHelper().attachToRecyclerView(rvRoadEventList) // 配置列表朝向 val layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false) - rvPrejectedRoadEventList!!.layoutManager = layoutManager + rvRoadEventList?.setLayoutManager(layoutManager) } @@ -62,10 +59,20 @@ class V2XPrejectedRoadEventWindow @JvmOverloads constructor( return this } - override fun setWindowStatusListener(listener: V2XWindowStatusListener) {} + override fun setWindowStatusListener(listener: V2XWindowStatusListener) { + } - override fun show(entity: V2XRoadEventEntity?) { - TODO("Not yet implemented") + override fun show(entity: V2XRecommendRouteEntity?) { + entity.let { + // 清空数据 + mItemList.clear() + val v2XEventShowEntity = V2XEventShowEntity() + v2XEventShowEntity.v2XRecommendRouteEntity = entity + v2XEventShowEntity.viewType = V2XMessageEntity.V2XTypeEnum.ALERT_RECOMMEND_ROUTE + mItemList.add(v2XEventShowEntity) + // 刷新列表 + mV2XRoadEventAdapter?.notifyDataSetChanged() + } } } \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingScenario.java index 92f7e1e32e..36291cdc1c 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/fatigue/V2XFatigueDrivingScenario.java @@ -25,7 +25,8 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME; * author : donghongyu * e-mail : 1358506549@qq.com * date : 2020/5/15 5:37 PM - * desc : 疲劳驾驶场景 + * desc : 疲劳驾驶/目的地停车场推荐场景 + * 目的地停车场他推荐:http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48958095 * version: 1.0 */ public class V2XFatigueDrivingScenario extends AbsV2XScenario implements IMogoTopViewStatusListener { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/test/V2XTestConsoleWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/test/V2XTestConsoleWindow.java index 0c3d3b3cc8..61e5a72ac6 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/test/V2XTestConsoleWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/test/V2XTestConsoleWindow.java @@ -57,7 +57,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout { private Button mBtnTriggerCallUserInfo; private Button mBtnTriggerEventUgc; private Button mBtnTriggerTrafficSearch; - private Button mBtnTriggerPrejectedRoadEvent; + private Button mBtnTriggerRecommendRouteEvent; private Button nBtnTriggerVR; private Button btnTriggerRearVIPCarTip, @@ -118,7 +118,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout { mBtnTriggerEventUgc = findViewById(R.id.btnTriggerEventUgc); mBtnTriggerCallUserInfo = findViewById(R.id.btnTriggerCallUserInfo); mBtnTriggerTrafficSearch = findViewById(R.id.btnTriggerTrafficSearch); - mBtnTriggerPrejectedRoadEvent = findViewById(R.id.btnTriggerPrejectedRoadEvent); + mBtnTriggerRecommendRouteEvent = findViewById(R.id.btnTriggerRecommendRouteEvent); nBtnTriggerVR = findViewById(R.id.btnTriggerVR); switch (showType) { @@ -279,8 +279,8 @@ public class V2XTestConsoleWindow extends ConstraintLayout { mBtnTriggerTrafficSearch.setOnClickListener(v -> V2XServiceManager.getIMogoTrafficUploadProvider().verifyCurrentTrafficStatus()); - mBtnTriggerPrejectedRoadEvent.setOnClickListener(view -> { - V2XServiceManager.getV2XRefreshModel().queryRoadData("XTCAA83540301871"); + mBtnTriggerRecommendRouteEvent.setOnClickListener(view -> { + V2XServiceManager.getV2XRefreshModel().queryRoadData("ZD802C1938L10797"); }); /* diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/voice/V2XVoiceConstants.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/voice/V2XVoiceConstants.java index 6f22e219a8..42e1448fd5 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/voice/V2XVoiceConstants.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/voice/V2XVoiceConstants.java @@ -283,6 +283,13 @@ public class V2XVoiceConstants { public static final String COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP"; public static final String[] COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP_WORDS = {"没注意", "没看到", "没有施工","无施工", "很正常", "取消", "关闭"}; + //免唤醒词 + public static final String V2X_CONFIRM_ACTION = "V2X_CONFIRM_ACTION"; + public static final String[] UNWAKE_NAVI_CONFIRM = {"开始导航", "开启导航", "好的", "开始", "导航", "确定", "确认", "好"}; + + public static final String V2X_CANCLE_ACTION = "V2X_CANCLE_ACTION"; + public static final String[] UNWAKE_NAVI_CANCLE = {"取消", "关闭", "不要", "不导航"}; + static { // 免唤醒 默认 @@ -321,6 +328,9 @@ public class V2XVoiceConstants { sVoiceCmds.put(COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP, COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP_WORDS); sVoiceCmds.put(COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP, COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP_WORDS); + sVoiceCmds.put(V2X_CONFIRM_ACTION, UNWAKE_NAVI_CONFIRM); + sVoiceCmds.put(V2X_CANCLE_ACTION, UNWAKE_NAVI_CANCLE); + //2020-6-24 顺义演示需求添加,现合并至launcher 更新时间:2020-08-25 sVoiceCmds.put(COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR_DEMO_UN_WAKEUP, COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR_DEMO_UN_WAKEUP_WORDS); diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_icon_route.png b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_icon_route.png new file mode 100644 index 0000000000..bff6a53df5 Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_icon_route.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_to_nav_nomal.png b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_to_nav_nomal.png new file mode 100644 index 0000000000..d89535c229 Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_to_nav_nomal.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_to_nav_pressed.png b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_to_nav_pressed.png new file mode 100644 index 0000000000..2a4abd712c Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/v2x_to_nav_pressed.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_icon_route.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_icon_route.png new file mode 100644 index 0000000000..bff6a53df5 Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_icon_route.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_to_nav_nomal.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_to_nav_nomal.png new file mode 100644 index 0000000000..d89535c229 Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_to_nav_nomal.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_to_nav_pressed.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_to_nav_pressed.png new file mode 100644 index 0000000000..2a4abd712c Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/v2x_to_nav_pressed.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_icon_route.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_icon_route.png new file mode 100644 index 0000000000..bff6a53df5 Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_icon_route.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_to_nav_nomal.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_to_nav_nomal.png new file mode 100644 index 0000000000..d89535c229 Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_to_nav_nomal.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_to_nav_pressed.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_to_nav_pressed.png new file mode 100644 index 0000000000..2a4abd712c Binary files /dev/null and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_to_nav_pressed.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable/v2x_to_nav.xml b/modules/mogo-module-v2x/src/main/res/drawable/v2x_to_nav.xml new file mode 100644 index 0000000000..bc3c6b0bc9 --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/drawable/v2x_to_nav.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail_vr.xml index c4f2fd14aa..d0d64e7d06 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail_vr.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail_vr.xml @@ -36,7 +36,7 @@ + + + + + + + + + + + + + + diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml b/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml index 34662993f3..71209e7cca 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/window_test_console.xml @@ -211,14 +211,14 @@ app:layout_constraintStart_toStartOf="parent" />