From 8a7bc289544ad834a1d871d8510d1056bfff1d77 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Tue, 2 Feb 2021 15:57:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B0=8F=E5=B7=B4ui=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/fragment/OchBusFragment.java | 90 +++++++++++++++++-- .../src/main/res/layout/fragment_och_bus.xml | 3 +- .../src/main/res/values/dimens.xml | 9 +- 3 files changed, 90 insertions(+), 12 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java index 11c5d86aa6..2fe9555b15 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java @@ -19,6 +19,8 @@ import com.mogo.och.view.SlidePanelView; import com.mogo.service.adas.IMogoAdasOCHCallback; import com.mogo.utils.logger.Logger; +import java.lang.reflect.Array; +import java.util.ArrayList; import java.util.List; @@ -51,16 +53,87 @@ public class OchBusFragment extends BaseOchFragment{ // todo debug code + List stationList = new ArrayList<>(); + OchBusStation station; switch (stationSizeLevel) { case 2: - + stationSizeLevel++; + station = new OchBusStation(); + station.setSiteName("第一站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_STOPED); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第二站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); break; case 3: + stationSizeLevel++; + station = new OchBusStation(); + station.setSiteName("第一站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_STOPED); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第二站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第三站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + break; + case 4: + stationSizeLevel++; + station = new OchBusStation(); + station.setSiteName("第一站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_STOPED); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第二站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第三站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第四站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); break; default: + stationSizeLevel = 2; + station = new OchBusStation(); + station.setSiteName("第一站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_STOPED); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第二站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第三站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第四站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第五站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第五站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); + station = new OchBusStation(); + station.setSiteName("第五站"); + station.setIsCurrentSite(OchBusConst.STATION_STATUS_IDLE); + stationList.add(station); break; } - + refreshBusStations(stationList); }); Logger.d(TAG, "initView: " + MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus()); @@ -121,21 +194,20 @@ public class OchBusFragment extends BaseOchFragment3 - View panelView = getPanelView(); - ViewGroup.LayoutParams params = panelView.getLayoutParams(); + // 根据车站数量,调整面板高度,分为2,3,>3 + ViewGroup.LayoutParams params = rvStationList.getLayoutParams(); switch (stationList.size()) { case 2: - params.height = getResources().getDimensionPixelSize(R.dimen.module_mogo_och_bus_two_station_panel_height); + params.height = getResources().getDimensionPixelSize(R.dimen.module_mogo_och_bus_two_station_list_height); break; case 3: - params.height = getResources().getDimensionPixelSize(R.dimen.module_mogo_och_bus_three_station_panel_height); + params.height = getResources().getDimensionPixelSize(R.dimen.module_mogo_och_bus_three_station_list_height); break; default: - params.height = getResources().getDimensionPixelSize(R.dimen.module_mogo_och_bus_station_panel_height); + params.height = getResources().getDimensionPixelSize(R.dimen.module_mogo_och_bus_station_list_height); break; } - panelView.setLayoutParams(params); + rvStationList.setLayoutParams(params); // 渲染小巴路线数据 adapter.refreshStationList(stationList); int currPos = -1; diff --git a/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml b/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml index afd0fcdab0..aa0e377783 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml @@ -2,8 +2,9 @@ diff --git a/OCH/mogo-och-bus/src/main/res/values/dimens.xml b/OCH/mogo-och-bus/src/main/res/values/dimens.xml index ae91017c6c..2e0c11b709 100644 --- a/OCH/mogo-och-bus/src/main/res/values/dimens.xml +++ b/OCH/mogo-och-bus/src/main/res/values/dimens.xml @@ -3,8 +3,13 @@ 464px 348px - 148px - 248px + 211px + 276px + + + 220px + 98px + 159px 32px 20px From 94a81d3d350d040a2eb1d052d05f20fdf798726e Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Tue, 2 Feb 2021 20:35:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=8F=E5=B7=B4?= =?UTF-8?q?=E8=BF=9B=E5=85=A5vr=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/gradle.xml | 1 + .../java/com/mogo/och/bus/OchBusProvider.java | 15 +++++++++++++++ .../com/mogo/och/bus/fragment/OchBusFragment.java | 4 ++-- .../res/drawable/module_och_bus_panel_bkg.xml | 10 +++++++--- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 771c1f74d7..740794bd48 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -89,6 +89,7 @@ diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java index fcd71674c3..ff5094b200 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java @@ -13,6 +13,7 @@ import com.mogo.och.bus.fragment.OchBusFragment; import com.mogo.service.connection.IMogoOnMessageListener; import com.mogo.service.statusmanager.IMogoStatusChangedListener; import com.mogo.service.statusmanager.StatusDescriptor; +import com.mogo.utils.UiThreadHandler; import com.mogo.utils.logger.Logger; import java.util.List; @@ -33,6 +34,20 @@ public class OchBusProvider implements IMogoOCH { public void init(FragmentActivity activity, int containerId) { this.containerId = containerId; this.activity = activity; + + UiThreadHandler.postDelayed(this::stepIntoVrMode, 5_000L ); + } + + /** + * 进入鹰眼模式,设置手势缩放地图失效 + */ + private void stepIntoVrMode(){ + Logger.d( TAG, "进入vr模式" ); + MogoApisHandler.getInstance() + .getApis() + .getMapServiceApi() + .getMapUIController() + .openVrMode(false); } @Override diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java index 2fe9555b15..ac7069c71f 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/OchBusFragment.java @@ -223,14 +223,14 @@ public class OchBusFragment extends BaseOchFragment - + + android:angle="270" + android:endColor="#141C35" + android:startColor="#344687" /> \ No newline at end of file