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 bef94a28ea..602792dfea 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 @@ -1,7 +1,6 @@ package com.mogo.och.bus.passenger.ui; import android.content.Context; -import android.graphics.Color; import android.os.Bundle; import android.util.AttributeSet; import android.view.LayoutInflater; @@ -71,6 +70,8 @@ public class BusPassengerMapDirectionView private List mLineMarkers = new ArrayList<>(); private IBusPassengerMapViewCallback mIBusPassengerMapViewCallback; + private BitmapDescriptor mArrivedRes; + private BitmapDescriptor mUnArrivedRes; public BusPassengerMapDirectionView(Context context) { this(context, null); @@ -133,6 +134,9 @@ public class BusPassengerMapDirectionView mEndMarker = mAMap.addMarker(new MarkerOptions() .icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_view_dir_end_point))); + mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_arrived); + mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_un_arrive); + // 加载自定义样式 CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions() .setEnable(true) @@ -182,12 +186,12 @@ public class BusPassengerMapDirectionView if (location == null) { return; } - CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude()); +// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "onCarLocationChanged2 :" + location.getLatitude() + ":" + location.getLongitude()); LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude()); //更新车辆位置 if (mCarMarker != null) { - CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing()); +// CallerLogger.INSTANCE.d(M_BUS_P + TAG, "location.getBearing() = " + location.getBearing()); mCarMarker.setRotateAngle(360 - location.getBearing()); mCarMarker.setPosition(currentLatLng); mCarMarker.setToTop(); @@ -228,8 +232,8 @@ public class BusPassengerMapDirectionView //设置线段纹理 PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.addAll(mCoordinatesLatLng); - polylineOptions.useGradient(true); - polylineOptions.width(10); //线段宽度 + polylineOptions.width(14); //线段宽度 + polylineOptions.setUseTexture(true); polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapRound); polylineOptions.setCustomTextureList(textureList); polylineOptions.setCustomTextureIndex(texIndexList); @@ -251,9 +255,9 @@ public class BusPassengerMapDirectionView texIndexList.clear(); for (int i = 0; i < mCoordinatesLatLng.size(); i++){ if (i <= mHaveArrivedIndex){ - textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_arrived)); + textureList.add(mArrivedRes); }else { - textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.bus_p_map_arrow_un_arrive)); + textureList.add(mUnArrivedRes); } texIndexList.add(i); } diff --git a/OCH/mogo-och-bus-passenger/src/main/res/drawable/bus_p_route_bg.xml b/OCH/mogo-och-bus-passenger/src/main/res/drawable/bus_p_route_bg.xml index 73fbe1f005..94dd7c0007 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/drawable/bus_p_route_bg.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/drawable/bus_p_route_bg.xml @@ -4,8 +4,8 @@ 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 d2a9d7ce32..03e16a4146 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 @@ -52,7 +52,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/dp_56" - android:layout_marginTop="@dimen/dp_28" + android:layout_marginTop="@dimen/dp_40" android:elevation="@dimen/dp_10" android:text="@string/bus_p_cur_station_title" android:textColor="@color/bus_p_panel_cur_txt_color" @@ -65,7 +65,7 @@ android:id="@+id/bus_p_cur_station_name" android:layout_width="@dimen/bus_p_curent_station_txt_width" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_10" + android:layout_marginTop="@dimen/dp_12" android:elevation="@dimen/dp_10" android:ellipsize="end" android:maxLines="1" diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_route_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_route_fragment.xml index 01bff7f219..61e9d4acf9 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_route_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_route_fragment.xml @@ -7,7 +7,7 @@ textureList = new ArrayList<>(); List texIndexList = new ArrayList<>(); + private BitmapDescriptor mArrivedRes; + private BitmapDescriptor mUnArrivedRes; + private ITaxiPassengerMapViewCallback mITaxiPassengerMapViewCallback; public TaxiPassengerMapDirectionView(Context context) { @@ -129,6 +132,9 @@ public class TaxiPassengerMapDirectionView mEndMarker = mAMap.addMarker(new MarkerOptions() .icon(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_view_dir_end))); + mArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_arrived); + mUnArrivedRes = BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_un_arrive); + // 加载自定义样式 CustomMapStyleOptions customMapStyleOptions = new CustomMapStyleOptions() .setEnable(true) @@ -189,7 +195,7 @@ public class TaxiPassengerMapDirectionView boundsBuilder.include(endLatLng); //第二个参数为四周留空宽度 mAMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 100,100,100,100)); - CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--moveCamera :" + location.getLatitude()+", "+location.getLongitude()); +// CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "onCarLocationChanged2--moveCamera :" + location.getLatitude()+", "+location.getLongitude()); } else { //设置希望展示的地图缩放级别 @@ -240,9 +246,7 @@ public class TaxiPassengerMapDirectionView //设置线段纹理 PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.addAll(mCoordinatesLatLng); - //polylineOptions.colorValues(colorList); // 1FC3FF -> 57ABFF - //加上这个属性,表示使用渐变线 - //polylineOptions.useGradient(true); + polylineOptions.setUseTexture(true); polylineOptions.width(15); polylineOptions.lineCapType(PolylineOptions.LineCapType.LineCapRound); polylineOptions.setCustomTextureList(textureList); @@ -264,9 +268,9 @@ public class TaxiPassengerMapDirectionView texIndexList.clear(); for (int i = 0; i < mCoordinatesLatLng.size(); i++){ if (i <= mHaveArrivedIndex){ - textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_arrived)); + textureList.add(mArrivedRes); }else { - textureList.add(BitmapDescriptorFactory.fromResource(R.drawable.taxi_p_map_arrow_un_arrive)); + textureList.add(mUnArrivedRes); } texIndexList.add(i); }