完成基础的弹窗绘制线的功能

This commit is contained in:
董宏宇
2021-04-01 18:39:42 +08:00
parent bac9d5a9d0
commit e47736afd9
12 changed files with 88 additions and 97 deletions

1
.idea/gradle.xml generated
View File

@@ -91,6 +91,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/module_main_window_background_color"
android:orientation="vertical">
<!-- 地图-->
<!-- 地图 -->
<FrameLayout
android:id="@+id/module_main_id_map_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- 天气动画层 -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_special_effect"
android:id="@+id/cl_special_effect"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
@@ -23,20 +24,21 @@
android:id="@+id/iv_wu1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/wu1"
android:alpha="0"
android:src="@drawable/wu1"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/iv_wu2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/wu2"
android:alpha="0"
android:src="@drawable/wu2"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!--四个方向,碰撞预警-->
<ImageView
android:id="@+id/warning_top"
android:layout_width="match_parent"
@@ -67,6 +69,7 @@
android:background="@drawable/module_main_warning_bkg_bottom"
android:visibility="gone" />
<!-- 左侧阴影背景 -->
<FrameLayout
android:id="@+id/module_main_id_map_left_shadow_frame"
android:layout_width="@dimen/module_main_map_left_shadow_frame_width"
@@ -75,7 +78,7 @@
android:visibility="gone"
tools:visibility="visible" />
<!-- 左边按钮 -->
<!-- 左边快捷按钮 -->
<FrameLayout
android:id="@+id/module_main_id_apps_fragment_container"
android:layout_width="@dimen/module_main_apps_fragment_container_width"
@@ -85,13 +88,13 @@
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop" />
<!-- 左侧浮层,布局位置目前只考虑了1+16独立app情况 -->
<!-- 左侧浮层,布局位置目前只考虑了1+16独立app情况 -->
<FrameLayout
android:id="@+id/module_main_id_left_panel_fragment_container"
android:layout_width="@dimen/module_main_id_left_panel_fragment_container_width"
android:layout_height="match_parent" />
<!--快捷操作浮层-->
<!-- 快捷操作浮层 -->
<FrameLayout
android:id="@+id/module_main_id_entrance_fragment_container"
android:layout_width="match_parent"
@@ -108,6 +111,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- 右边事件面板 -->
<FrameLayout
android:id="@+id/module_main_id_event_panel_fragment_container"
android:layout_width="match_parent"
@@ -118,6 +122,7 @@
android:paddingRight="@dimen/module_main_event_panel_fragment_paddingRight"
android:paddingBottom="@dimen/module_main_event_panel_fragment_paddingBottom" />
<!-- 目的地车友 -->
<FrameLayout
android:id="@+id/module_main_id_message_history_fragment_container"
android:layout_width="match_parent"

View File

@@ -16,7 +16,7 @@ import com.mogo.module.v2x.scenario.scene.livecar.V2XPushLiveCarScenario;
import com.mogo.module.v2x.scenario.scene.livecar.V2XVoiceCallLiveScenario;
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
import com.mogo.module.v2x.scenario.scene.pushVR.V2XPushVREventScenario;
import com.mogo.module.v2x.scenario.scene.route.V2XOptimalRouteVREventScenario;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpScenario;
import com.mogo.module.v2x.scenario.scene.ugc.V2XEventUgcScenario;
@@ -104,7 +104,9 @@ public class V2XScenarioManager implements IV2XScenarioManager {
mV2XScenario = new V2XRecommendRouteScenario();
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_VR_SHOW:
mV2XScenario = new V2XPushVREventScenario();
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
mV2XScenario = new V2XOptimalRouteVREventScenario();
}
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP:
case V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_LEFT:

View File

@@ -14,16 +14,7 @@ import com.mogo.module.v2x.voice.V2XVoiceManager;
import com.mogo.service.entrance.ButtonIndex;
/**
* @ProjectName: MoGoModulSafeDriving
* @Package: com.mogo.module.v2x.scenario.view
* @ClassName: V2XRoadEventButton
* @Description: 道路实况按钮
* @Author: fenghl
* @CreateDate: 2020/5/18 10:46
* @UpdateUser: 更新者:
* @UpdateDate: 2020/5/18 10:46
* @UpdateRemark: 更新说明:
* @Version: 1.0
* 道路实况按钮
*/
public class V2XRoadEventButton implements IV2XButton {
private TextView tv;

View File

@@ -6,16 +6,7 @@ import com.mogo.module.v2x.scenario.view.IV2XMarker;
import com.mogo.module.v2x.utils.MarkerUtils;
/**
* @ProjectName: MoGoModulSafeDriving
* @Package: com.mogo.module.v2x.scenario.view
* @ClassName: V2XRoadEventMarker
* @Description: java类作用描述
* @Author: fenghl
* @CreateDate: 2020/5/18 10:48
* @UpdateUser: 更新者:
* @UpdateDate: 2020/5/18 10:48
* @UpdateRemark: 更新说明:
* @Version: 1.0
* 道路V2X事件的Marker
*/
public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
@Override

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x.scenario.scene.pushVR;
package com.mogo.module.v2x.scenario.scene.route;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.overlay.MogoPolylineOptions;
@@ -19,7 +19,7 @@ import java.util.List;
* desc : 推送VR场景
* version: 1.0
*/
public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
public class V2XOptimalRouteVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
private final String TAG = "V2XPushVREventMarker";
private static IMogoPolyline mMogoPolyline;
@@ -59,7 +59,7 @@ public class V2XPushVREventMarker implements IV2XMarker<V2XPushMessageEntity> {
colors.add(0xFFCB253A);
// 线条粗细渐变渐变色值
options.width(15).useGradient(true).color(0xFFF95959);
options.width(30).useGradient(true).colorValues(colors);
for (double[] doubles : entity.getRecommendPolyline()) {
options.add(doubles[0], doubles[1]);

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x.scenario.scene.pushVR;
package com.mogo.module.v2x.scenario.scene.route;
import android.view.View;
import android.view.ViewGroup;
@@ -20,17 +20,18 @@ import com.mogo.utils.network.utils.GsonUtil;
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020/5/15 5:37 PM
* desc : 推送VR场景控制
* desc : 最优车道选择
* version: 1.0
* wiki : http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52829799
*/
public class V2XPushVREventScenario
public class V2XOptimalRouteVREventScenario
extends AbsV2XScenario<V2XPushMessageEntity>
implements IMogoTopViewStatusListener {
private String TAG = "V2XPushVREventWindow";
public V2XPushVREventScenario() {
setV2XMarker(new V2XPushVREventMarker());
setV2XWindow(new V2XPushVREventWindow());
public V2XOptimalRouteVREventScenario() {
setV2XMarker(new V2XOptimalRouteVREventMarker());
setV2XWindow(new V2XOptimalRouteVREventWindow());
}
@Override

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x.scenario.scene.pushVR;
package com.mogo.module.v2x.scenario.scene.route;
import android.content.Context;
import android.os.Handler;
@@ -24,7 +24,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* TODO 只有VR演示场景使用
* version: 1.0
*/
public class V2XPushVREventWindow extends V2XBasWindow implements IV2XWindow<V2XPushMessageEntity> {
public class V2XOptimalRouteVREventWindow extends V2XBasWindow implements IV2XWindow<V2XPushMessageEntity> {
private String TAG = "V2XPushVREventWindow";
// 处理道路事件30秒倒计时
@@ -32,24 +32,22 @@ public class V2XPushVREventWindow extends V2XBasWindow implements IV2XWindow<V2X
private Runnable runnableV2XEvent;
private int mExpireTime = 30000;
public V2XPushVREventWindow() {
public V2XOptimalRouteVREventWindow() {
this(V2XServiceManager.getContext());
}
public V2XPushVREventWindow(Context context) {
public V2XOptimalRouteVREventWindow(Context context) {
this(context, null);
}
public V2XPushVREventWindow(Context context, AttributeSet attrs) {
public V2XOptimalRouteVREventWindow(Context context, AttributeSet attrs) {
this(V2XServiceManager.getContext(), null, 0);
}
public V2XPushVREventWindow(Context context, AttributeSet attrs, int defStyleAttr) {
public V2XOptimalRouteVREventWindow(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
// 填充布局
LayoutInflater.from(context).inflate(V2XServiceManager.getMoGoStatusManager().isVrMode() ?
R.layout.window_road_event_detail_vr : R.layout.window_road_event_detail, this);
LayoutInflater.from(context).inflate(R.layout.vr_window_top_tips, this);
}
/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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_marginStart="@dimen/dp_190"
android:layout_height="wrap_content"
android:background="@drawable/v2x_front_warning_bg"
android:paddingStart="@dimen/dp_28"
android:paddingTop="@dimen/dp_20"
android:paddingEnd="@dimen/dp_28"
android:paddingBottom="@dimen/dp_20">
<ImageView
android:id="@+id/warning_type_image"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:src="@drawable/v2x_optimal_route_warning"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/warning_content_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:text="为您推荐最优路线"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_32"
app:layout_constraintBottom_toBottomOf="@+id/warning_type_image"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/warning_type_image"
app:layout_constraintTop_toTopOf="@+id/warning_type_image" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -455,7 +455,7 @@
android:layout_marginBottom="@dimen/dp_10"
android:background="#4CAF50"
android:padding="@dimen/dp_10"
android:text="拥堵路线推荐"
android:text="最优车道推荐"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_22"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -18,78 +18,42 @@
"lon":116.41808,
"polyline": [
[
116.408012,39.968598
116.417437,39.983323
],
[
116.408784,39.968688
116.41924,39.983364
],
[
116.409632,39.968688
116.421396,39.983397
],
[
116.410168,39.968688
116.422984,39.983421
],
[
116.410898,39.968795
116.423016,39.983405
],
[
116.412143,39.968812
],
[
116.414481,39.968919
],
[
116.41681,39.969025
],
[
116.417947,39.96905
],
[
116.418011,39.968179
],
[
116.418033,39.967644
],
[
116.417947,39.967225
116.424272,39.983397
]
],
"recommendPolyline": [
[
116.408012,39.968598
116.417437,39.983323
],
[
116.408784,39.968688
116.41924,39.983364
],
[
116.409632,39.968688
116.421396,39.983397
],
[
116.410168,39.968688
116.422984,39.983421
],
[
116.410898,39.968795
116.423016,39.983405
],
[
116.412143,39.968812
],
[
116.414481,39.968919
],
[
116.41681,39.969025
],
[
116.417947,39.96905
],
[
116.418011,39.968179
],
[
116.418033,39.967644
],
[
116.417947,39.967225
116.424272,39.983397
]
]
}