[driver passenger ] bus 乘客屏:1、红绿灯icon更新 2、bus路线中间站点显示
@@ -58,6 +58,7 @@ public class BusPassengerMapDirectionView
|
||||
|
||||
private int zoomLevel = 13;
|
||||
private List<LatLng> mCoordinatesLatLng = new ArrayList<>();
|
||||
private List<LatLng> 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<LatLng> wayPointLatLngs){
|
||||
mWayPointsLatLng.clear();
|
||||
mCoordinatesLatLng.addAll(wayPointLatLngs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange(CameraPosition cameraPosition) {
|
||||
mIBusPassengerMapViewCallback.onCameraChange(cameraPosition.bearing);
|
||||
|
||||
@@ -55,6 +55,7 @@ public class BusPassengerRouteLineDialogFragment extends DialogFragment implemen
|
||||
|
||||
private BusPassengerTrafficLightView mTrafficLightView;
|
||||
private List<BusPassengerStation> mStationsList = new ArrayList<>();
|
||||
private List<LatLng> mWayPointsList = new ArrayList<>();
|
||||
|
||||
private TextView mSpeedTv;
|
||||
private ConstraintLayout mNoLineInfoView;
|
||||
@@ -371,6 +372,7 @@ public class BusPassengerRouteLineDialogFragment extends DialogFragment implemen
|
||||
*/
|
||||
private void drawablePolyline(List<LatLng> 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<BusPassengerStation> stations) {
|
||||
mStationsList.clear();
|
||||
mStationsList.addAll(stations);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
if (stations.size() > 2){
|
||||
updateWayPointList(stations);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWayPointList(List<BusPassengerStation> 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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
@@ -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" />
|
||||
<ImageView
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_left"
|
||||
android:layout_marginTop="@dimen/bus_p_driver_number_plate_margin_top"
|
||||
android:text="京 HBBB"
|
||||
android:text="----"
|
||||
android:textColor="@color/bus_p_driver_number_plate_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
@@ -102,7 +102,10 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:text="15路"
|
||||
android:layout_marginRight="@dimen/dp_20"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:text="----"
|
||||
android:textColor="@color/bus_p_line_name_color"
|
||||
android:textSize="@dimen/bus_p_driver_number_plate_size"
|
||||
android:textStyle="bold"
|
||||
@@ -115,7 +118,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/bus_p_line_operation_time_margin_top"
|
||||
android:text="早 8:00 - 晚 8:00"
|
||||
android:text="-- --"
|
||||
android:textColor="@color/bus_p_line_operation_time_color"
|
||||
android:textSize="@dimen/bus_p_line_operation_time_size"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/bus_p_driver_num_plate_tv"
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
android:layout_height="@dimen/bus_p_traffic_light_bg_height"
|
||||
android:background="@drawable/bg_bus_p_traffic_light_background"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginLeft="@dimen/bus_p_route_info_margin_right"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_p_traffic_light_iv"
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158px</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_height">90px</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_corner">45px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_width">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_width">158px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_height">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_size">45px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">60px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">60px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">80px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_stroke_width">3px</dimen>
|
||||
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224px</dimen>
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
<dimen name="bus_p_route_traffic_light_view_width">158px</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_height">90px</dimen>
|
||||
<dimen name="bus_p_route_traffic_light_view_corner">45px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_width">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_width">158px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_height">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_size">45px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">60px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">60px</dimen>
|
||||
<dimen name="bus_p_traffic_light_time_view_width">80px</dimen>
|
||||
<dimen name="bus_p_traffic_light_icon_size">90px</dimen>
|
||||
<dimen name="bus_p_traffic_light_bg_stroke_width">3px</dimen>
|
||||
|
||||
<dimen name="bus_p_route_dividing_line2_margin_top">224px</dimen>
|
||||
|
||||
@@ -21,5 +21,5 @@
|
||||
<string name="module_och_taxi_order_server_completed_tip">车辆已停稳,请携带好随身物品,下车请注意安全</string>
|
||||
<string name="module_och_taxi_order_server_start_auto_tip">无人驾驶已启动,请您系好安全带</string>
|
||||
<string name="module_och_taxi_order_arrive_end_200m_tip">即将到达目的地,请拿好随身物品,准备下车</string>
|
||||
<string name="module_och_taxi_order_auto_arrive_end_tip">已达到目的地,感谢乘坐\'蘑菇车联\'无人驾驶车,期待下次相遇</string>
|
||||
<string name="module_och_taxi_order_auto_arrive_end_tip">已到达目的地,感谢乘坐\'蘑菇车联\'无人驾驶车,期待下次相遇</string>
|
||||
</resources>
|
||||