From 8f02c3dfb35e55f097c176304d196f7a2f4bf56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Wed, 9 Dec 2020 11:14:40 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E5=87=BA?= =?UTF-8?q?=E8=A1=8C=E5=8A=A8=E6=80=81=E4=B8=AD=E9=81=93=E8=B7=AF=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E9=87=8D=E5=A4=8D=E5=AD=98=E5=82=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constants/RoomConstants.java | 9 ++++++++ .../common/entity/V2XHistoryScenarioData.java | 23 +++++++++++++++---- .../java/com/mogo/module/v2x/V2XConst.java | 2 ++ .../v2x/adapter/holder/V2XIllegalParkVH.java | 1 + .../V2XScenarioHistoryIllegalParkVH.java | 1 + .../V2XScenarioHistoryOtherSeekHelpVH.java | 1 + .../holder/V2XScenarioHistoryRoadEventVH.java | 1 + .../v2x/listener/V2XLocationListener.java | 8 +++---- .../v2x/scenario/impl/AbsV2XScenario.java | 14 ----------- .../scene/park/V2XIllegalParkScenario.java | 14 +++++++++++ .../scene/seek/V2XSeekHelpScenario.java | 14 +++++++++++ .../scene/test/V2XTestConsoleWindow.java | 18 +++++++++++++++ .../mogo/module/v2x/utils/V2XSQLiteUtils.java | 9 ++++++-- .../res/raw/scenario_push_event_data.json | 2 +- .../res/raw/scenario_road_event_data.json | 4 ++-- 15 files changed, 94 insertions(+), 27 deletions(-) create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java new file mode 100644 index 0000000000..406e9d4840 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/RoomConstants.java @@ -0,0 +1,9 @@ +package com.mogo.module.common.constants; + +/** + * 数据库常量 + */ +public class RoomConstants { + public static final String DB_NAME_V2X = "MoGoScenario.db"; + public static final String TB_NAME_SCENARIO = "tb_travel_scenario"; +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java index 53f5250437..23a176a04d 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XHistoryScenarioData.java @@ -1,6 +1,6 @@ package com.mogo.module.common.entity; -import com.mogo.map.location.MogoLocation; +import com.mogo.module.common.constants.RoomConstants; import com.mogo.utils.sqlite.annotation.DbDatabase; import com.mogo.utils.sqlite.annotation.DbField; import com.mogo.utils.sqlite.annotation.DbTable; @@ -10,8 +10,8 @@ import com.mogo.utils.sqlite.annotation.DbTable; * * @author donghongyu */ -@DbDatabase(dbName = "MoGoScenario.db") -@DbTable(tableName = "tb_history_scenario") +@DbDatabase(dbName = RoomConstants.DB_NAME_V2X) +@DbTable(tableName = RoomConstants.TB_NAME_SCENARIO) public class V2XHistoryScenarioData { /** @@ -32,6 +32,13 @@ public class V2XHistoryScenarioData { @DbField(fieldName = "eventJsonData") public String eventJsonData; + /** + * 事件json HashCode + * 只取json中的几个代表性字段,表示唯一性,因为图片地址会经常被改变 + */ + @DbField(fieldName = "eventJsonDataHashCode") + public Integer eventJsonDataHashCode; + /** * 事件是否被处理过了,true-处理过了。false-未处理过 */ @@ -70,8 +77,16 @@ public class V2XHistoryScenarioData { isDispose = dispose; } + public Integer getEventJsonDataHashCode() { + return eventJsonDataHashCode; + } + + public void setEventJsonDataHashCode(Integer eventJsonDataHashCode) { + this.eventJsonDataHashCode = eventJsonDataHashCode; + } + @Override - public V2XHistoryScenarioData clone() throws CloneNotSupportedException { + public V2XHistoryScenarioData clone() { try { return (V2XHistoryScenarioData) super.clone(); } catch (CloneNotSupportedException e) { 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 0bb891384e..7d4f0885d8 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 @@ -8,6 +8,8 @@ package com.mogo.module.v2x; * version: 1.0 */ public class V2XConst { + + public static final String T_SCENARIO_HISTORY = "t_search_poi"; /** * V2X面板名称 */ diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java index b57ff5d648..ab27796c44 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java @@ -108,6 +108,7 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder { V2XHistoryScenarioData v2XHistoryScenarioData =new V2XHistoryScenarioData(); v2XHistoryScenarioData.setScenarioType(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING); v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(mExploreWay)); + v2XHistoryScenarioData.setEventJsonDataHashCode(mExploreWay.hashCode()); V2XSQLiteUtils.updateScenarioHistoryDataIsDispose(v2XHistoryScenarioData); itemView.postDelayed(() -> V2XIllegalParkScenario.getInstance().close(), 1000); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java index e32d6aef52..5448409c33 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java @@ -98,6 +98,7 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder implements IV2XScenario { } return mV2XMessageEntity.equals(v2XMessageEntity); } - - - /** - * 存储本地数据 - * - * @param markerExploreWay 要存储的场景 - */ - public void saveLocalStory(int scenarioType, Object markerExploreWay) { - try { - V2XSQLiteUtils.saveLocalStory(scenarioType,markerExploreWay); - } catch (Exception e) { - e.printStackTrace(); - } - } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkScenario.java index 13417215ee..c946cd0c1a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkScenario.java @@ -5,6 +5,7 @@ import androidx.annotation.Nullable; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.common.entity.V2XPoiTypeEnum; +import com.mogo.module.common.entity.V2XPushMessageEntity; import com.mogo.module.common.entity.V2XRoadEventEntity; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.V2XStatusManager; @@ -12,6 +13,7 @@ import com.mogo.module.v2x.alarm.V2XAlarmServer; import com.mogo.module.v2x.scenario.impl.AbsV2XScenario; import com.mogo.module.v2x.utils.ADASUtils; import com.mogo.module.v2x.utils.TrackUtils; +import com.mogo.module.v2x.utils.V2XSQLiteUtils; import java.util.ArrayList; import java.util.List; @@ -113,4 +115,16 @@ public class V2XIllegalParkScenario extends AbsV2XScenario> i setV2XMessageEntity(null); clearPOI(); } + + /** + * 存储本地数据 + * + * @param messageEntity 要存储的场景 + */ + private void saveLocalStory(int scenarioType, V2XPushMessageEntity messageEntity) { + try { + V2XSQLiteUtils.saveLocalStory(scenarioType, messageEntity, messageEntity.hashCode()); + } catch (Exception e) { + e.printStackTrace(); + } + } } 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 c979cca04b..a39d5056bc 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 @@ -190,6 +190,12 @@ public class V2XTestConsoleWindow extends ConstraintLayout { Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent); + + + // 存储本地,出行动态作展示 + saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, + v2XMessageEntity.getContent().getNoveltyInfo()); + }); mBtnTriggerPushEvent.setOnClickListener(v -> { @@ -334,4 +340,16 @@ public class V2XTestConsoleWindow extends ConstraintLayout { }); } + /** + * 存储本地数据 + * + * @param v2XRoadEventEntity 要存储的场景 + */ + public void saveLocalStory(int scenarioType, MarkerExploreWay v2XRoadEventEntity) { + try { + V2XSQLiteUtils.saveLocalStory(scenarioType, v2XRoadEventEntity, v2XRoadEventEntity.hashCode()); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java index 374db86fa8..eb4e1f7e3d 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java @@ -135,6 +135,7 @@ public class V2XSQLiteUtils { newScenarioData.setDispose(true); newScenarioData.setTriggerTime(TimeUtils.getNowMills()); newScenarioData.setEventJsonData(oldScenarioData.getEventJsonData()); + newScenarioData.setEventJsonDataHashCode(oldScenarioData.getEventJsonDataHashCode()); newScenarioData.setScenarioType(oldScenarioData.getScenarioType()); int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData); @@ -150,15 +151,19 @@ public class V2XSQLiteUtils { * * @param markerExploreWay 要存储的场景 */ - public static void saveLocalStory(int scenarioType, Object markerExploreWay) { + public static void saveLocalStory(int scenarioType, Object markerExploreWay, int hashCode) { try { + + Logger.d(V2XConst.MODULE_NAME, "saveLocalStory:" + markerExploreWay); + // 进行数据库存储 V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData(); v2XHistoryScenarioData.setScenarioType(scenarioType); - v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay)); + v2XHistoryScenarioData.setEventJsonDataHashCode(hashCode); List historyScenarioData = getTargetScenarioHistoryData(v2XHistoryScenarioData); + v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay)); v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills()); v2XHistoryScenarioData.setDispose(false); diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_push_event_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_push_event_data.json index 123e7b78ca..c166e32a62 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_push_event_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_push_event_data.json @@ -18,6 +18,6 @@ }, "lat": 39.968678, "lon": 116.405467, - "userHead": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png", + "userHead": "tUserHeadImg/5.png", "msgImgUrl": "https://upload.jianshu.io/users/upload_avatars/7663825/7c28763e-002b-4e89-8dea-5b8da210ef2c.jpg" } \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json index f491d85a2e..cf4d9e9c07 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json @@ -20,8 +20,8 @@ "items":[ { "illegalCount":0, - "thumbnail":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592473692394.jpeg", - "url":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592473692394.jpeg" + "thumbnail":"http://yycp-beijing.myqcloud.com/sso-server-image/1592473692394.jpeg", + "url":"http://yycp-static-1255510688.coom/sso-server-image/1592473692394.jpeg" } ], "location":{ From 068d74cd1bd7651a0e5a3427d1f0978939a23b52 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 9 Dec 2020 11:49:32 +0800 Subject: [PATCH 02/22] =?UTF-8?q?[add]=20=E4=BA=8B=E4=BB=B6=E5=BC=B9?= =?UTF-8?q?=E6=A1=86UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/holder/V2XRoadEventVH.java | 4 +- .../scene/road/V2XRoadEventWindow.java | 4 +- .../res/drawable/bg_v2x_event_type_red_vr.xml | 8 ++ .../res/layout/item_v2x_event_detail_vr.xml | 135 +++++++++--------- .../layout/window_road_event_detail_vr.xml | 34 +++++ .../src/main/res/values-xhdpi/dimens.xml | 4 + 6 files changed, 118 insertions(+), 71 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_red_vr.xml create mode 100644 modules/mogo-module-v2x/src/main/res/layout/window_road_event_detail_vr.xml 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 667ffad0fb..c7c9ab1283 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 @@ -140,8 +140,8 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { public V2XRoadEventVH(ViewGroup viewGroup) { super(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ? - LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false) : - LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail_vr, viewGroup, false) + LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail_vr, viewGroup, false) : + LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false) ); init(itemView); // 设置视图状态监听 diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java index e0c344ca6a..075cb10361 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.PagerSnapHelper; import androidx.recyclerview.widget.RecyclerView; +import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.entity.V2XMessageEntity; import com.mogo.module.v2x.R; import com.mogo.module.v2x.V2XServiceManager; @@ -103,7 +104,8 @@ public class V2XRoadEventWindow extends RelativeLayout private void initView(Context context) { //Logger.d(MODULE_NAME, "V2X===初始化道路事件小窗口View。。。。。"); // 填充布局 - LayoutInflater.from(context).inflate(R.layout.window_road_event_detail, this); + LayoutInflater.from(context).inflate(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ? + R.layout.window_road_event_detail_vr : R.layout.window_road_event_detail, this); // 详情列表 mBtnCloseWindow = findViewById(R.id.btnCloseWindow); // 详情列表 diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_red_vr.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_red_vr.xml new file mode 100644 index 0000000000..ead9ee25ff --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_type_red_vr.xml @@ -0,0 +1,8 @@ + + + + + \ 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 d65db3748c..ff21c0fab0 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 @@ -3,70 +3,52 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/dp_150" - android:background="@drawable/v2x_alert_window_bg" - app:roundLayoutRadius="@dimen/dp_30"> + android:layout_height="@dimen/dp_120" + android:background="@drawable/v2x_bg_pop_up" + android:clipChildren="true" + app:roundLayoutRadius="@dimen/dp_20"> - - - - - - - - + app:miv_failureHolder="@drawable/v2x_icon_live_logo" + app:miv_overlayImageId="@drawable/v2x_icon_live_logo" + app:miv_placeHolder="@drawable/v2x_icon_live_logo" /> + + android:id="@+id/tvEventTypeTitle" + android:layout_width="@dimen/dp_120" + android:layout_height="@dimen/dp_40" + android:layout_alignBottom="@+id/ivEventImg" + android:background="@drawable/bg_v2x_event_type_red_vr" + android:gravity="center" + android:paddingLeft="@dimen/dp_10" + android:paddingTop="@dimen/dp_3" + android:paddingRight="@dimen/dp_10" + android:paddingBottom="@dimen/dp_3" + android:textColor="#fff" + android:textSize="@dimen/module_v2x_event_type_title_text_size" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + tools:text="道路施工" /> + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_road_event_detail_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/window_road_event_detail_vr.xml new file mode 100644 index 0000000000..855714528d --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/layout/window_road_event_detail_vr.xml @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index 8f287310b4..e55d923cc8 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -88,6 +88,10 @@ 98px 130px + + 64px + 120px + 330px 450px From f9a172f5c13a9a4f0a82efc95b776cc8c53b8fed Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 9 Dec 2020 15:10:37 +0800 Subject: [PATCH 03/22] =?UTF-8?q?[add]=20v2x=E5=BC=B9=E6=A1=86UI=20MogoIma?= =?UTF-8?q?geView=E7=BC=BA=E5=B0=91=E5=9C=86=E8=A7=92=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/module/v2x/V2XConst.java | 7 ++++++ .../adapter/holder/V2XOtherSeekHelpVH.java | 6 +++++- .../v2x/adapter/holder/V2XRoadEventVH.java | 3 ++- .../scene/road/V2XRoadEventWindow.java | 3 ++- .../mogo/module/v2x/utils/EventTypeUtils.java | 8 ++++--- .../mogo/module/v2x/view/HeartLikeView.java | 4 +++- .../res/drawable-xhdpi/icon_heart_like_vr.png | Bin 0 -> 1658 bytes .../drawable-xhdpi/v2x_event_icon_live_vr.png | Bin 0 -> 5220 bytes .../res/drawable/selector_live_btn_vr.xml | 6 ++++++ .../res/layout/item_v2x_event_detail_vr.xml | 20 +++++++++++------- .../main/res/layout/view_heart_like_vr.xml | 14 ++++++++++++ .../src/main/res/values-xhdpi/dimens.xml | 5 ++++- 12 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_heart_like_vr.png create mode 100644 modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_live_vr.png create mode 100644 modules/mogo-module-v2x/src/main/res/drawable/selector_live_btn_vr.xml create mode 100644 modules/mogo-module-v2x/src/main/res/layout/view_heart_like_vr.xml 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 7d4f0885d8..f5fbe75e3a 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 @@ -1,5 +1,7 @@ package com.mogo.module.v2x; +import com.mogo.module.common.MogoApisHandler; + /** * author : donghongyu * e-mail : 1358506549@qq.com @@ -131,4 +133,9 @@ public class V2XConst { * 绿波车速marker */ public static final String V2X_OPTIMAL_SPEED_MARKER = "V2X_OPTIMAL_SPEED_MARKER"; + + /* + * VR模式 + * */ + public static final boolean VR_MODE = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode(); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java index 97fa75bc3a..fbc74ab555 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java @@ -9,6 +9,7 @@ import android.widget.ImageView; import android.widget.TextView; import com.mogo.commons.debug.DebugConfig; +import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.MarkerLocation; import com.mogo.module.common.entity.MarkerUserInfo; @@ -31,6 +32,7 @@ import java.util.Locale; import static android.view.View.GONE; import static android.view.View.VISIBLE; +import static com.mogo.module.v2x.V2XConst.VR_MODE; /** * e-mail : 1358506549@qq.com @@ -194,7 +196,9 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder { .append("" + (int) mV2XPushMessageEntity.getDistance()) .setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text)) .append("米") - .setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title)) + .setFontSize((int) itemView.getResources().getDimension( + VR_MODE ? + R.dimen.module_v2x_event_distance_title_vr : R.dimen.module_v2x_event_distance_title)) .create(); } SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA); 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 c7c9ab1283..0849420071 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 @@ -45,6 +45,7 @@ import java.util.List; import static android.view.View.GONE; import static android.view.View.VISIBLE; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; +import static com.mogo.module.v2x.V2XConst.VR_MODE; /** * author : donghongyu @@ -139,7 +140,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { } public V2XRoadEventVH(ViewGroup viewGroup) { - super(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ? + super(VR_MODE ? LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail_vr, viewGroup, false) : LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false) ); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java index 075cb10361..566a7e4802 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventWindow.java @@ -36,6 +36,7 @@ import java.util.List; import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; +import static com.mogo.module.v2x.V2XConst.VR_MODE; /** * author : donghongyu @@ -104,7 +105,7 @@ public class V2XRoadEventWindow extends RelativeLayout private void initView(Context context) { //Logger.d(MODULE_NAME, "V2X===初始化道路事件小窗口View。。。。。"); // 填充布局 - LayoutInflater.from(context).inflate(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ? + LayoutInflater.from(context).inflate(VR_MODE ? R.layout.window_road_event_detail_vr : R.layout.window_road_event_detail, this); // 详情列表 mBtnCloseWindow = findViewById(R.id.btnCloseWindow); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java index 16c8cdd890..5df0729f44 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java @@ -7,6 +7,8 @@ import com.mogo.module.v2x.R; import com.mogo.module.v2x.voice.V2XVoiceConstants; import com.mogo.utils.logger.Logger; +import static com.mogo.module.v2x.V2XConst.VR_MODE; + /** * @ProjectName: MoGoModulSafeDriving * @Package: com.mogo.module.v2x.utils @@ -101,7 +103,7 @@ public class EventTypeUtils { case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵 case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况 case V2XPoiTypeEnum.FOURS_NEALY: // 身边 - strBg = R.drawable.bg_v2x_event_type_orange; + strBg = VR_MODE ? R.drawable.bg_v2x_event_type_orange_vr : R.drawable.bg_v2x_event_type_orange; break; case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查 case V2XPoiTypeEnum.ROAD_CLOSED:// 封路 @@ -110,10 +112,10 @@ public class EventTypeUtils { case V2XPoiTypeEnum.FOURS_FOG: // 浓雾 case V2XPoiTypeEnum.FOURS_ICE: // 结冰 case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故 - strBg = R.drawable.bg_v2x_event_type_read; + strBg = VR_MODE ? R.drawable.bg_v2x_event_type_red_vr : R.drawable.bg_v2x_event_type_read; break; default: - strBg = R.drawable.bg_v2x_event_type_read; + strBg = VR_MODE ? R.drawable.bg_v2x_event_type_red_vr : R.drawable.bg_v2x_event_type_read; break; } return strBg; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java index cb659d2f97..dc9e155ed7 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java @@ -14,6 +14,8 @@ import androidx.annotation.Nullable; import com.mogo.module.v2x.R; +import static com.mogo.module.v2x.V2XConst.VR_MODE; + /** * 红心点赞按钮控件 * @@ -44,7 +46,7 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList inflate(context, R.layout.view_heart_like_gray_back, this); mIllegalParkingLike = findViewById(R.id.ivLikeForGrayBack); } else { - inflate(context, R.layout.view_heart_like, this); + inflate(context, VR_MODE ? R.layout.view_heart_like_vr : R.layout.view_heart_like, this); mIllegalParkingLike = findViewById(R.id.ivIllegalParkingLike); } diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_heart_like_vr.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_heart_like_vr.png new file mode 100644 index 0000000000000000000000000000000000000000..c74d1b9fe83b9c6c8e605670de4b7a2bb7b92677 GIT binary patch literal 1658 zcmeAS@N?(olHy`uVBq!ia0vp^azHH0!N$PAcxv&RSwId;x}&cn1H;CC?mvmFK)yn< zN02WALzNl>LqiJ#!!Mvv!wUw6QUeBtR|yOZRx=nF#0%!^3bX-Aw4_FOruq6ZXaU(A z46KYo49q|lBM>q$N-=;;1F{&r7^UItAVv+S8YTvY_DlvAsG2As4FVoO4AKLknHMl3 zOkBVOS1q@I8P1jkX{)=fa1BUt7I;J!Gca%qgD@k*tT_@u(;_oNB1$5BeXNr6bM+Ea z@{>~aDsl@zx)^LKtboki)RIJnirk#MVyg;UC9n!BAR8pCucQE0Qj%?}6yY17;GAES zs$i;TqGzCF$EBd4U{jQmW)z9|8>y;bpKhp8 z8yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{{zaLoK$}74+Zoz`RicPN?Xl4ZS&rlwh)=sl6OiSRWXkQSBQfcyh-;9Tp7t7zlT3-50+W(v^c7O6=it=bOtKKCa`--s3m# zq5H`s`GeaJ?NBRRq$k=Y796%XMwiFAVDpop*{7;6FsmHbQqTNhC{f(!yq~j9|U)Jwh%Iu!4%_^^VzY}Fz4ru+qG8DpJNPA;y$`EXyuf;%&(U2IpM7WCBTsYdPe zh5{AoUtbH(Iqc+Us*1SuFJMlQ;R~kcTE}7zY}C6xx#y$k3+8p}_fM!URmx|*6fR)* z)%D%s+@xs@5?5q2#SGS5wZE)bcj(_vj&=N*c{2re7q-th85!dvxP0QyNjFXvd#hAi zPtpA(Yof$m8R38986Wea=1sGckM4XR@`JO<=aq7%zr>T!lMfekOx9uFeZXQ;S^N5~ z+q_#E^Bx4=WsLJ)?$NSG_y^a1#+RWy$CY>{J%3|aHSbaw^MkzyTx!M4-z~K}e^dMI zuTQEP?fT9s!x`{>&u%KFe=RLc1Hq4>oYPn_bUwYkD8^Q!Px@ zC_4XH<4kmDwazY8ZXd?%DVhdT`ZF5+WIi{3(~|$?^5E?&bHO}b!FB+9hE}A?zTUEP&%(8?tbLr5RrmC+z$$SR^|J+G?p%SShAAgT!~G= z{@vdlF6g%$WJ;{=*l@^Y$NHit>m2G>nv~8zRmt#RK@Y{$(N?I&K;{xI2pzm@6=itut(9@ae422 zr87(~_Z@UsmUc7#xqs62ZP!J2xh^V-pZH(>X2pSHakrTl@ISfVc*E-quf5u><4%>b z?>nOJn$BysJ6(3(`D4+~m;KK+E}bFtl=YC9&HYblh3{6xcbxwArRVQY>8AW66%s$p zH=0>qch9X~e*6Vu>d8OTVdNk=DDHEu${KL3j_JHo!?KjOItMpbWiSJeH zyZpUXO@geCxPqJ^gb literal 0 HcmV?d00001 diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_live_vr.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_live_vr.png new file mode 100644 index 0000000000000000000000000000000000000000..eb18411f9f027038dbc570738cd02149bebef1d0 GIT binary patch literal 5220 zcmV-q6r1abP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAuP&PhZ;RCoc!n_H}1*Hwn+IzD!i z#;1vcZBZ`H4aJZ;6*RR}VcMz{QJ|ID5{XK+P*q$h!ctXLpf*L~p+ZQZ4N8I$N)#Hm z;vog9<{=VKL8(Zw3JvK)8i&LU%B3h!+p2Bc5XU}eFaGZzW309IiS5|A!1UgG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7YzP|!S+i&_vpUjHc1J)gZh?z=jno%=6nZ0U~IUn-=SZM zJ*1_6CRY_pV5jMd0Z;+U8M-UrPLMVC^4QAN75KC)L9(o1y)OT3FiclyVrBbUq(8Ig zX(t!fv=1!bedeFZ&2@mS>gCApZl4&tqw499>oKoM=BR#vt#t$;1Qh`Dq+{xIFF98X zz>^bv^=&bHRgl6k*v_ufe%?PmBRP`ZeYW5wsgK2H7)L*?Us(3-4rh08BBubRE1VE1 z8_<}LN)B}727Q9G?x^pIp`Tq9m92!Y(w8k?B5A|Ln5@l{Ennr#t=+NmS7-l~D4x%l z0GKzvt$nVovON!GcIr7!op^p5NlK`iIvIejdMY52K`QVy` zcGL2`XFlyEecEx>OJKFe@y~br^h>Yp`t-Ihsvz&x;sz4Ijls);&xQb6XM;f#Fzr9# zhfR^ht2J}9eg+S3%Ad7;7p`sFUrX?^HR+qfwnu;5yi=k7|NO^E2Qzuu_@#d7#bfPe zC1ID6acx|ff?3rP>IjepoiYYGc1;91m8+m}CHfPxxc4%Bd3<>9{72del=EIvgg11& z + + + + + \ 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 ff21c0fab0..2e753f40fc 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 @@ -13,24 +13,26 @@ android:layout_width="@dimen/dp_120" android:layout_height="@dimen/dp_120" android:scaleType="fitXY" - android:src="@drawable/mogo_image_daolushigong_nor" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" + app:miv_bottomLeftRadius="@dimen/dp_20" app:miv_failureHolder="@drawable/v2x_icon_live_logo" app:miv_overlayImageId="@drawable/v2x_icon_live_logo" - app:miv_placeHolder="@drawable/v2x_icon_live_logo" /> + app:miv_placeHolder="@drawable/v2x_icon_live_logo" + app:miv_topLeftRadius="@dimen/dp_20" /> + app:layout_constraintBottom_toBottomOf="@id/ivEventImg" + app:layout_constraintEnd_toEndOf="@id/ivEventImg" + app:layout_constraintStart_toStartOf="@id/ivEventImg" + app:layout_constraintTop_toTopOf="@id/ivEventImg" /> + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index e55d923cc8..0d32354e6d 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -89,8 +89,9 @@ 130px - 64px + 80px 120px + 64px 330px @@ -112,6 +113,8 @@ 940px 701px + 32px + 830px 664px From cf02246aabced8c54c79b216fc75f24a42800457 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 9 Dec 2020 16:04:30 +0800 Subject: [PATCH 04/22] =?UTF-8?q?[add]=20=E7=A6=81=E6=AD=A2=E5=81=9C?= =?UTF-8?q?=E8=BD=A6=E5=BC=B9=E6=A1=86-=E7=BC=BAicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/holder/V2XIllegalParkVH.java | 5 +-- .../mogo/module/v2x/view/HeartUnLikeView.java | 4 ++- .../v2x_event_icon_no_parking_like.png | Bin 0 -> 5167 bytes .../v2x_event_icon_no_parking_unlike.png | Bin 0 -> 5363 bytes .../res/drawable/bg_v2x_red_two_round_vr.xml | 8 +++++ .../layout/item_v2x_illegal_parking_vr.xml | 31 +++++++++++------- .../main/res/layout/view_heart_like_vr.xml | 3 +- .../main/res/layout/view_heart_unlike_vr.xml | 14 ++++++++ .../src/main/res/values-xhdpi/dimens.xml | 5 +-- 9 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_no_parking_like.png create mode 100644 modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_no_parking_unlike.png create mode 100644 modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_red_two_round_vr.xml create mode 100644 modules/mogo-module-v2x/src/main/res/layout/view_heart_unlike_vr.xml diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java index ab27796c44..b97e836e9b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java @@ -24,6 +24,7 @@ import com.mogo.utils.logger.Logger; import com.mogo.utils.network.utils.GsonUtil; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; +import static com.mogo.module.v2x.V2XConst.VR_MODE; /** * e-mail : 1358506549@qq.com @@ -47,7 +48,7 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder { public V2XIllegalParkVH(ViewGroup viewGroup) { super(LayoutInflater.from(viewGroup.getContext()) - .inflate(R.layout.item_v2x_illegal_parking, viewGroup, false)); + .inflate(VR_MODE ? R.layout.item_v2x_illegal_parking_vr : R.layout.item_v2x_illegal_parking, viewGroup, false)); mAddressTv = itemView.findViewById(R.id.tvAddress); mIllegalNumTv = itemView.findViewById(R.id.tvIllegalNum); @@ -105,7 +106,7 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder { */ @Override public void delayedCloseWindow() { - V2XHistoryScenarioData v2XHistoryScenarioData =new V2XHistoryScenarioData(); + V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData(); v2XHistoryScenarioData.setScenarioType(V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING); v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(mExploreWay)); v2XHistoryScenarioData.setEventJsonDataHashCode(mExploreWay.hashCode()); diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java index de8765c1d4..6a4e6f841c 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java @@ -13,6 +13,8 @@ import androidx.annotation.Nullable; import com.mogo.module.v2x.R; +import static com.mogo.module.v2x.V2XConst.VR_MODE; + /** * 不喜欢按钮控件 * @@ -35,7 +37,7 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi public HeartUnLikeView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); - inflate(context, R.layout.view_heart_unlike, this); + inflate(context, VR_MODE ? R.layout.view_heart_unlike_vr : R.layout.view_heart_unlike, this); mIllegalParkingUnLike = findViewById(R.id.ivIllegalParkingUnLike); setOnClickListener(v -> { diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_no_parking_like.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_no_parking_like.png new file mode 100644 index 0000000000000000000000000000000000000000..66173b2e02dd522b3b2e0d624020dea44585fb64 GIT binary patch literal 5167 zcmV+~6wvF5P)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAuPnMp)JRCocsTWgS2S5`jf+-~Rx z4FqT)5E3FoGUyP?m_jFH%#f%*qEpeROvU`LEK_Ct8+B%4IaZgB#+lNPDy?#?isi5T zkjbDpWi$zp83;@SLZC^L@C*&%(R2gd^y|`n?>TVd z=W$QR(NC~_`(L(pOrXHs-9R1~(K5#%CB=isK28cC^mz*xvJpUzupC>?RqXDgarQ#eenk=7-ZLdkXW+ z!TNP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yLYH~&i0NQ$?ULx0BJCN_hn#_BMppg?|g9d;^5VxG{r4Y;lOU^`lyso_Pl?*znDrY zsI|-tF-Q@}@Zg%4rWq%y3k$3y-Vy#TNS*|M2*16R&rgBV5j)6}W;PIV4nT1jC}IBE z86CD71r-$k|NQXqhnI)Phhb;F9Dt(&(zEBU4!phR$VnX>PNoxTw)MtF69YOOmImk@ zcO=QUWE}*IOS7?gm5%MkHRuB%A0Fe|TQZDj(1Zm#=WFGpWYw~Qc-X1n&ftw7_4W;q zj*nr(Lgw`t7`k@lt=+xHB(f6KJc}CbT#H@ng)UB07Ka5xppHkzoip4dOIvz+>OZb7 z_$VJ9YF?J`bH|A?r|0tfS;07{;<)C508Q6f2m=X z(jyI7a3kZV@o9Xr(sv1&e`9Cwk!e(h@URv%WE`cFspD>$6%263FbJ;v zc^Tx6Djcy1yM8GijpwwyQvA`zEU{VgzF^2r4H73wA_l)g4|D z*(jH7k<~jq;n7(WAdQxClvs_ObqV#x4--sH~wg z77>FW72VO>P#I5$y`14DO$iHvI&GVsL0jjPl*aXre{|j)7ySq>rs|!SKK+`B&ICE@ zjIF09OZee2zrB?xm=lbM;ZB1XA|@4+MYgSby`99ge!QhsGtW&=kuMrRX+GoSe3G0ONE*fHbhEar}BW9c&`;%{JVUMnW4P%}>4nMTK@ zTkpJNU-VNvu42o3^=8Um73%q>13+TYi2D z_a1|h@>4na-bU$Icx);ShId*NnhZPUDxi?_jFZbpT0YhB!KTr@J!NjCnN_zkrcRch z+D=>={1VprdXy!;_EaZxXhUk9H^&1rSOu<`76t_YzQC6me4ej;q&4|Z1B01A&G7m$ ze~b?=lj-So@+lg=#!?A$MPZ>rELi5aZG5Z*ys_pBOuobW`#*oCzkascr+nrC2uB#^9 literal 0 HcmV?d00001 diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_no_parking_unlike.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_no_parking_unlike.png new file mode 100644 index 0000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B*x&gPPl4gK7z>B;G znsZqOV43#e{oYTnx8a$sJ~exN-VN*g@YsEOyU>Kq0oEqv3Xx2=rIJf~G2e;nrBNHE z$@)Pp@@@&J%ee75S={9CI{*5w;y+C}i(yj|{`IT)Z*%zk6m~SKxoR4tZclLP0Oe-@ zDV-HYJGbE(V2b$b9!-n5j!p_eRJ9IK|JDAtIh|b3{Pvcgp911Da7ykwTnW5I390Lh z22pp}I=A%Kev>nCI* dd&|9u>Lpl!KVD)US)6oTsGUy4=k7Dr?vwZFFh5HCd+UI zo|OYxG4*xVS3RB?e)Q8xbkjqkT;R(LKF|A)w5ixFRJ@sQVe~jdzVpi3`BBx#Qu!3E z#4phNC6Eo$t- + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking_vr.xml index 4079e7009c..837cf017c1 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking_vr.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking_vr.xml @@ -4,21 +4,28 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rlContent" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/dp_120" android:background="@drawable/v2x_bg_pop_up" - android:paddingStart="@dimen/dp_62" - android:paddingTop="@dimen/dp_42" - android:paddingEnd="@dimen/dp_62" - android:paddingBottom="@dimen/dp_42"> + android:paddingEnd="@dimen/dp_62"> + + + app:layout_constraintBottom_toBottomOf="@+id/leftImageView" + app:layout_constraintStart_toStartOf="@+id/leftImageView" + app:layout_constraintTop_toTopOf="@+id/leftImageView" + app:layout_constraintEnd_toEndOf="@+id/leftImageView"/> + app:layout_constraintStart_toEndOf="@+id/leftImageView" + app:layout_constraintTop_toTopOf="parent" /> + android:src="@drawable/v2x_event_icon_no_parking_like" /> \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/view_heart_unlike_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/view_heart_unlike_vr.xml new file mode 100644 index 0000000000..ebbdd0b852 --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/layout/view_heart_unlike_vr.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index 0d32354e6d..177dd99d41 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -9,10 +9,7 @@ 410px 670px - 147px - - 60px 40px @@ -92,6 +89,7 @@ 80px 120px 64px + 60px 330px @@ -112,7 +110,6 @@ 940px 940px 701px - 32px From bdd1a2c2bf97496e0807c6a1db3a2df3a59f1ff0 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 9 Dec 2020 16:39:14 +0800 Subject: [PATCH 05/22] =?UTF-8?q?[add]=20=E6=8E=A5=E6=94=B6=E4=BB=96?= =?UTF-8?q?=E4=BA=BA=E6=B1=82=E5=8A=A9=E5=BC=B9=E6=A1=86-=E7=BC=BA?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E5=88=B0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/module/v2x/V2XConst.java | 2 +- .../v2x/adapter/holder/V2XOtherSeekHelpVH.java | 2 +- .../drawable-xhdpi/v2x_event_icon_talk_vr.png | Bin 0 -> 5368 bytes .../main/res/drawable/selector_talk_btn_vr.xml | 6 ++++++ .../main/res/layout/item_v2x_fault_help_vr.xml | 8 ++++---- 5 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_talk_vr.png create mode 100644 modules/mogo-module-v2x/src/main/res/drawable/selector_talk_btn_vr.xml 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 f5fbe75e3a..360803731d 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 @@ -137,5 +137,5 @@ public class V2XConst { /* * VR模式 * */ - public static final boolean VR_MODE = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode(); + public static final boolean VR_MODE = true; } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java index fbc74ab555..977334632f 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java @@ -72,7 +72,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder { public V2XOtherSeekHelpVH(ViewGroup viewGroup) { super(LayoutInflater.from(viewGroup.getContext()) - .inflate(R.layout.item_v2x_fault_help, viewGroup, false)); + .inflate(VR_MODE ? R.layout.item_v2x_fault_help_vr : R.layout.item_v2x_fault_help, viewGroup, false)); ivHead = itemView.findViewById(R.id.ivFaultHelpHead); tvName = itemView.findViewById(R.id.tvFaultHelpName); tvDistance = itemView.findViewById(R.id.tvFaultHelpDistance); diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_talk_vr.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/v2x_event_icon_talk_vr.png new file mode 100644 index 0000000000000000000000000000000000000000..5b1a5378b1eac748bc52315da56b0ef5fe9b943e GIT binary patch literal 5368 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z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mtK9lce04qaDgX8OWVrud@%{%3 WiXPlL(Fm~s0000 + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml index d4d94d03f4..ed01bd0d88 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml @@ -92,8 +92,8 @@ Date: Wed, 9 Dec 2020 16:39:32 +0800 Subject: [PATCH 06/22] no message --- .../src/main/java/com/mogo/module/v2x/V2XConst.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 360803731d..f5fbe75e3a 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 @@ -137,5 +137,5 @@ public class V2XConst { /* * VR模式 * */ - public static final boolean VR_MODE = true; + public static final boolean VR_MODE = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode(); } From ff507d9f6d505865397933495beeada929ce5712 Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 9 Dec 2020 17:03:36 +0800 Subject: [PATCH 07/22] =?UTF-8?q?[add]=20=E8=A7=86=E9=A2=91=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E5=99=A8vr=E6=A8=A1=E5=BC=8FUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/module/v2x/V2XConst.java | 2 +- .../scene/road/V2XRoadVideoWindow.java | 3 +- .../layout/window_road_video_layout_vr.xml | 53 +++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/layout/window_road_video_layout_vr.xml 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 f5fbe75e3a..360803731d 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 @@ -137,5 +137,5 @@ public class V2XConst { /* * VR模式 * */ - public static final boolean VR_MODE = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode(); + public static final boolean VR_MODE = true; } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java index 58d4bc587e..d8039b2c5a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadVideoWindow.java @@ -26,6 +26,7 @@ import com.shuyu.gsyvideoplayer.video.base.GSYVideoView; import java.util.ArrayList; +import static com.mogo.module.v2x.V2XConst.VR_MODE; import static com.shuyu.gsyvideoplayer.utils.GSYVideoType.SCREEN_MATCH_FULL; /** @@ -68,7 +69,7 @@ public class V2XRoadVideoWindow extends RelativeLayout implements } private void initView(Context context) { - LayoutInflater.from(mContext).inflate(R.layout.window_road_video_layout, this); + LayoutInflater.from(mContext).inflate(VR_MODE ? R.layout.window_road_video_layout_vr : R.layout.window_road_video_layout, this); playImageView = this.findViewById(R.id.window_video_play); thumbnailImage = this.findViewById(R.id.thumbnail_image); simpleCoverVideoPlayer = this.findViewById(R.id.roadVideoView); diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_road_video_layout_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/window_road_video_layout_vr.xml new file mode 100644 index 0000000000..d502ef6947 --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/layout/window_road_video_layout_vr.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + From 8013ff1d48f49ac28017552014da4e7d7ece71fc Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 9 Dec 2020 17:08:07 +0800 Subject: [PATCH 08/22] no message --- .../src/main/java/com/mogo/module/v2x/V2XConst.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 360803731d..f5fbe75e3a 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 @@ -137,5 +137,5 @@ public class V2XConst { /* * VR模式 * */ - public static final boolean VR_MODE = true; + public static final boolean VR_MODE = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode(); } From de86548ce981e8ac1087bf0d10bc3f0546d272d9 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Wed, 9 Dec 2020 20:07:45 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B4=E4=BD=93?= =?UTF-8?q?=E5=B8=83=E5=B1=80=EF=BC=8C=E5=A2=9E=E5=8A=A0vr=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=95=8C=E9=9D=A2=E8=B0=83=E8=AF=95=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../main/launcher/MainLauncherActivity.java | 17 ++- .../src/main/res/values/dimens.xml | 2 +- .../extensions/entrance/EntranceFragment.java | 33 ++++- .../extensions/navi/BaseNaviInfoView.java | 7 +- .../module/extensions/navi/NaviInfoView.java | 5 +- .../extensions/navi/VrModeNavInfoView.java | 25 ++++ .../extensions/utils/TopViewAnimHelper.java | 14 ++ .../utils/TopViewNoLinkageAnimHelper.java | 15 +++ .../res/layout/module_ext_layout_entrance.xml | 3 +- .../src/main/res/values/dimens.xml | 2 + upload.sh | 121 ++---------------- 12 files changed, 116 insertions(+), 130 deletions(-) create mode 100644 modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/navi/VrModeNavInfoView.java diff --git a/gradle.properties b/gradle.properties index 1038e7642b..24262a25ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -59,7 +59,7 @@ MAP_AUTONAVI_VERSION=2.0.7 MOGO_MAP_VERSION=2.0.7 MOGO_MAP_API_VERSION=2.0.7 MOGO_SERVICE_VERSION=2.0.7 -MOGO_SERVICE_API_VERSION=2.0.7 +MOGO_SERVICE_API_VERSION=2.0.8 MOGO_CONNECTION_VERSION=2.0.7 MOGO_MODULE_APPS_VERSION=2.0.7 MOGO_MODULE_NAVI_VERSION=2.0.7 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 1cc07beaa2..5582493834 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 @@ -11,6 +11,7 @@ import androidx.annotation.Nullable; import com.mogo.commons.debug.DebugConfig; import com.mogo.map.uicontroller.EnumMapUI; +import com.mogo.module.common.MogoApisHandler; import com.mogo.module.main.MainActivity; import com.mogo.module.main.cards.MogoModulesManager; import com.mogo.service.intent.IMogoIntentListener; @@ -38,7 +39,11 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis protected void loadContainerModules() { super.loadContainerModules(); // 显示左边遮罩 - mLeftShadowFrame.setVisibility( View.VISIBLE ); + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + mLeftShadowFrame.setVisibility(View.GONE); + }else { + mLeftShadowFrame.setVisibility(View.VISIBLE); + } MogoModulesManager.getInstance().loadAppsListModule( com.mogo.module.main.R.id.module_main_id_apps_fragment_container ); } @@ -120,14 +125,16 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis @Override public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) { + FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() ); if (isTrue) { - FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() ); entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode ); - mEntrance.setLayoutParams( entranceParams ); + mLeftShadowFrame.setVisibility(View.GONE); + mApps.setVisibility(View.GONE); }else{ - FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() ); entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft_out_vr_mode ); - mEntrance.setLayoutParams( entranceParams ); + mLeftShadowFrame.setVisibility(View.VISIBLE); + mApps.setVisibility(View.VISIBLE); } + mEntrance.setLayoutParams( entranceParams ); } } diff --git a/main-extensions/mogo-module-main-launcher/src/main/res/values/dimens.xml b/main-extensions/mogo-module-main-launcher/src/main/res/values/dimens.xml index 79e190ca2d..25247f638b 100644 --- a/main-extensions/mogo-module-main-launcher/src/main/res/values/dimens.xml +++ b/main-extensions/mogo-module-main-launcher/src/main/res/values/dimens.xml @@ -1,5 +1,5 @@ - 204px + 0px 800px \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index d9b038ca59..f988ed34db 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -48,7 +48,9 @@ import com.mogo.module.common.map.Scene; import com.mogo.module.common.view.OnPreventFastClickListener; import com.mogo.module.extensions.ExtensionsModuleConst; import com.mogo.module.extensions.R; +import com.mogo.module.extensions.navi.BaseNaviInfoView; import com.mogo.module.extensions.navi.NaviInfoView; +import com.mogo.module.extensions.navi.VrModeNavInfoView; import com.mogo.module.extensions.userinfo.UserInfo; import com.mogo.module.extensions.utils.AdasNoticeHelper; import com.mogo.module.extensions.utils.EntranceViewHolder; @@ -120,7 +122,7 @@ public class EntranceFragment extends MvpFragment{ // 进入vr模式 enterVrMode(); - mApis.getMapFrameControllerApi().changeToVRMode(); + mApis.getStatusManagerApi().setVrMode(TAG, true); +// mApis.getMapFrameControllerApi().changeToVRMode(); }); tvExitVrMode = findViewById(R.id.module_ext_exit_vr_mode); tvExitVrMode.setOnClickListener((v)->{ // 退出vr模式 exitVrMode(); - mApis.getMapFrameControllerApi().changeTo2dMode(); + mApis.getStatusManagerApi().setVrMode(TAG, false); +// mApis.getMapFrameControllerApi().changeTo2dMode(); }); dealWeatherContainer(); @@ -493,8 +496,12 @@ public class EntranceFragment extends MvpFragment @@ -248,6 +246,7 @@ android:textSize="@dimen/module_ext_exit_vr_mode_text_size" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toTopOf="parent" app:layout_constraintRight_toRightOf="parent" /> 1058px + 760px + 700px 544px 117px 80px diff --git a/upload.sh b/upload.sh index 17478021a0..c835c8bc98 100755 --- a/upload.sh +++ b/upload.sh @@ -1,112 +1,11 @@ -!/bin/bash +#!/bin/bash -./gradlew :foudations:mogo-utils:clean :foudations:mogo-utils:uploadArchives -if [ $? -ne 0 ];then exit; fi -./gradlew :skin:mogo-skin-support:clean :skin:mogo-skin-support:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :tts:tts-base:clean :tts:tts-base:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :foudations:mogo-commons:clean :foudations:mogo-commons:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :tts:tts-zhi:clean :tts:tts-zhi:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :tts:tts-di:clean :tts:tts-di:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :tts:tts-noop:clean :tts:tts-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :libraries:mogo-map-api:clean :libraries:mogo-map-api:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:skin-support:clean :skin:skin-support:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:skin-support-appcompat:clean :skin:skin-support-appcompat:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:skin-support-cardview:clean :skin:skin-support-cardview:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:skin-support-constraint-layout:clean :skin:skin-support-constraint-layout:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:skin-support-design:clean :skin:skin-support-design:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :services:mogo-service-api:clean :services:mogo-service-api:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :libraries:map-amap:clean :libraries:map-amap:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :libraries:map-autonavi:clean :libraries:map-autonavi:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :libraries:mogo-map:clean :libraries:mogo-map:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-common:clean :modules:mogo-module-common:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:mogo-skin-support-impl:clean :skin:mogo-skin-support-impl:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:mogo-skin-support-noop:clean :skin:mogo-skin-support-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :test:crashreport:clean :test:crashreport:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :test:crashreport-bugly:clean :test:crashreport-bugly:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :test:crashreport-noop:clean :test:crashreport-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :skin:mogo-skin-light:clean :skin:mogo-skin-light:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :services:mogo-service:clean :services:mogo-service:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-obu:clean :modules:mogo-module-obu:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-map:clean :modules:mogo-module-map:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-apps:clean :modules:mogo-module-apps:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-gps-simulator:clean :modules:mogo-module-gps-simulator:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-gps-simulator-debug:clean :modules:mogo-module-gps-simulator-debug:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-gps-simulator-noop:clean :modules:mogo-module-gps-simulator-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-service:clean :modules:mogo-module-service:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-authorize:clean :modules:mogo-module-authorize:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-share:clean :modules:mogo-module-share:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-extensions:clean :modules:mogo-module-extensions:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-search:clean :modules:mogo-module-search:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-media:clean :modules:mogo-module-media:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-v2x:clean :modules:mogo-module-v2x:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-back:clean :modules:mogo-module-back:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-guide:clean :modules:mogo-module-guide:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :main-extensions:mogo-module-main-independent:clean :main-extensions:mogo-module-main-independent:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :main-extensions:mogo-module-main-launcher:clean :main-extensions:mogo-module-main-launcher:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-left-panel:clean :modules:mogo-module-left-panel:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-left-panel-noop:clean :modules:mogo-module-left-panel-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :foudations:mogo-base-services-apk:clean :foudations:mogo-base-services-apk:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :foudations:mogo-base-services-sdk:clean :foudations:mogo-base-services-sdk:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-push-base:clean :modules:mogo-module-push-base:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-push-noop:clean :modules:mogo-module-push-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-push:clean :modules:mogo-module-push:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :libraries:tanlulib:clean :libraries:tanlulib:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-monitor:clean :modules:mogo-module-monitor:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-splash:clean :modules:mogo-module-splash:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-splash-noop:clean :modules:mogo-module-splash-noop:uploadArchives -if [ $? -ne 0 ]; then exit; fi -./gradlew :modules:mogo-module-widgets:clean :modules:mogo-module-widgets:uploadArchives -if [ $? -ne 0 ]; then exit; fi \ No newline at end of file +function upload(){ + ./gradlew $1:clean $1:uploadArchives + if [ $? -ne 0 ];then exit; fi +} + +for module in `cat modules.txt`; +do + upload $module +done \ No newline at end of file From 0ef4820e09de19361f8a5c0dcb60b9950ad40616 Mon Sep 17 00:00:00 2001 From: liujing Date: Thu, 10 Dec 2020 13:43:40 +0800 Subject: [PATCH 10/22] =?UTF-8?q?[=E4=BA=8B=E4=BB=B6=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=B7=A6=E4=BE=A7=E5=9C=86=E8=A7=92=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/V2XShareEventAdapter.java | 2 +- .../v2x/adapter/holder/V2XRoadEventVH.java | 12 ++++++-- .../mogo/module/v2x/utils/EventTypeUtils.java | 30 +++++++++++++++++++ .../res/layout/item_v2x_event_detail_vr.xml | 1 - .../res/layout/item_v2x_fault_help_vr.xml | 1 + 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java index 6828c691cf..665b08f9f5 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java @@ -107,7 +107,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter { private static final String TAG = "V2XRoadEventVH"; + private Context mContext; private MogoImageView ivEventImg; private MogoImageView ivReportHead; private ImageView ivEventPlay; @@ -144,6 +151,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail_vr, viewGroup, false) : LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false) ); + mContext = viewGroup.getContext(); init(itemView); // 设置视图状态监听 itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @@ -206,8 +214,8 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { imgUrl = mNoveltyInfo.getItems().get(0).getUrl(); } if (!TextUtils.isEmpty(imgUrl)) { - V2XServiceManager.getImageLoader() - .displayImage(imgUrl, ivEventImg); + Glide.with(mContext).load(imgUrl).apply(RequestOptions.bitmapTransform( + new GlideRoundedCornersTransform(20, GlideRoundedCornersTransform.CornerType.LEFT))).into(ivEventImg); } if (url.contains(".mp4")) { ivEventImg.setOnClickListener(v -> { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java index 5df0729f44..bb1d51fefc 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/EventTypeUtils.java @@ -121,6 +121,36 @@ public class EventTypeUtils { return strBg; } + /* + * VR模式下道路类型影响到分享列表 (VR模式暂时没有事件面板,所以可以删除此方法,公用上边的getPoiTypeBg) + * */ + public static int getPoiTypeBgForShareItem(String poiType) { + int strBg; + switch (poiType) { + case V2XPoiTypeEnum.FOURS_PARKING: // 停车场 + case V2XPoiTypeEnum.GAS_STATION: // 加油站 + strBg = R.drawable.bg_v2x_event_type_blue; + break; + case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵 + case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况 + case V2XPoiTypeEnum.FOURS_NEALY: // 身边 + strBg = R.drawable.bg_v2x_event_type_orange; + break; + case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查 + case V2XPoiTypeEnum.ROAD_CLOSED:// 封路 + case V2XPoiTypeEnum.FOURS_ROAD_WORK:// 施工 + case V2XPoiTypeEnum.FOURS_PONDING:// 积水 + case V2XPoiTypeEnum.FOURS_FOG: // 浓雾 + case V2XPoiTypeEnum.FOURS_ICE: // 结冰 + case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故 + strBg = R.drawable.bg_v2x_event_type_read; + break; + default: + strBg = R.drawable.bg_v2x_event_type_read; + break; + } + return strBg; + } /** * 判断是否是道路预警事件 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 2e753f40fc..79822a5547 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 @@ -16,7 +16,6 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:miv_bottomLeftRadius="@dimen/dp_20" app:miv_failureHolder="@drawable/v2x_icon_live_logo" app:miv_overlayImageId="@drawable/v2x_icon_live_logo" app:miv_placeHolder="@drawable/v2x_icon_live_logo" diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml index ed01bd0d88..f11eb95ea2 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml @@ -107,6 +107,7 @@ android:layout_width="@dimen/module_v2x_event_button_size_vr" android:layout_height="@dimen/module_v2x_event_button_size_vr" android:src="@drawable/selector_nav_btn" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> From e59b89164ac6e82671d02548a120ea276c5e5438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 10 Dec 2020 14:13:49 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=B0=8F?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 2 + .../com/mogo/launcher/MogoApplication.java | 4 ++ config.gradle | 1 + gradle.properties | 1 + modules/mogo-module-smp/build.gradle | 51 ++++++++++++++----- modules/mogo-module-smp/gradle.properties | 3 ++ .../small/map/IMogoSmallMapProvider.java | 12 +++++ .../module/small/map/SmallMapService.java | 8 +++ .../mogo/module/small/map/SmallMapView.java | 8 +++ .../module/small/map/SmallMapViewHandler.java | 8 +++ .../module/small/map/SmallVisionProvider.java | 46 +++++++++++++++++ 11 files changed, 130 insertions(+), 14 deletions(-) create mode 100644 modules/mogo-module-smp/gradle.properties create mode 100644 modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/IMogoSmallMapProvider.java create mode 100644 modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java create mode 100644 modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java create mode 100644 modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapViewHandler.java create mode 100644 modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java diff --git a/app/build.gradle b/app/build.gradle index 31b58785e9..c64a06899f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -435,6 +435,7 @@ dependencies { implementation rootProject.ext.dependencies.guideshow implementation rootProject.ext.dependencies.moduleextensions implementation rootProject.ext.dependencies.modulemap + implementation rootProject.ext.dependencies.moduleSmallMap } else { implementation project(':foudations:mogo-commons') implementation project(':foudations:mogo-base-websocket-sdk') @@ -451,6 +452,7 @@ dependencies { implementation project(':modules:mogo-module-monitor') implementation project(':modules:mogo-module-extensions') implementation project(':modules:mogo-module-map') + implementation project(':modules:mogo-module-smp') } apply from: "./functions/perform.gradle" diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 46338739f7..9fb370170f 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -22,6 +22,7 @@ import com.mogo.module.main.service.MogoMainService; import com.mogo.module.push.base.PushUIConstants; import com.mogo.module.service.ServiceConst; import com.mogo.module.share.constant.ShareConstants; +import com.mogo.module.small.map.IMogoSmallMapProvider; import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.utils.ObuConfig; import com.mogo.service.IMogoServiceApis; @@ -99,6 +100,9 @@ public class MogoApplication extends AbsMogoApplication { MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_CRASH_WARNING, "CrashWarning" ) ); // MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) ); + // 小地图模块 + MogoModulePaths.addModule( new MogoModule( IMogoSmallMapProvider.path, "IMogoSmallMapProvider" ) ); + MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake" ) ); if ( !DebugConfig.isLauncher() ) { diff --git a/config.gradle b/config.gradle index 690687840b..9d98d9bb95 100644 --- a/config.gradle +++ b/config.gradle @@ -111,6 +111,7 @@ ext { guideshow : "com.mogo.module:module-guide:${MOGO_MODULE_GUIDESHOW_VERSION}", // V2X moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}", + moduleSmallMap : "com.mogo.module:module-small-map:${MOGO_MODULES_SMALL_MAP}", modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}", modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}", // push diff --git a/gradle.properties b/gradle.properties index 24262a25ef..62574eec69 100644 --- a/gradle.properties +++ b/gradle.properties @@ -130,6 +130,7 @@ TTS_NOOP_VERSION=2.0.7 # 自研地图 MAP_CUSTOM_VERSION=1.2.1.9 MOGO_MODULES_MVISION_VERSION=1.0.0 +MOGO_MODULES_SMALL_MAP=1.0.0 # httpdns HTTPDNS_TENCENT_VERSION = 1.0.0 HTTPDNS_BASE_VERSION = 1.0.0 diff --git a/modules/mogo-module-smp/build.gradle b/modules/mogo-module-smp/build.gradle index f5abda057a..e3a46f8dd8 100644 --- a/modules/mogo-module-smp/build.gradle +++ b/modules/mogo-module-smp/build.gradle @@ -1,19 +1,23 @@ -plugins { - id 'com.android.library' -} +apply plugin: 'com.android.library' +apply plugin: 'com.alibaba.arouter' android { - compileSdkVersion 29 - buildToolsVersion "29.0.3" - + compileSdkVersion rootProject.ext.android.compileSdkVersion + // buildToolsVersion rootProject.ext.android.buildToolsVersion defaultConfig { - minSdkVersion 19 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" + minSdkVersion rootProject.ext.android.minSdkVersion + targetSdkVersion rootProject.ext.android.targetSdkVersion + versionCode Integer.valueOf(VERSION_CODE) + versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") + + javaCompileOptions { + annotationProcessorOptions { + arguments = [AROUTER_MODULE_NAME: project.getName()] + } + } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" + consumerProguardFiles 'consumer-rules.pro' } buildTypes { @@ -22,6 +26,7 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -30,7 +35,25 @@ android { dependencies { - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.2.1' + implementation rootProject.ext.dependencies.androidxappcompat + implementation rootProject.ext.dependencies.androidxconstraintlayout + implementation rootProject.ext.dependencies.arouter + annotationProcessor rootProject.ext.dependencies.aroutercompiler + if (Boolean.valueOf(RELEASE)) { + api rootProject.ext.dependencies.mogomap + api rootProject.ext.dependencies.mogomapapi + api rootProject.ext.dependencies.mogoutils + api rootProject.ext.dependencies.mogocommons + api rootProject.ext.dependencies.mogoserviceapi + implementation rootProject.ext.dependencies.modulecommon + } else { + api project(":libraries:mogo-map") + api project(":libraries:mogo-map-api") + api project(":foudations:mogo-utils") + api project(":foudations:mogo-commons") + api project(':services:mogo-service-api') + implementation project(':modules:mogo-module-common') + } +} -} \ No newline at end of file +apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() \ No newline at end of file diff --git a/modules/mogo-module-smp/gradle.properties b/modules/mogo-module-smp/gradle.properties new file mode 100644 index 0000000000..61d3012ece --- /dev/null +++ b/modules/mogo-module-smp/gradle.properties @@ -0,0 +1,3 @@ +GROUP=com.mogo.module +POM_ARTIFACT_ID=module-small-map +VERSION_CODE=1 diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/IMogoSmallMapProvider.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/IMogoSmallMapProvider.java new file mode 100644 index 0000000000..cb8cb65fe0 --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/IMogoSmallMapProvider.java @@ -0,0 +1,12 @@ +package com.mogo.module.small.map; + +import com.mogo.service.module.IMogoModuleProvider; + +/** + * @author donghongyu + * @date 12/10/20 1:36 PM + */ +public interface IMogoSmallMapProvider extends IMogoModuleProvider { + String path = "/small_map/api"; + +} diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java new file mode 100644 index 0000000000..9b67f23665 --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java @@ -0,0 +1,8 @@ +package com.mogo.module.small.map; + +/** + * @author donghongyu + * @date 12/10/20 1:35 PM + */ +public class SmallMapService { +} diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java new file mode 100644 index 0000000000..0ab902870b --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java @@ -0,0 +1,8 @@ +package com.mogo.module.small.map; + +/** + * @author donghongyu + * @date 12/10/20 1:35 PM + */ +public class SmallMapView { +} diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapViewHandler.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapViewHandler.java new file mode 100644 index 0000000000..93e841b09a --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapViewHandler.java @@ -0,0 +1,8 @@ +package com.mogo.module.small.map; + +/** + * @author donghongyu + * @date 12/10/20 1:35 PM + */ +public class SmallMapViewHandler { +} 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 new file mode 100644 index 0000000000..90969b6462 --- /dev/null +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallVisionProvider.java @@ -0,0 +1,46 @@ +package com.mogo.module.small.map; + +import android.content.Context; +import android.os.Bundle; +import android.util.Log; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.alibaba.android.arouter.facade.annotation.Route; + +/** + * @author donghongyu + * @date 12/10/20 1:34 PM + */ +@Route(path = IMogoSmallMapProvider.path) +public class SmallVisionProvider implements IMogoSmallMapProvider { + private static final String TAG = "SmallVisionProvider"; + + @Override + public Fragment createFragment(Context context, Bundle data) { + return null; + } + + @Override + public View createView(Context context) { + return null; + } + + @NonNull + @Override + public String getModuleName() { + return null; + } + + @Override + public int getType() { + return 0; + } + + @Override + public void init(Context context) { + Log.d(TAG, "小地图模块初始化……"); + } +} From 1d4fcc3a6e23f54daec5697ab41011381ac05640 Mon Sep 17 00:00:00 2001 From: liujing Date: Thu, 10 Dec 2020 16:04:34 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E6=8E=A5=E6=94=B6=E6=B1=82=E5=8A=A9?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E5=A4=B4=E5=83=8F=E5=B7=A6=E4=BE=A7=E5=9C=86?= =?UTF-8?q?=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/holder/V2XOtherSeekHelpVH.java | 15 +++++++++++++-- .../module/v2x/adapter/holder/V2XRoadEventVH.java | 9 +++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java index 977334632f..e866a3038a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XOtherSeekHelpVH.java @@ -1,5 +1,6 @@ package com.mogo.module.v2x.adapter.holder; +import android.content.Context; import android.content.res.Resources; import android.text.TextUtils; import android.view.LayoutInflater; @@ -8,6 +9,8 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; import com.mogo.commons.debug.DebugConfig; import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.entity.MarkerExploreWay; @@ -25,6 +28,7 @@ import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceConstants; import com.mogo.module.v2x.voice.V2XVoiceManager; import com.mogo.service.imageloader.MogoImageView; +import com.mogo.utils.glide.GlideRoundedCornersTransform; import java.text.SimpleDateFormat; import java.util.Date; @@ -44,6 +48,7 @@ import static com.mogo.module.v2x.V2XConst.VR_MODE; */ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder { + private Context mContext; private MogoImageView ivHead; private TextView tvName; private TextView tvDistance; @@ -73,6 +78,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder { public V2XOtherSeekHelpVH(ViewGroup viewGroup) { super(LayoutInflater.from(viewGroup.getContext()) .inflate(VR_MODE ? R.layout.item_v2x_fault_help_vr : R.layout.item_v2x_fault_help, viewGroup, false)); + mContext = viewGroup.getContext(); ivHead = itemView.findViewById(R.id.ivFaultHelpHead); tvName = itemView.findViewById(R.id.tvFaultHelpName); tvDistance = itemView.findViewById(R.id.tvFaultHelpDistance); @@ -179,8 +185,13 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder { } try { if (!TextUtils.isEmpty(mV2XPushMessageEntity.getHeadImgUrl())) { - V2XServiceManager.getImageLoader() - .displayImage(mV2XPushMessageEntity.getHeadImgUrl(), ivHead); + if (VR_MODE) { + Glide.with(mContext).load(mV2XPushMessageEntity.getHeadImgUrl()).apply(RequestOptions.bitmapTransform( + new GlideRoundedCornersTransform(20, GlideRoundedCornersTransform.CornerType.LEFT))).into(ivHead); + } else { + V2XServiceManager.getImageLoader() + .displayImage(mV2XPushMessageEntity.getHeadImgUrl(), ivHead); + } } tvName.setText(mV2XPushMessageEntity.getDisplayName()); 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 10fcb421db..c159852853 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 @@ -214,8 +214,13 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { imgUrl = mNoveltyInfo.getItems().get(0).getUrl(); } if (!TextUtils.isEmpty(imgUrl)) { - Glide.with(mContext).load(imgUrl).apply(RequestOptions.bitmapTransform( - new GlideRoundedCornersTransform(20, GlideRoundedCornersTransform.CornerType.LEFT))).into(ivEventImg); + if (VR_MODE) { + Glide.with(mContext).load(imgUrl).apply(RequestOptions.bitmapTransform( + new GlideRoundedCornersTransform(20, GlideRoundedCornersTransform.CornerType.LEFT))).into(ivEventImg); + } else { + V2XServiceManager.getImageLoader() + .displayImage(imgUrl, ivEventImg); + } } if (url.contains(".mp4")) { ivEventImg.setOnClickListener(v -> { From bd28bd10162fec9128c6c72122f22228d30afe67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 10 Dec 2020 16:21:17 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=B0=8F?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/AndroidManifest.xml | 6 ++ .../module/small/map/SmallMapService.java | 73 ++++++++++++++++++- .../mogo/module/small/map/SmallMapView.java | 41 ++++++++++- .../module/small/map/SmallVisionProvider.java | 14 +++- 4 files changed, 129 insertions(+), 5 deletions(-) diff --git a/modules/mogo-module-smp/src/main/AndroidManifest.xml b/modules/mogo-module-smp/src/main/AndroidManifest.xml index 3f004d131a..649a2f531a 100644 --- a/modules/mogo-module-smp/src/main/AndroidManifest.xml +++ b/modules/mogo-module-smp/src/main/AndroidManifest.xml @@ -2,4 +2,10 @@ + + + \ No newline at end of file diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java index 9b67f23665..686397704f 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java @@ -1,8 +1,79 @@ package com.mogo.module.small.map; +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +import android.os.RemoteException; + +import androidx.annotation.Nullable; + +import com.mogo.module.common.entity.MogoSnapshotSetData; +import com.mogo.module.common.machinevision.IMachineVisionInterface; +import com.mogo.module.common.wm.WindowManagerView; +import com.mogo.utils.logger.Logger; + /** * @author donghongyu * @date 12/10/20 1:35 PM */ -public class SmallMapService { +public class SmallMapService extends Service { + private static final String TAG = "MachineVisionMapService"; + private IBinder mBinder; + private WindowManagerView mMachineVisionMapViewManager; + private SmallMapView mMapView; + + + @Nullable + @Override + public IBinder onBind(Intent intent) { + mBinder = new SmallMapServiceBinder(); + addMachineVisionMapView(); + Logger.d(TAG, "onBind"); + return mBinder; + } + + @Override + public void onRebind(Intent intent) { + super.onRebind(intent); + addMachineVisionMapView(); + Logger.d(TAG, "onRebind"); + } + + @Override + public boolean onUnbind(Intent intent) { + + return true; + } + + @Override + public void onDestroy() { + super.onDestroy(); + + } + + private void addMachineVisionMapView() { + + } + + + /** + * 小地图与大地图之间进程通讯 + */ + public class SmallMapServiceBinder extends IMachineVisionInterface.Stub { + + @Override + public void postData(MogoSnapshotSetData data) throws RemoteException { + + } + + @Override + public void hideViewIfExist() throws RemoteException { + + } + + @Override + public void showViewIfExist() throws RemoteException { + + } + } } diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java index 0ab902870b..c746db0896 100644 --- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java +++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java @@ -1,8 +1,47 @@ package com.mogo.module.small.map; +import android.content.Context; +import android.util.AttributeSet; +import android.util.Log; + +import androidx.annotation.Nullable; + +import com.mogo.map.MogoBaseMapView; + /** * @author donghongyu * @date 12/10/20 1:35 PM */ -public class SmallMapView { +public class SmallMapView extends MogoBaseMapView { + private final String TAG = "SmallMapView"; + + public SmallMapView(Context context) { + this(context, null); + } + + public SmallMapView(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public SmallMapView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + protected void addDleMaps() { + Log.d(TAG, "addDleMaps……"); + + } + + @Override + public void display2DMap(boolean invokeCreateAuto, boolean invokeResumeAuto) { + Log.d(TAG, "display2DMap……"); + + } + + @Override + public void displayVRMap(boolean invokeCreateAuto, boolean invokeResumeAuto) { + Log.d(TAG, "displayVRMap……"); + + } } 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 90969b6462..d6ee7e537b 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 @@ -9,6 +9,7 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.service.module.ModuleType; /** * @author donghongyu @@ -16,7 +17,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; */ @Route(path = IMogoSmallMapProvider.path) public class SmallVisionProvider implements IMogoSmallMapProvider { - private static final String TAG = "SmallVisionProvider"; + private final String TAG = "SmallVisionProvider"; @Override public Fragment createFragment(Context context, Bundle data) { @@ -31,16 +32,23 @@ public class SmallVisionProvider implements IMogoSmallMapProvider { @NonNull @Override public String getModuleName() { - return null; + return TAG; } @Override public int getType() { - return 0; + return ModuleType.TYPE_SERVICE; } @Override public void init(Context context) { Log.d(TAG, "小地图模块初始化……"); + + } + + @Override + public void onDestroy() { + Log.d(TAG, "小地图模块销毁……"); + } } From 0cc76358f0920c78fabab5e2557afe6ca627615f Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 10 Dec 2020 17:34:55 +0800 Subject: [PATCH 14/22] modify music --- .../common/entity/MogoSnapshotSetData.java | 3 + .../media/widget/PercentageRingView.java | 165 ++++++++ .../module/media/window/MediaWindow2.java | 374 ++++++++++++------ ...le_media_music_window_alert_layout_new.xml | 44 +++ .../src/main/res/values-xhdpi/dimens.xml | 8 +- .../src/main/res/values/attrs.xml | 8 + .../src/main/res/values/colors.xml | 2 + .../src/main/res/values/dimens.xml | 6 + 8 files changed, 491 insertions(+), 119 deletions(-) create mode 100755 modules/mogo-module-media/src/main/java/com/mogo/module/media/widget/PercentageRingView.java create mode 100644 modules/mogo-module-media/src/main/res/layout/module_media_music_window_alert_layout_new.xml diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MogoSnapshotSetData.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MogoSnapshotSetData.java index 225b38d90c..e0c65c2ff9 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MogoSnapshotSetData.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MogoSnapshotSetData.java @@ -30,6 +30,9 @@ class MogoSnapshotSetData implements Parcelable { //红绿灯 private CloudRoadData trafficLight; + //路边摄像头 + private CloudRoadData camera; + // 自车速度 本地添加 public double curSpeed = 0.0; diff --git a/modules/mogo-module-media/src/main/java/com/mogo/module/media/widget/PercentageRingView.java b/modules/mogo-module-media/src/main/java/com/mogo/module/media/widget/PercentageRingView.java new file mode 100755 index 0000000000..8cb65969ab --- /dev/null +++ b/modules/mogo-module-media/src/main/java/com/mogo/module/media/widget/PercentageRingView.java @@ -0,0 +1,165 @@ +package com.mogo.module.media.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Paint.Align; +import android.graphics.RectF; +import android.util.AttributeSet; +import android.view.View; + +import com.mogo.module.media.R; + +/** + * 环形进度条 + */ +public class PercentageRingView extends View { + private Paint mCirclePaint; + private Paint mTextPaint; + private Paint mArcPaint; + private int mCircleX; + private int mCircleY; + private float mCurrentAngle; + private RectF mArcRectF; + private float mStartSweepValue; + private float mTargetPercent; + private float mCurrentPercent; + + private int mRadius; + private int mCircleBackground; + private int mRingColor; + private int mTextSize; + private int mTextColor; + + + public PercentageRingView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + init(context); + } + + public PercentageRingView(Context context, AttributeSet attrs) { + super(context, attrs); + //自定义属性 values/attr + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PercentageRing); + //中间圆的背景颜色 默认为浅紫色 + mCircleBackground = typedArray.getColor(R.styleable.PercentageRing_circleBackground, 0xffafb4db); + //外圆环的颜色 默认为深紫色 + mRingColor = typedArray.getColor(R.styleable.PercentageRing_ringColor, 0xff6950a1); + //中间圆的半径 默认为60 + mRadius = typedArray.getInt(R.styleable.PercentageRing_radius, 60); + //字体颜色 默认为白色 + mTextColor = typedArray.getColor(R.styleable.PercentageRing_textColor, 0xffffffff); + //最后一定要调用这个 释放掉TypedArray + typedArray.recycle(); + //初始化数据 + init(context); + } + + public PercentageRingView(Context context) { + super(context); + init(context); + } + + private void init(Context context) { + //圆环开始角度 -90° 正北方向 + mStartSweepValue = -90; + //当前角度 + mCurrentAngle = 0; + //当前百分比 + mCurrentPercent = 0; + //设置中心园的画笔 + mCirclePaint = new Paint(); + mCirclePaint.setAntiAlias(true); + mCirclePaint.setColor(mCircleBackground); + mCirclePaint.setStyle(Paint.Style.FILL); + //设置文字的画笔 + mTextPaint = new Paint(); + mTextPaint.setColor(mTextColor); + mTextPaint.setAntiAlias(true); + mTextPaint.setStyle(Paint.Style.FILL); + mTextPaint.setStrokeWidth((float) (0.025 * mRadius)); + mTextPaint.setTextSize(mRadius / 2); + mTextPaint.setTextAlign(Align.CENTER); + //设置外圆环的画笔 + mArcPaint = new Paint(); + mArcPaint.setAntiAlias(true); + mArcPaint.setColor(mRingColor); + mArcPaint.setStyle(Paint.Style.STROKE); +// mArcPaint.setStrokeWidth((float) (0.075 * mRadius)); + mArcPaint.setStrokeWidth((float) (0.17 * mRadius)); + //获得文字的字号 因为要设置文字在圆的中心位置 + mTextSize = (int) mTextPaint.getTextSize(); + } + + //主要是测量wrap_content时候的宽和高,因为宽高一样,只需要测量一次宽即可,高等于宽 + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + setMeasuredDimension(measure(widthMeasureSpec), measure(widthMeasureSpec)); + //设置圆心坐标 + mCircleX = getMeasuredWidth() / 2; + mCircleY = getMeasuredHeight() / 2; + //如果半径大于圆心横坐标,需要手动缩小半径的值,否则就画到外面去了 + if (mRadius > mCircleX) { + //设置半径大小为圆心横坐标到原点的距离 + mRadius = mCircleX; + mRadius = (int) (mCircleX - 0.075 * mRadius); + //因为半径改变了,所以要重新设置一下字体宽度 + mTextPaint.setStrokeWidth((float) (0.025 * mRadius)); + //重新设置字号 + mTextPaint.setTextSize(mRadius / 2); + //重新设置外圆环宽度 +// mArcPaint.setStrokeWidth((float) (0.075 * mRadius)); + mArcPaint.setStrokeWidth((float) (0.17 * mRadius)); + //重新获得字号大小 + mTextSize = (int) mTextPaint.getTextSize(); + } + //画中心园的外接矩形,用来画圆环用 + mArcRectF = new RectF(mCircleX - mRadius, mCircleY - mRadius, mCircleX + mRadius, mCircleY + mRadius); + } + + //当wrap_content的时候,view的大小根据半径大小改变,但最大不会超过屏幕 + private int measure(int measureSpec) { + int result = 0; + int specMode = MeasureSpec.getMode(measureSpec); + int specSize = MeasureSpec.getSize(measureSpec); + if (specMode == MeasureSpec.EXACTLY) { + result = specSize; + } else { + result = (int) (1.075 * mRadius * 2); + if (specMode == MeasureSpec.AT_MOST) { + result = Math.min(result, specSize); + } + } + return result; + + } + + //开始画中间圆、文字和外圆环 + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + //画中间圆 + canvas.drawCircle(mCircleX, mCircleY, mRadius, mCirclePaint); + //画圆环 + canvas.drawArc(mArcRectF, mStartSweepValue, mCurrentAngle, false, mArcPaint); + //画文字 + canvas.drawText(String.valueOf(mCurrentPercent) + "%", mCircleX, mCircleY + mTextSize / 4, mTextPaint); + //判断当前百分比是否小于设置目标的百分比 + if (mCurrentPercent < mTargetPercent) { + //当前百分比+1 + mCurrentPercent += 1; + //当前角度+360 + mCurrentAngle += 3.6; + //每10ms重画一次 + postInvalidateDelayed(10); + } + + } + + //设置目标的百分比 + public void setTargetPercent(int percent) { + this.mTargetPercent = percent; + } + +} diff --git a/modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java b/modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java index 4bdaa9eec7..5a9f514f9a 100644 --- a/modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java +++ b/modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java @@ -26,6 +26,7 @@ import com.mogo.module.media.presenter.PresenterFactory; import com.mogo.module.media.utils.Utils; import com.mogo.module.media.view.IMusicView; import com.mogo.module.media.widget.AnimCircleImageView; +import com.mogo.module.media.widget.PercentageRingView; import com.mogo.service.statusmanager.IMogoStatusChangedListener; import com.mogo.service.statusmanager.StatusDescriptor; import com.mogo.utils.WindowUtils; @@ -65,6 +66,10 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { private boolean mIsCallChatWindowVisible; private ICallProviderResponse mCallProviderResponse; + private PercentageRingView mPercentageRingView; + private ImageView mPauseImage; + private AnimCircleImageView mAnimCircleImageView; + public void initMedia(Context context) { mContext = context; @@ -122,71 +127,129 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { return; } - if (!mHasAddWindow) { + if (!mHasAddWindow) { //TODO mHasAddWindow = true; - mWindowView = - LayoutInflater.from(mContext).inflate(R.layout.module_media_music_window_alert_layout, null); - mCircleImg = mWindowView.findViewById(R.id.window_circle_img); - mScrollText = mWindowView.findViewById(R.id.window_scroll_txt); - mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause); - mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next); - mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time); - mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time); - mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar); - if (mWindowPlayPause != null) { - mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause); - } - int yPos = - getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location); - int xPos = - getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x); - int statusBarHeight = WindowUtils.getStatusBarHeight(mContext); - Logger.d(TAG, - "yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight); - Log.d(TAG, "addMediaWindoView"); - FrameLayout.LayoutParams params = - new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height)); - params.leftMargin = xPos; - params.topMargin = yPos; - ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false); - updateWindowUI(true); - mWindowView.setOnClickListener(new NoDoubleClickListener() { - @Override - public void onClicks(View view) { - mPresenter.openApp(); - } - }); + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + mWindowView = + LayoutInflater.from(mContext).inflate(R.layout.module_media_music_window_alert_layout_new, null); + mPercentageRingView = mWindowView.findViewById(R.id.window_circle_bg); + mAnimCircleImageView = mWindowView.findViewById(R.id.window_circle_img_new); + mPauseImage = mWindowView.findViewById(R.id.window_play_pause_new); - mWindowPlayPause.setOnClickListener(new NoDoubleClickListener() { - @Override - public void onClicks(View view) { - if (mMediaInfoData != null) { - if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) { - mPresenter.play(mMediaInfoData); - } else { - // 没有做详细判断,不是暂停就是播放 - mPresenter.pause(mMediaInfoData); - } - } else { + if (mPauseImage != null) { + mPauseImage.setImageResource(R.drawable.module_media_window_pop_pause); + } + + int yPos = + getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_new); + int xPos = + getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x_new); + int statusBarHeight = WindowUtils.getStatusBarHeight(mContext); + Logger.d(TAG, + "yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight); + Log.d(TAG, "addMediaWindoView"); + FrameLayout.LayoutParams params = + new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width_new), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height_new)); + params.leftMargin = xPos; + params.topMargin = yPos; + ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false); + updateWindowUI(true); + + mWindowView.setOnClickListener(new NoDoubleClickListener() { + @Override + public void onClicks(View view) { mPresenter.openApp(); } - } - }); + }); - mWindowPlayNext.setOnClickListener(new NoDoubleClickListener() { - @Override - public void onClicks(View view) { - if (mPresenter != null) { - mPresenter.next(); + mPauseImage.setOnClickListener(new NoDoubleClickListener() { + @Override + public void onClicks(View view) { + if (mMediaInfoData != null) { + if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) { + mPresenter.play(mMediaInfoData); + } else { + // 没有做详细判断,不是暂停就是播放 + mPresenter.pause(mMediaInfoData); + } + } else { + mPresenter.openApp(); + } } - } - }); + }); + + if ( mIsCallChatWindowVisible ) { + Logger.d( TAG, "vr mWindowView.setVisibility: status = " + mIsCallChatWindowVisible ); + mWindowView.setVisibility(View.GONE); + } else { + mWindowView.setVisibility(View.VISIBLE); + } - if ( mIsCallChatWindowVisible ) { - Logger.d( TAG, "mWindowView.setVisibility: status = " + mIsCallChatWindowVisible ); - mWindowView.setVisibility(View.GONE); } else { - mWindowView.setVisibility(View.VISIBLE); + mWindowView = + LayoutInflater.from(mContext).inflate(R.layout.module_media_music_window_alert_layout, null); + mCircleImg = mWindowView.findViewById(R.id.window_circle_img); + mScrollText = mWindowView.findViewById(R.id.window_scroll_txt); + mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause); + mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next); + mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time); + mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time); + mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar); + if (mWindowPlayPause != null) { + mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause); + } + int yPos = + getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location); + int xPos = + getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x); + int statusBarHeight = WindowUtils.getStatusBarHeight(mContext); + Logger.d(TAG, + "yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight); + Log.d(TAG, "addMediaWindoView"); + FrameLayout.LayoutParams params = + new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height)); + params.leftMargin = xPos; + params.topMargin = yPos; + ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false); + updateWindowUI(true); + mWindowView.setOnClickListener(new NoDoubleClickListener() { + @Override + public void onClicks(View view) { + mPresenter.openApp(); + } + }); + + mWindowPlayPause.setOnClickListener(new NoDoubleClickListener() { + @Override + public void onClicks(View view) { + if (mMediaInfoData != null) { + if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) { + mPresenter.play(mMediaInfoData); + } else { + // 没有做详细判断,不是暂停就是播放 + mPresenter.pause(mMediaInfoData); + } + } else { + mPresenter.openApp(); + } + } + }); + + mWindowPlayNext.setOnClickListener(new NoDoubleClickListener() { + @Override + public void onClicks(View view) { + if (mPresenter != null) { + mPresenter.next(); + } + } + }); + + if ( mIsCallChatWindowVisible ) { + Logger.d( TAG, "mWindowView.setVisibility: status = " + mIsCallChatWindowVisible ); + mWindowView.setVisibility(View.GONE); + } else { + mWindowView.setVisibility(View.VISIBLE); + } } } } @@ -214,41 +277,71 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { return; } - if (mScrollText != null) { - mScrollText.setText(mMediaInfoData.getMediaName()); - } - - if (first || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_BUFF) { - if (mWindowMaxTime != null) { - mWindowMaxTime.setText(Utils.calculateTime((int) mMediaInfoData.getMaxTime())); - } - if (mWindowCurrTime != null) { - mWindowCurrTime.setText(Utils.calculateTime((int) mMediaInfoData.getCurTime())); - } - - if( mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) { - // kw音乐做的容错 - if (mWindowPlayPause != null) { - mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play); - } - if (mCircleImg != null) { - mCircleImg.startAnim(); + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + if (first || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_BUFF) { + if( mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) { + // kw音乐做的容错 + if (mPauseImage != null) { + mPauseImage.setImageResource(R.drawable.module_media_window_pop_play); + } + if (mAnimCircleImageView != null) { + mAnimCircleImageView.startAnim(); + } } } - } - if (mCircleImg != null) { - if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) { - int size = - mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size); - Logger.d(TAG, "overload: " + size); - com.bumptech.glide.request.RequestOptions options = - new com.bumptech.glide.request.RequestOptions() - .placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size); - GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options)); + if (mAnimCircleImageView != null) { + if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) { + int size = + mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size_new); + Logger.d(TAG, "overload: " + size); + com.bumptech.glide.request.RequestOptions options = + new com.bumptech.glide.request.RequestOptions() + .placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size); + GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mAnimCircleImageView, options)); // GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options)); - }else{ - mCircleImg.setImageResource(R.drawable.module_media_default_music_img); + }else{ + mAnimCircleImageView.setImageResource(R.drawable.module_media_default_music_img); + } + } + + } else { + if (mScrollText != null) { + mScrollText.setText(mMediaInfoData.getMediaName()); + } + + if (first || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_BUFF) { + if (mWindowMaxTime != null) { + mWindowMaxTime.setText(Utils.calculateTime((int) mMediaInfoData.getMaxTime())); + } + if (mWindowCurrTime != null) { + mWindowCurrTime.setText(Utils.calculateTime((int) mMediaInfoData.getCurTime())); + } + + if( mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) { + // kw音乐做的容错 + if (mWindowPlayPause != null) { + mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play); + } + if (mCircleImg != null) { + mCircleImg.startAnim(); + } + } + } + + if (mCircleImg != null) { + if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) { + int size = + mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size); + Logger.d(TAG, "overload: " + size); + com.bumptech.glide.request.RequestOptions options = + new com.bumptech.glide.request.RequestOptions() + .placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size); + GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options)); +// GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options)); + }else{ + mCircleImg.setImageResource(R.drawable.module_media_default_music_img); + } } } @@ -265,12 +358,22 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { Log.d(TAG, "onMusicPlaying===" + mMediaInfoData); isFirstPlay = false; updateWindowUI(false); - if (mWindowPlayPause != null) { - mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play); - } + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + if (mPauseImage != null) { + mPauseImage.setImageResource(R.drawable.module_media_window_pop_play); + } - if (mCircleImg != null) { - mCircleImg.startAnim(); + if (mAnimCircleImageView != null) { + mAnimCircleImageView.startAnim(); + } + } else { + if (mWindowPlayPause != null) { + mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play); + } + + if (mCircleImg != null) { + mCircleImg.startAnim(); + } } MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG, true); @@ -280,12 +383,22 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { public void onMusicPause() { Logger.d(TAG, "onMusicPause: ===" + mMediaInfoData); Log.d(TAG, "onMusicPause: ===" + mMediaInfoData); - if (mWindowPlayPause != null) { - mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause); - } + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + if (mPauseImage != null) { + mPauseImage.setImageResource(R.drawable.module_media_window_pop_pause); + } - if (mCircleImg != null) { - mCircleImg.stopAnim(); + if (mAnimCircleImageView != null) { + mAnimCircleImageView.stopAnim(); + } + } else { + if (mWindowPlayPause != null) { + mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause); + } + + if (mAnimCircleImageView != null) { + mAnimCircleImageView.stopAnim(); + } } MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG,false); @@ -295,12 +408,22 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { public void onMusicStopped() { Logger.d(TAG, "onMusicStopped===" + mMediaInfoData); Log.d(TAG, "onMusicStopped===" + mMediaInfoData); - if (mWindowPlayPause != null) { - mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause); - } + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + if (mPauseImage != null) { + mPauseImage.setImageResource(R.drawable.module_media_window_pop_pause); + } - if (mCircleImg != null) { - mCircleImg.stopAnim(); + if (mAnimCircleImageView != null) { + mAnimCircleImageView.stopAnim(); + } + } else { + if (mWindowPlayPause != null) { + mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause); + } + + if (mCircleImg != null) { + mCircleImg.stopAnim(); + } } MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG,false); @@ -318,22 +441,37 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener { @Override public void onMusicProgress(long current, long total) { // Logger.d(TAG, "onMusicProgress==current: " + current + " total: " + total); - if (mMediaInfoData != null) { - mMediaInfoData.setCurTime((int) current); - mMediaInfoData.setMaxTime((int) total); - } - if (mWindowCurrTime != null) { - mWindowCurrTime.setText(Utils.calculateTime((int) current)); - mWindowMaxTime.setText(Utils.calculateTime((int) total)); - } - try { - int progress = - (int) ((current * 1.0f * 100) / (total * 1.0f)); - if (mWindowProgress != null) { - mWindowProgress.setProgress(progress); + if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { + try { + int progress = + (int) ((current * 1.0f * 100) / (total * 1.0f)); + if (mPercentageRingView != null) { + mPercentageRingView.setVisibility(View.VISIBLE); + Log.d(TAG, "progress vr = " + progress); + mPercentageRingView.setTargetPercent(progress); + } + } catch (Exception e) { + e.printStackTrace(); + } + } else { + if (mMediaInfoData != null) { + mMediaInfoData.setCurTime((int) current); + mMediaInfoData.setMaxTime((int) total); + } + if (mWindowCurrTime != null) { + mWindowCurrTime.setText(Utils.calculateTime((int) current)); + mWindowMaxTime.setText(Utils.calculateTime((int) total)); + } + try { + int progress = + (int) ((current * 1.0f * 100) / (total * 1.0f)); + if (mWindowProgress != null) { + Log.d(TAG, "progress = " + progress); + mWindowProgress.setProgress(progress); + } + } catch (Exception e) { + e.printStackTrace(); } - } catch (Exception e) { - e.printStackTrace(); } } 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 new file mode 100644 index 0000000000..8d2d4cebc0 --- /dev/null +++ b/modules/mogo-module-media/src/main/res/layout/module_media_music_window_alert_layout_new.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + diff --git a/modules/mogo-module-media/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-media/src/main/res/values-xhdpi/dimens.xml index f31888dd72..d783c1911d 100644 --- a/modules/mogo-module-media/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-media/src/main/res/values-xhdpi/dimens.xml @@ -2,7 +2,8 @@ 872px 1067px - + 40px + 1760px 660px 660px @@ -63,9 +64,14 @@ 600px 140px + 116px + 116px 112px 30px 80px + 90px + 60px + 116px 230px 14px 35px diff --git a/modules/mogo-module-media/src/main/res/values/attrs.xml b/modules/mogo-module-media/src/main/res/values/attrs.xml index 80f3c0bd3d..d8f98cf7bf 100644 --- a/modules/mogo-module-media/src/main/res/values/attrs.xml +++ b/modules/mogo-module-media/src/main/res/values/attrs.xml @@ -35,4 +35,12 @@ + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-media/src/main/res/values/colors.xml b/modules/mogo-module-media/src/main/res/values/colors.xml index b156f1f106..b0944c76eb 100644 --- a/modules/mogo-module-media/src/main/res/values/colors.xml +++ b/modules/mogo-module-media/src/main/res/values/colors.xml @@ -2,4 +2,6 @@ #fff #7affffff + #444E6E + #B63737 diff --git a/modules/mogo-module-media/src/main/res/values/dimens.xml b/modules/mogo-module-media/src/main/res/values/dimens.xml index de1d893a59..48da6e24fd 100644 --- a/modules/mogo-module-media/src/main/res/values/dimens.xml +++ b/modules/mogo-module-media/src/main/res/values/dimens.xml @@ -2,6 +2,8 @@ 467px 573px + 80px + 930px 352px @@ -63,9 +65,13 @@ 338px 82px + 116px + 116px 60px 18px 44px + 55px + 60px 123px 10px 18px From 9f7cd7eb6ba121d941aec1163483c7dbb7970dc5 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 10 Dec 2020 17:59:08 +0800 Subject: [PATCH 15/22] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=BA=A2?= =?UTF-8?q?=E7=BB=BF=E7=81=AF=E9=9D=A2=E6=9D=BF=E7=95=8C=E9=9D=A2=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- config.gradle | 4 +- gradle.properties | 132 +++++++++--------- libraries/map-custom/build.gradle | 2 +- libraries/tanlulib/build.gradle | 6 +- modules.txt | 12 +- .../extensions/entrance/EntranceFragment.java | 12 +- .../extensions/utils/AdasNoticeHelper.java | 3 + .../utils/TrafficLightPanelManager.java | 83 +++++++++++ .../view/VerticalTrafficLightView.java | 3 +- .../res/drawable/module_ext_navi_in_vr_bg.xml | 3 +- .../main/res/layout/include_navi_in_vr.xml | 119 ++++++++++++---- .../merge_vertical_traffic_light_in_vr.xml | 2 + .../res/layout/module_ext_layout_entrance.xml | 5 + .../src/main/res/values/dimens.xml | 5 + 15 files changed, 277 insertions(+), 116 deletions(-) create mode 100644 modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TrafficLightPanelManager.java diff --git a/build.gradle b/build.gradle index 8859cdee59..704b9467e2 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.5.2' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0' classpath "com.alibaba:arouter-register:1.0.2" classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4' // classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true } diff --git a/config.gradle b/config.gradle index 690687840b..71394758d7 100644 --- a/config.gradle +++ b/config.gradle @@ -144,8 +144,8 @@ ext { eventbus : "org.greenrobot:eventbus:3.1.1", videoprocessor : "com.zhidao.video:video-processor:1.0.2.1", - coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1", - coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1", + coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3", + coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3", aspectj : "org.aspectj:aspectjrt:1.8.9", diff --git a/gradle.properties b/gradle.properties index 24262a25ef..56be60b7dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -52,88 +52,88 @@ PASSWORD=xintai2018 RELEASE=false # 模块版本 ## 工程内模块 -MOGO_COMMONS_VERSION=2.0.7 -MOGO_UTILS_VERSION=2.0.7 -MAP_AMAP_VERSION=2.0.7 -MAP_AUTONAVI_VERSION=2.0.7 -MOGO_MAP_VERSION=2.0.7 -MOGO_MAP_API_VERSION=2.0.7 -MOGO_SERVICE_VERSION=2.0.7 -MOGO_SERVICE_API_VERSION=2.0.8 -MOGO_CONNECTION_VERSION=2.0.7 -MOGO_MODULE_APPS_VERSION=2.0.7 -MOGO_MODULE_NAVI_VERSION=2.0.7 -MOGO_MODULE_SHARE_VERSION=2.0.7 -MOGO_MODULE_COMMON_VERSION=2.0.7 -MOGO_MODULE_MAIN_VERSION=2.0.7 -MOGO_MODULE_MAP_VERSION=2.0.7 -MOGO_MODULE_SERVICE_VERSION=2.0.7 -MOGO_MODULE_EXTENSIONS_VERSION=2.0.7 -MOGO_MODULE_SEARCH_VERSION=2.0.7 -MOGO_MODULE_BACK_VERSION=2.0.7 -MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.7 -MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.7 -MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.7 -MOGO_MODULE_AUTHORIZE_VERSION=2.0.7 -MOGO_MODULE_GUIDE_VERSION=2.0.7 -MOGO_MODULE_MEDIA_VERSION=2.0.7 -MOGO_MODULE_MAIN_LAUNCHER_VERSION=2.0.7 -MOGO_MODULE_MAIN_INDEPENDENT_VERSION=2.0.7 -MOGO_MODULE_V2X_VERSION=2.0.7 +MOGO_COMMONS_VERSION=2.0.12 +MOGO_UTILS_VERSION=2.0.12 +MAP_AMAP_VERSION=2.0.12 +MAP_AUTONAVI_VERSION=2.0.12 +MOGO_MAP_VERSION=2.0.12 +MOGO_MAP_API_VERSION=2.0.12 +MOGO_SERVICE_VERSION=2.0.12 +MOGO_SERVICE_API_VERSION=2.0.12 +MOGO_CONNECTION_VERSION=2.0.12 +MOGO_MODULE_APPS_VERSION=2.0.12 +MOGO_MODULE_NAVI_VERSION=2.0.12 +MOGO_MODULE_SHARE_VERSION=2.0.12 +MOGO_MODULE_COMMON_VERSION=2.0.12 +MOGO_MODULE_MAIN_VERSION=2.0.12 +MOGO_MODULE_MAP_VERSION=2.0.12 +MOGO_MODULE_SERVICE_VERSION=2.0.12 +MOGO_MODULE_EXTENSIONS_VERSION=2.0.12 +MOGO_MODULE_SEARCH_VERSION=2.0.12 +MOGO_MODULE_BACK_VERSION=2.0.12 +MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.12 +MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.12 +MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.12 +MOGO_MODULE_AUTHORIZE_VERSION=2.0.12 +MOGO_MODULE_GUIDE_VERSION=2.0.12 +MOGO_MODULE_MEDIA_VERSION=2.0.12 +MOGO_MODULE_MAIN_LAUNCHER_VERSION=2.0.12 +MOGO_MODULE_MAIN_INDEPENDENT_VERSION=2.0.12 +MOGO_MODULE_V2X_VERSION=2.0.12 # 基础服务实现:passport、socket、location -MOGO_BASE_WEBSOCKET_SDK_VERSION = 1.0.0 -MOGO_BASE_SERVICES_APK_VERSION=2.0.7 -MOGO_BASE_SERVICES_SDK_VERSION=2.0.7 +MOGO_BASE_WEBSOCKET_SDK_VERSION = 2.0.12 +MOGO_BASE_SERVICES_APK_VERSION=2.0.12 +MOGO_BASE_SERVICES_SDK_VERSION=2.0.12 ## 工程外部模块 # 探路 -MOGO_MODULE_TANLU_VERSION=2.0.7 +MOGO_MODULE_TANLU_VERSION=2.0.12 # 视频引导 -MOGO_MODULE_GUIDESHOW_VERSION=2.0.7 +MOGO_MODULE_GUIDESHOW_VERSION=2.0.12 # 推送 -MOGO_MODULE_PUSH_VERSION=2.0.7 -MOGO_MODULE_PUSH_BASE_VERSION=2.0.7 -MOGO_MODULE_PUSH_NOOP_VERSION=2.0.7 +MOGO_MODULE_PUSH_VERSION=2.0.12 +MOGO_MODULE_PUSH_BASE_VERSION=2.0.12 +MOGO_MODULE_PUSH_NOOP_VERSION=2.0.12 # 探路上报和分享模块 -TANLULIB_VERSION=2.0.7 -MOGO_TANLU_API_VERSION=2.0.7 +TANLULIB_VERSION=2.0.12 +MOGO_TANLU_API_VERSION=2.0.12 #左侧面板模块 -MOGO_MODULE_LEFT_PANEL_VERSION=2.0.7 -MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.7 +MOGO_MODULE_LEFT_PANEL_VERSION=2.0.12 +MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.12 # 小控件 -MOGO_MODULE_WIDGETS_VERSION=2.0.7 +MOGO_MODULE_WIDGETS_VERSION=2.0.12 # obu -MOGO_MODULE_OBU_VERSION=2.0.7 +MOGO_MODULE_OBU_VERSION=2.0.12 # 皮肤 -MOGO_SKIN_SUPPORT_VERSION=2.0.7 -MOGO_SKIN_LIGHT_VERSION=2.0.7 -MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.7 -MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.7 -SKIN_SUPPORT_VERSION=2.0.7 -SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.7 -SKIN_SUPPORT_CARDVIEW_VERSION=2.0.7 -SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.7 -SKIN_SUPPORT_DESIGN_VERSION=2.0.7 +MOGO_SKIN_SUPPORT_VERSION=2.0.12 +MOGO_SKIN_LIGHT_VERSION=2.0.12 +MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.12 +MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.12 +SKIN_SUPPORT_VERSION=2.0.12 +SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.12 +SKIN_SUPPORT_CARDVIEW_VERSION=2.0.12 +SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.12 +SKIN_SUPPORT_DESIGN_VERSION=2.0.12 # 闪屏页 -MOGO_MODULE_SPLASH_VERSION=2.0.7 -MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.7 +MOGO_MODULE_SPLASH_VERSION=2.0.12 +MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.12 # monitor -MOGO_MODULE_MONITOR_VERSION=2.0.7 +MOGO_MODULE_MONITOR_VERSION=2.0.12 # bugly -CRASHREPORT_VERSION=2.0.7 -CRASHREPORT_BUGLY_VERSION=2.0.7 -CRASHREPORT_NOOP_VERSION=2.0.7 +CRASHREPORT_VERSION=2.0.12 +CRASHREPORT_BUGLY_VERSION=2.0.12 +CRASHREPORT_NOOP_VERSION=2.0.12 ## tts -TTS_BASE_VERSION=2.0.7 -TTS_DI_VERSION=2.0.7 -TTS_ZHI_VERSION=2.0.7 -TTS_NOOP_VERSION=2.0.7 +TTS_BASE_VERSION=2.0.12 +TTS_DI_VERSION=2.0.12 +TTS_ZHI_VERSION=2.0.12 +TTS_NOOP_VERSION=2.0.12 # 自研地图 -MAP_CUSTOM_VERSION=1.2.1.9 -MOGO_MODULES_MVISION_VERSION=1.0.0 +MAP_CUSTOM_VERSION=2.0.12 +MOGO_MODULES_MVISION_VERSION=2.0.12 # httpdns -HTTPDNS_TENCENT_VERSION = 1.0.0 -HTTPDNS_BASE_VERSION = 1.0.0 -HTTPDNS_NOOP_VERSION = 1.0.0 +HTTPDNS_TENCENT_VERSION = 2.0.12 +HTTPDNS_BASE_VERSION = 2.0.12 +HTTPDNS_NOOP_VERSION = 2.0.12 ######## 外部依赖引用 # 车聊聊 diff --git a/libraries/map-custom/build.gradle b/libraries/map-custom/build.gradle index ee7e68bcb6..3b997c48a7 100644 --- a/libraries/map-custom/build.gradle +++ b/libraries/map-custom/build.gradle @@ -39,7 +39,7 @@ dependencies { implementation rootProject.ext.dependencies.androidxappcompat - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation rootProject.ext.dependencies.kotlinstdlibjdk7 // api rootProject.ext.dependencies.amapnavi3dmap // api rootProject.ext.dependencies.amapsearch diff --git a/libraries/tanlulib/build.gradle b/libraries/tanlulib/build.gradle index dba6a1d3df..a23d2e6cb8 100644 --- a/libraries/tanlulib/build.gradle +++ b/libraries/tanlulib/build.gradle @@ -72,9 +72,9 @@ dependencies { kapt rootProject.ext.dependencies.aroutercompiler if (Boolean.valueOf(RELEASE)) { - compileOnly rootProject.ext.dependencies.mogocommons - compileOnly rootProject.ext.dependencies.mogomap - compileOnly rootProject.ext.dependencies.mogoserviceapi + implementation rootProject.ext.dependencies.mogocommons + implementation rootProject.ext.dependencies.mogomap + implementation rootProject.ext.dependencies.mogoserviceapi } else { implementation project(':modules:mogo-module-common') implementation project(':libraries:mogo-map') diff --git a/modules.txt b/modules.txt index 59dbcdef06..c15cf56b13 100644 --- a/modules.txt +++ b/modules.txt @@ -2,12 +2,11 @@ :skin:mogo-skin-support :tts:tts-base :tts:tts-zhi -:tts:tts-di -:tts:tts-noop -:foudations:mogo-commons :foudations:httpdns-base :foudations:httpdns-noop -:foudations:httpdns-tencent +:foudations:mogo-commons +:tts:tts-di +:tts:tts-noop :libraries:mogo-map-api :skin:skin-support :skin:skin-support-appcompat @@ -17,8 +16,10 @@ :services:mogo-service-api :libraries:map-amap :libraries:map-autonavi +:libraries:map-custom :libraries:mogo-map :modules:mogo-module-common +:foudations:httpdns-tencent :skin:mogo-skin-support-impl :skin:mogo-skin-support-noop :test:crashreport @@ -29,9 +30,6 @@ :modules:mogo-module-obu :modules:mogo-module-map :modules:mogo-module-apps -:modules:mogo-module-gps-simulator -:modules:mogo-module-gps-simulator-debug -:modules:mogo-module-gps-simulator-noop :modules:mogo-module-service :modules:mogo-module-authorize :modules:mogo-module-share diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index f988ed34db..87371b2ce8 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -57,6 +57,7 @@ import com.mogo.module.extensions.utils.EntranceViewHolder; import com.mogo.module.extensions.utils.NoMapTopViewShaderHelper; import com.mogo.module.extensions.utils.TopViewAnimHelper; import com.mogo.module.extensions.utils.TopViewNoLinkageAnimHelper; +import com.mogo.module.extensions.utils.TrafficLightPanelManager; import com.mogo.module.share.manager.ServiceApisManager; import com.mogo.service.IMogoServiceApis; import com.mogo.service.analytics.IMogoAnalytics; @@ -483,6 +484,8 @@ public class EntranceFragment extends MvpFragment + * 导航信息内容通过{@link com.mogo.module.extensions.navi.VrModeNavInfoView} 在{@link com.mogo.module.extensions.entrance.EntranceFragment}进行控制 + * 此处仅控制导航信息的显示与隐藏 + * + * @author tongchenfei + */ +public class TrafficLightPanelManager { + private static final String TAG = "TrafficLightPanelManager"; + + private TrafficLightPanelManager() { + } + + private final static TrafficLightPanelManager INSTANCE = new TrafficLightPanelManager(); + + public static TrafficLightPanelManager getInstance() { + return INSTANCE; + } + + private Group speedGroup, navGroup, extraGroup; + private TextView tvLimitSpeed; + private VerticalTrafficLightView turnAroundLight, turnLeftLight, straightLight, turnRightLight; + + private boolean isInit = false; + + public void initPanel(View root) { + speedGroup = root.findViewById(R.id.module_ext_id_group_navi_in_vr_speed); + navGroup = root.findViewById(R.id.module_ext_id_group_navi_in_vr_nav_info); + extraGroup = root.findViewById(R.id.module_ext_id_group_traffic_light_panel_extra); + tvLimitSpeed = root.findViewById(R.id.module_ext_id_tv_limit_speed); + turnAroundLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_around); + turnLeftLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_left); + straightLight = root.findViewById(R.id.module_ext_id_traffic_light_straight); + turnRightLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_right); + isInit = true; + } + + public void showNavPanel() { + if (!isInit) { + Logger.e(TAG, "nav panel 未初始化"); + return; + } + extraGroup.setVisibility(View.VISIBLE); + speedGroup.setVisibility(View.VISIBLE); +// navGroup.setVisibility(View.VISIBLE); + tvLimitSpeed.setVisibility(View.VISIBLE); + } + + public void hideNavPanel() { + if (!isInit) { + Logger.e(TAG, "nav panel 未初始化"); + return; + } + extraGroup.setVisibility(View.GONE); + speedGroup.setVisibility(View.GONE); +// navGroup.setVisibility(View.GONE); + tvLimitSpeed.setVisibility(View.GONE); + } + + public void release() { + isInit = false; + speedGroup = null; + navGroup = null; + extraGroup = null; + tvLimitSpeed = null; + turnAroundLight = null; + turnLeftLight = null; + straightLight = null; + turnRightLight = null; + } +} diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/view/VerticalTrafficLightView.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/view/VerticalTrafficLightView.java index 417309fc64..c05b931aa2 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/view/VerticalTrafficLightView.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/view/VerticalTrafficLightView.java @@ -54,7 +54,6 @@ public class VerticalTrafficLightView extends ConstraintLayout { public VerticalTrafficLightView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); LayoutInflater.from(context).inflate(R.layout.merge_vertical_traffic_light_in_vr, this); - initView(); TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.VerticalTrafficLightView, 0, 0); int lightType = typedArray.getInt(R.styleable.VerticalTrafficLightView_iconRes, 0); typedArray.recycle(); @@ -76,6 +75,7 @@ public class VerticalTrafficLightView extends ConstraintLayout { iconRes = TURN_AROUND_ICON_RES; break; } + initView(); } private void initView() { @@ -84,6 +84,7 @@ public class VerticalTrafficLightView extends ConstraintLayout { tvLeftTime = findViewById(R.id.module_ext_id_traffic_light_left_time); tvLeftTimeUnit = findViewById(R.id.module_ext_id_traffic_light_left_time_unit); groupLeftTime = findViewById(R.id.module_ext_id_group_left_time); + ivTrafficLight.setImageResource(iconRes[0]); } /** diff --git a/modules/mogo-module-extensions/src/main/res/drawable/module_ext_navi_in_vr_bg.xml b/modules/mogo-module-extensions/src/main/res/drawable/module_ext_navi_in_vr_bg.xml index 8ebb6406a4..d37d6205c8 100644 --- a/modules/mogo-module-extensions/src/main/res/drawable/module_ext_navi_in_vr_bg.xml +++ b/modules/mogo-module-extensions/src/main/res/drawable/module_ext_navi_in_vr_bg.xml @@ -8,7 +8,8 @@ + android:endColor="#68203784" + android:angle="270"/> diff --git a/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml b/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml index 0bf3225ba9..debe55ed54 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml @@ -1,77 +1,112 @@ + android:background="@drawable/module_ext_navi_in_vr_bg" /> + app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg" + app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg" + app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" /> - - + app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg" + app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg" /> + app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg" + app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg" + app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" /> + app:layout_constraintLeft_toRightOf="@id/module_ext_id_tv_speed" /> + + + + + + + + + + + app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg" + app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" /> + app:layout_constraintRight_toLeftOf="@id/module_ext_id_traffic_light_turn_left" + app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg" /> + app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_traffic_bg" + app:layout_constraintTop_toTopOf="@id/module_ext_id_traffic_light_straight" /> + + + + + \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml b/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml index 391cdb1d56..9c14f81fb8 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/merge_vertical_traffic_light_in_vr.xml @@ -7,6 +7,8 @@ diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml index f877c89973..9f023a93dd 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml @@ -16,6 +16,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> + + 464px 304px + 100px + 60px + 48px + 26px 458px 298px 140px @@ -233,4 +237,5 @@ 21px 21px + \ No newline at end of file From 7d3717894843bbea71cf47f568165ebfa760839e Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 10 Dec 2020 21:03:11 +0800 Subject: [PATCH 16/22] =?UTF-8?q?=E4=BC=98=E5=8C=96vr=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extensions/entrance/EntranceFragment.java | 4 +- .../extensions/utils/AdasNoticeHelper.java | 157 ++---------------- .../main/res/layout/include_navi_in_vr.xml | 4 + .../res/layout/module_ext_item_self_car.xml | 64 ------- .../res/layout/module_ext_layout_entrance.xml | 51 ------ .../src/main/res/values/dimens.xml | 2 + 6 files changed, 19 insertions(+), 263 deletions(-) delete mode 100644 modules/mogo-module-extensions/src/main/res/layout/module_ext_item_self_car.xml diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index 87371b2ce8..8df19ce8d4 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -497,7 +497,7 @@ public class EntranceFragment extends MvpFragment { - handler.removeMessages(MSG_HIDE_LIMIT_SPEED); - - if (tvLimitSpeed.getVisibility() == View.GONE) { - tvLimitSpeed.setVisibility(View.VISIBLE); - } - tvLimitSpeed.setText(limitSpeed+""); - handler.sendEmptyMessageDelayed(MSG_HIDE_LIMIT_SPEED, HIDE_LIMIT_SPEED_DELAY); - }); - } + private void drawLimitSpeed() { } @Override @@ -153,25 +124,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca return; } currentSpeed = (int) (location.getSpeed() * 3.6F); - if(lightCenter) { - if (tvSelfSpeed != null) { - tvSelfSpeed.post(() -> { - if (tvSelfSpeed.getVisibility() == View.GONE) { - tvSelfSpeed.setVisibility(View.VISIBLE); - } - if (limitSpeed != -1 && currentSpeed > limitSpeed) { - // 显示红色 - tvSelfSpeed.setTextColor(context.getResources().getColor(R.color.module_ext_vr_mode_left_traffic_light_red)); - tvSelfSpeed.setBackgroundResource(R.drawable.module_ext_vr_mode_speed_red_bg); - }else{ - // 显示白 - tvSelfSpeed.setTextColor(context.getResources().getColor(R.color.module_ext_vr_mode_left_traffic_light_white)); - tvSelfSpeed.setBackgroundResource(R.drawable.module_ext_vr_mode_speed_white_bg); - } - tvSelfSpeed.setText("" + currentSpeed); - Logger.d(TAG, "onLocationChange: " + currentSpeed); - }); - } + if (lightCenter) { } } @@ -181,11 +134,6 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca case MSG_REFRESH_CAR_STRATEGY: // todo 暂时不采用此种渲染方式 // 自车速度 - tvSelfSpeed.setText("" + currentSpeed); - // 红绿灯 - if (tvTrafficLight.getVisibility() == View.GONE) { - tvTrafficLight.setVisibility(View.VISIBLE); - } // todo 设置字体颜色、背景颜色、leftDrawable switch (lightStatus) { case "Y": @@ -198,26 +146,21 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca // 默认绿灯 break; } - tvTrafficLight.setText(surplusTime + "S"); - MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().showMyLocation(inflateRoadInfo()); if (isVrMode) { handler.sendEmptyMessageDelayed(MSG_REFRESH_CAR_STRATEGY, STRATEGY_DELAY); } return true; case MSG_HIDE_LIMIT_SPEED: limitSpeed = -1; - tvLimitSpeed.setVisibility(View.GONE); return true; case MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD: if (!isObuLightData && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { - tvTrafficLight.setVisibility(View.GONE); } return true; case MSG_HIDE_TRAFFIC_LIGHT_BY_OBU: isObuLightData = false; if (!handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD)) { - tvTrafficLight.setVisibility(View.GONE); } return true; default: @@ -237,22 +180,22 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca return; } String action = intent.getAction(); - if("com.mogo.launcher.adas".equals(action)){ + if ("com.mogo.launcher.adas".equals(action)) { // 收到限速信息 int limit = intent.getIntExtra("adas_speed_limit", -1); - if(limit>0) { + if (limit > 0) { limitSpeed = limit; drawLimitSpeed(); } - }else { + } else { int type = intent.getIntExtra("type", -1); if (type == 2) { String obuLightAction = intent.getStringExtra("action"); - if("1".equals(obuLightAction)){ + if ("1".equals(obuLightAction)) { // 隐藏红绿灯 handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU); handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU); - }else { + } else { // 红绿灯处理 String data = intent.getStringExtra("data"); if (data != null && !data.isEmpty()) { @@ -278,13 +221,6 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca private void handleObuTrafficLightInfo(String lightStatus, String surplusTime) { isObuLightData = true; - if (tvTrafficLight != null) { - handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU); - handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); - drawTrafficLight(lightStatus, surplusTime); - handler.sendEmptyMessageDelayed(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU, - HIDE_TRAFFIC_LIGHT_DELAY); - } } private void handleCloudTrafficLight(CloudRoadData roadData) { @@ -292,75 +228,12 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); return; } - if (tvTrafficLight != null && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { - handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); - // todo drawTrafficLight - String lightStatus = null; - switch (roadData.getLightStatus()) { - case 1: - // 红灯 - lightStatus = "R"; - break; - case 2: - // 绿灯 - lightStatus = "G"; - break; - case 3: - // 黄灯 - lightStatus = "Y"; - break; - default: - break; - } - if(lightStatus == null){ - handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); - }else { - int diff = (int) ((System.currentTimeMillis() - roadData.getSystemTime()) / 1000); - int leftTime = roadData.getLightLeftTime() - diff; - if (leftTime < 0) { - leftTime = 0; - } - Logger.d("CloudTrafficLight", - "lightStatus: " + lightStatus + " current: " + System.currentTimeMillis() + " cloudType: " + roadData.getSystemTime() + " diff: " + diff + " cloudLeftTime: " + roadData.getLightLeftTime() + " leftTime: " + leftTime); - drawTrafficLight(lightStatus, "" + leftTime); - handler.sendEmptyMessageDelayed(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD, - HIDE_TRAFFIC_LIGHT_DELAY); - } - } } private void drawTrafficLight(String lightStatus, String surplusTime) { this.lightStatus = lightStatus; this.surplusTime = surplusTime; - if(lightCenter) { - tvTrafficLight.post(() -> { - if (tvTrafficLight.getVisibility() == View.GONE) { - tvTrafficLight.setVisibility(View.VISIBLE); - } - // todo 设置字体颜色、背景颜色、leftDrawable - switch (lightStatus) { - case "Y": - // 黄灯 - tvTrafficLight.setTextColor(context.getResources().getColor(R.color.module_ext_vr_mode_left_traffic_light_yellow)); - tvTrafficLight.setBackgroundResource(R.drawable.module_ext_vr_mode_traffic_light_yellow_bg); - tvTrafficLight.setCompoundDrawablesWithIntrinsicBounds(R.drawable.module_ext_traffic_light_yellow, 0, 0, 0); - break; - case "R": - // 红灯 - tvTrafficLight.setTextColor(context.getResources().getColor(R.color.module_ext_vr_mode_left_traffic_light_red)); - tvTrafficLight.setBackgroundResource(R.drawable.module_ext_vr_mode_traffic_light_red_bg); - tvTrafficLight.setCompoundDrawablesWithIntrinsicBounds(R.drawable.module_ext_traffic_light_red, 0, 0, 0); - break; - default: - // 默认绿灯 - tvTrafficLight.setTextColor(context.getResources().getColor(R.color.module_ext_vr_mode_left_traffic_light_green)); - tvTrafficLight.setBackgroundResource(R.drawable.module_ext_vr_mode_traffic_light_green_bg); - tvTrafficLight.setCompoundDrawablesWithIntrinsicBounds(R.drawable.module_ext_traffic_light_green, 0, 0, 0); - break; - } - tvTrafficLight.setText(surplusTime + "S"); - Logger.d(TAG, "展示红绿灯信息: " + lightStatus + " time: " + surplusTime); - }); + if (lightCenter) { } } @@ -386,12 +259,4 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca } } - private View inflateRoadInfo(){ - View view = View.inflate(context, R.layout.module_ext_item_self_car, null); - TextView _speed = view.findViewById(R.id.tvSelfSpeed); - _speed.setText("" + currentSpeed); - Logger.d(TAG, "showCurrentSpeed: " + currentSpeed); - return view; - } - } diff --git a/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml b/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml index debe55ed54..34a47aaadd 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/include_navi_in_vr.xml @@ -8,6 +8,10 @@ android:id="@+id/module_ext_id_navi_in_vr_bg" android:layout_width="@dimen/module_ext_navi_in_vr_width" android:layout_height="@dimen/module_ext_navi_in_vr_height" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" + android:layout_marginTop="@dimen/module_ext_navi_in_vr_margin_top" + android:layout_marginStart="@dimen/module_ext_navi_in_vr_margin_start" android:background="@drawable/module_ext_navi_in_vr_bg" /> - - - - - - - - - - - \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml index 9f023a93dd..de35c28104 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml @@ -262,57 +262,6 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" /> - - - - - - -