diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java index f66dc6416a..6036c45588 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java @@ -58,6 +58,7 @@ public class BusPassengerMapDirectionView private int zoomLevel = 13; private List mCoordinatesLatLng = new ArrayList<>(); + private List mWayPointsLatLng = new ArrayList<>(); private Polyline mPolyline; private CameraUpdate mCameraUpdate; private Context mContext; @@ -234,6 +235,15 @@ public class BusPassengerMapDirectionView mPolyline = mAMap.addPolyline(polylineOptions); } + + if (mWayPointsLatLng.size() > 0){ + for (int i =0 ;i< mWayPointsLatLng.size(); i++){ + Marker mWayPointMarker = mAMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_way_point))); + mWayPointMarker.setPosition(mWayPointsLatLng.get(i)); + mWayPointMarker.setVisible(true); + } + } } } @@ -325,6 +335,11 @@ public class BusPassengerMapDirectionView mCoordinatesLatLng.addAll(latLngs); } + public void setWayPointMarker(List wayPointLatLngs){ + mWayPointsLatLng.clear(); + mCoordinatesLatLng.addAll(wayPointLatLngs); + } + @Override public void onCameraChange(CameraPosition cameraPosition) { mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing); diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteLineDialogFragment.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteLineDialogFragment.java index 24a78c87d6..39c287e65c 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteLineDialogFragment.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteLineDialogFragment.java @@ -55,6 +55,7 @@ public class BusPassengerRouteLineDialogFragment extends DialogFragment implemen private BusPassengerTrafficLightView mTrafficLightView; private List mStationsList = new ArrayList<>(); + private List mWayPointsList = new ArrayList<>(); private TextView mSpeedTv; private ConstraintLayout mNoLineInfoView; @@ -371,6 +372,7 @@ public class BusPassengerRouteLineDialogFragment extends DialogFragment implemen */ private void drawablePolyline(List coordinates) { if (mMapDirectionView != null) { + mMapDirectionView.setWayPointMarker(mWayPointsList); mMapDirectionView.setCoordinatesLatLng(coordinates); UiThreadHandler.post(new Runnable() { @Override @@ -403,15 +405,30 @@ public class BusPassengerRouteLineDialogFragment extends DialogFragment implemen } public void updateLineInfo(String lineName, String lineDurTime) { - mLineName.setText(lineName); - mOperationTime.setText(lineDurTime); - mCarPlateNum.setText(null == AppConfigInfo.INSTANCE.getPlateNumber() ? "京B65H5B" : AppConfigInfo.INSTANCE.getPlateNumber()); + if (!mLineName.getText().toString().equals(lineName) + || !mOperationTime.getText().toString().equals(lineDurTime) + || !mCarPlateNum.getText().toString().equals(AppConfigInfo.INSTANCE.getPlateNumber())){ + mLineName.setText(lineName); + mOperationTime.setText(lineDurTime); + mCarPlateNum.setText(null == AppConfigInfo.INSTANCE.getPlateNumber() ? "----" : AppConfigInfo.INSTANCE.getPlateNumber()); + } } public void updateStationsInfo(List stations) { mStationsList.clear(); mStationsList.addAll(stations); mAdapter.notifyDataSetChanged(); + if (stations.size() > 2){ + updateWayPointList(stations); + } + } + + private void updateWayPointList(List stations) { + mWayPointsList.clear(); + for (int i = 1; i< stations.size() -1; i++) {//去除路线的起点和终点, 只要中间途径站点 + LatLng latLng = new LatLng(stations.get(i).getLat(),stations.get(i).getLon());// lat,lon + mWayPointsList.add(latLng); + } } @Override diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.java index c06fc646a6..aea35cc715 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.java @@ -146,18 +146,15 @@ public class BusPassengerTrafficLightView extends IViewTrafficLight { UiThreadHandler.post(() -> { switch (lightId) { case 1: - //todo 等待UI给图片 -// mLightIconIV.setBackgroundResource(R.drawable.bus_p_light_red_nor); + mLightIconIV.setBackgroundResource(R.drawable.bus_p_light_red_nor); BusPassengerTrafficLightView.this.setVisibility(VISIBLE); break; case 2: - //todo 等待UI给图片 -// mLightIconIV.setBackgroundResource(R.drawable.bus_p_lightyellow_nor); + mLightIconIV.setBackgroundResource(R.drawable.bus_p_light_yellow_nor); BusPassengerTrafficLightView.this.setVisibility(VISIBLE); break; case 3: - //todo 等待UI给图片 -// mLightIconIV.setBackgroundResource(R.drawable.bus_p_light_green_nor); + mLightIconIV.setBackgroundResource(R.drawable.bus_p_light_green_nor); BusPassengerTrafficLightView.this.setVisibility(VISIBLE); break; default: diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_green_nor.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_green_nor.png new file mode 100644 index 0000000000..76787134b6 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_green_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_red_nor.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_red_nor.png new file mode 100644 index 0000000000..4de4a75e1b Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_red_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_yellow_nor.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_yellow_nor.png new file mode 100644 index 0000000000..74dec29540 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_light_yellow_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_map_view_dir_way_point.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_map_view_dir_way_point.png new file mode 100644 index 0000000000..cb158ffb83 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-sw320dp-xhdpi/bus_p_map_view_dir_way_point.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_green_nor.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_green_nor.png new file mode 100644 index 0000000000..76787134b6 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_green_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_red_nor.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_red_nor.png new file mode 100644 index 0000000000..4de4a75e1b Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_red_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_yellow_nor.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_yellow_nor.png new file mode 100644 index 0000000000..74dec29540 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_light_yellow_nor.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_map_view_dir_way_point.png b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_map_view_dir_way_point.png new file mode 100644 index 0000000000..cb158ffb83 Binary files /dev/null and b/OCH/mogo-och-bus-passenger/src/main/res/drawable-xhdpi/bus_p_map_view_dir_way_point.png differ diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml index 0ba9339fee..4cd1812136 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml @@ -10,6 +10,7 @@ android:layout_height="@dimen/dp_300" android:layout_marginLeft="@dimen/dp_90" android:layout_marginTop="@dimen/dp_90" + android:visibility="gone" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> 158px 90px 45px - 90px + 158px 90px 45px - 60px - 60px + 80px + 90px 3px 224px diff --git a/OCH/mogo-och-bus-passenger/src/main/res/values/dimens.xml b/OCH/mogo-och-bus-passenger/src/main/res/values/dimens.xml index 380958f6bc..45adaf444a 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/values/dimens.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/values/dimens.xml @@ -13,11 +13,11 @@ 158px 90px 45px - 90px + 158px 90px 45px - 60px - 60px + 80px + 90px 3px 224px diff --git a/OCH/mogo-och-taxi/src/main/res/values/strings.xml b/OCH/mogo-och-taxi/src/main/res/values/strings.xml index dc77fb3cef..2d0f07a54c 100644 --- a/OCH/mogo-och-taxi/src/main/res/values/strings.xml +++ b/OCH/mogo-och-taxi/src/main/res/values/strings.xml @@ -21,5 +21,5 @@ 车辆已停稳,请携带好随身物品,下车请注意安全 无人驾驶已启动,请您系好安全带 即将到达目的地,请拿好随身物品,准备下车 - 已达到目的地,感谢乘坐\'蘑菇车联\'无人驾驶车,期待下次相遇 + 已到达目的地,感谢乘坐\'蘑菇车联\'无人驾驶车,期待下次相遇 \ No newline at end of file