From 301cd0f4eda2132a2db4c7c92e5c9cda7ca4fa2b Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 21 Jan 2021 12:54:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0SlidePanelView=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/bus/fragment/OchBusFragment.java | 13 +- .../och/bus/presenter/OchBusPresenter.java | 2 +- .../src/main/res/layout/fragment_och_bus.xml | 15 +- .../com/mogo/och/view/SlidePanelView.java | 244 ++++++++++++++++++ .../src/main/res/drawable/ic_block.png | Bin 0 -> 7472 bytes 5 files changed, 263 insertions(+), 11 deletions(-) create mode 100644 OCH/mogo-och/src/main/java/com/mogo/och/view/SlidePanelView.java create mode 100644 OCH/mogo-och/src/main/res/drawable/ic_block.png 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 7df72a776f..dc92e704d8 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 @@ -13,6 +13,7 @@ import com.mogo.module.common.view.OnPreventFastClickListener; import com.mogo.och.bus.R; import com.mogo.och.bus.bean.OchBusStation; import com.mogo.och.bus.presenter.OchBusPresenter; +import com.mogo.service.adas.entity.AdasOCHData; import com.mogo.utils.logger.Logger; import java.util.ArrayList; @@ -26,7 +27,6 @@ import java.util.List; */ public class OchBusFragment extends MvpFragment { private static final String TAG = "OchBusFragment"; - private Group groupOchBus; private final List stationList = new ArrayList<>(); private Button btnExecute; private TextView tvNotice; @@ -38,13 +38,15 @@ public class OchBusFragment extends MvpFragment @Override protected void initViews() { - groupOchBus = findViewById(R.id.groupOchBus); findViewById(R.id.btnEnterOchBus).setOnClickListener(new OnPreventFastClickListener() { @Override public void onClickImpl(View v) { showOchBus(); } }); + findViewById(R.id.btnArrive).setOnClickListener(view->{ + mPresenter.onArriveAt(new AdasOCHData(10, nextStation.getLon(), nextStation.getLat())); + }); btnExecute = findViewById(R.id.btnExecute); btnExecute.setOnClickListener(new OnPreventFastClickListener() { @Override @@ -63,8 +65,8 @@ public class OchBusFragment extends MvpFragment public void showOchBus() { MogoApisHandler.getInstance().getApis().getTopViewManager().removeAllViewInVrMode(); - groupOchBus.setVisibility(View.VISIBLE); + tvNotice.setVisibility(View.VISIBLE); } @Override @@ -83,6 +85,8 @@ public class OchBusFragment extends MvpFragment } } + private OchBusStation nextStation; + public void refreshBusStations(List busStationList) { if (getActivity() == null) { return; @@ -98,6 +102,7 @@ public class OchBusFragment extends MvpFragment OchBusStation station = stationList.get(i); if (station.getIsCurrentSite() == OchBusPresenter.STATION_STATUS_LEAVING) { tvNotice.setText("正在从 " + i + "站驶向" + (i + 1) + "站"); + nextStation = stationList.get(i + 1); btnExecute.setVisibility(View.GONE); break; } else if (station.getIsCurrentSite() == OchBusPresenter.STATION_STATUS_STOPED) { @@ -118,7 +123,7 @@ public class OchBusFragment extends MvpFragment } public void hideOchBus() { - groupOchBus.setVisibility(View.GONE); + tvNotice.setVisibility(View.GONE); } private void queryStationListIfNecessary() { diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java index e39bf77784..082b9b0ba5 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java @@ -60,7 +60,7 @@ public class OchBusPresenter extends Presenter implements IMogoA lon = lastLocation.getLongitude(); } OchBusRoutesRequest request = new OchBusRoutesRequest(Utils.getSn(),lat, lon); - RequestBody requestBody = RequestBody.create(MediaType.get("application/json"), GsonUtil.jsonFromObject(request)); + RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request)); MogoApisHandler.getInstance().getApis().getNetworkApi() .create(IOchBusApiService.class, HostConst.OCH_DOMAIN) .querySiteByCoordinate(requestBody) 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 7bc5f71ee0..5801c68cfe 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 @@ -22,6 +22,15 @@ app:layout_constraintRight_toRightOf="@id/vBusRoute" app:layout_constraintTop_toBottomOf="@id/vBusRoute" /> +