* 导航路径管理
*/
-public class NaviOverlayHelper {
+public class NaviOverlayHelper implements MogoCalculatePath.OnItemClickInteraction {
private static final String TAG = "NaviOverlayHelper";
@@ -176,9 +177,15 @@ public class NaviOverlayHelper {
if ( polyline == null ) {
return false;
}
+ return handleClickedPolyline( polyline.getId() );
+ }
- Logger.i( TAG, "polyline id = " + polyline.getId() );
- mSelectedCalculatePathItem = isCalculatePolyline( polyline );
+ private boolean handleClickedPolyline( String id ) {
+ if ( id == null ) {
+ return false;
+ }
+ Logger.i( TAG, "polyline id = " + id );
+ mSelectedCalculatePathItem = isCalculatePolyline( id );
if ( mSelectedCalculatePathItem == null ) {
return false;
}
@@ -199,7 +206,7 @@ public class NaviOverlayHelper {
return true;
}
- private CalculatePathItem isCalculatePolyline( Polyline polyline ) {
+ private CalculatePathItem isCalculatePolyline( String id ) {
CalculatePathItem result = null;
if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) {
return result;
@@ -215,8 +222,7 @@ public class NaviOverlayHelper {
if ( wrapper.getTrafficColorfulPolyline() == null ) {
continue;
}
- if ( TextUtils.equals( wrapper.getTrafficColorfulPolyline().getId(), polyline.getId() )
- || wrapper.getTrafficColorfulPolyline() == polyline ) {
+ if ( TextUtils.equals( wrapper.getTrafficColorfulPolyline().getId(), id ) ) {
result = calculatePathItem;
}
}
@@ -249,4 +255,34 @@ public class NaviOverlayHelper {
}
}
}
+
+
+ public List< MogoCalculatePath > getCalculateStrategies() {
+ List< MogoCalculatePath > paths = new ArrayList<>();
+ if ( mCalculatePathItems != null && !mCalculatePathItems.isEmpty() ) {
+ for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) {
+ MogoCalculatePath path = new MogoCalculatePath( this );
+ path.setDistance( calculatePathItem.getDistance() );
+ path.setPathId( calculatePathItem.getId() );
+ path.setStrategyName( calculatePathItem.getStrategyName() );
+ path.setTime( calculatePathItem.getTime() );
+ path.setTrafficLights( calculatePathItem.getTrafficNumber() );
+ paths.add( path );
+ final RouteOverLayWrapper wrapper = calculatePathItem.getOverLazWrapper( true );
+ if ( wrapper == null ) {
+ continue;
+ }
+ if ( wrapper.getTrafficColorfulPolyline() == null ) {
+ continue;
+ }
+ path.setTagId( wrapper.getTrafficColorfulPolyline().getId() );
+ }
+ }
+ return paths;
+ }
+
+ @Override
+ public void onItemClicked( String tagId ) {
+ handleClickedPolyline( tagId );
+ }
}
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapUtil.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapUtil.java
new file mode 100755
index 0000000000..a7a6f8eabd
--- /dev/null
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/AMapUtil.java
@@ -0,0 +1,268 @@
+package com.mogo.map.impl.amap.overlay;
+
+import android.text.Html;
+import android.text.Spanned;
+import android.widget.EditText;
+
+import com.amap.api.maps.model.LatLng;
+import com.amap.api.services.core.LatLonPoint;
+import com.amap.api.services.route.BusPath;
+import com.amap.api.services.route.BusStep;
+import com.amap.api.services.route.RouteBusLineItem;
+import com.amap.api.services.route.RouteRailwayItem;
+import com.mogo.map.impl.amap.R;
+
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class AMapUtil {
+ /**
+ * 判断edittext是否null
+ */
+ public static String checkEditText(EditText editText) {
+ if (editText != null && editText.getText() != null
+ && !(editText.getText().toString().trim().equals(""))) {
+ return editText.getText().toString().trim();
+ } else {
+ return "";
+ }
+ }
+
+ public static Spanned stringToSpan(String src) {
+ return src == null ? null : Html.fromHtml(src.replace("\n", "
+ * 描述
+ */
+public abstract class OnRouteSearchListenerAdapter implements RouteSearch.OnRouteSearchListener {
+
+ @Override
+ public void onBusRouteSearched( BusRouteResult busRouteResult, int i ) {
+
+ }
+
+ @Override
+ public void onDriveRouteSearched( DriveRouteResult driveRouteResult, int i ) {
+
+ }
+
+ @Override
+ public void onWalkRouteSearched( WalkRouteResult walkRouteResult, int i ) {
+
+ }
+
+ @Override
+ public void onRideRouteSearched( RideRouteResult rideRouteResult, int i ) {
+
+ }
+}
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlay.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlay.java
new file mode 100755
index 0000000000..3dcae30d10
--- /dev/null
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/overlay/RouteOverlay.java
@@ -0,0 +1,236 @@
+package com.mogo.map.impl.amap.overlay;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+
+import com.amap.api.maps.AMap;
+import com.amap.api.maps.CameraUpdateFactory;
+import com.amap.api.maps.model.BitmapDescriptor;
+import com.amap.api.maps.model.BitmapDescriptorFactory;
+import com.amap.api.maps.model.LatLng;
+import com.amap.api.maps.model.LatLngBounds;
+import com.amap.api.maps.model.Marker;
+import com.amap.api.maps.model.MarkerOptions;
+import com.amap.api.maps.model.Polyline;
+import com.amap.api.maps.model.PolylineOptions;
+import com.mogo.map.impl.amap.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class RouteOverlay {
+ protected List
+ * 给定起点、途经点,规划路径
+ */
+public class RouteOverlayHelper {
+
+ private static final String TAG = "RouteOverlayHelper";
+
+ private static volatile RouteOverlayHelper sInstance;
+
+ private DrivingRouteOverlay mDrivingRouteOverlay;
+
+ private RouteOverlayHelper() {
+ }
+
+ public static RouteOverlayHelper getInstance() {
+ if ( sInstance == null ) {
+ synchronized ( RouteOverlayHelper.class ) {
+ if ( sInstance == null ) {
+ sInstance = new RouteOverlayHelper();
+ }
+ }
+ }
+ return sInstance;
+ }
+
+ public synchronized void release() {
+ sInstance = null;
+ }
+
+ public void addRouteWay( final Context context, MogoLatLng start, MogoLatLng end, List< MogoLatLng > wayPoints ) {
+ if ( wayPoints == null || wayPoints.isEmpty() ) {
+ return;
+ }
+ if ( InterceptorHandler.getInstance().ignoreDrawRouteOverlay( context ) ) {
+ Logger.w( TAG, "naviing." );
+ return;
+ }
+
+ if ( mDrivingRouteOverlay != null ) {
+ mDrivingRouteOverlay.removeFromMap();
+ }
+
+ RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo( new LatLonPoint( start.lat, start.lng ),
+ new LatLonPoint( end.lat, end.lng ) );
+ final List< LatLonPoint > ways = new ArrayList<>();
+ for ( MogoLatLng wayPoint : wayPoints ) {
+ ways.add( new LatLonPoint( wayPoint.lat, wayPoint.lng ) );
+ }
+ RouteSearch.DriveRouteQuery query = new RouteSearch.DriveRouteQuery( fromAndTo, 0, ways, null, "" );
+ RouteSearch routeSearch = new RouteSearch( context );
+ routeSearch.calculateDriveRouteAsyn( query );
+ routeSearch.setRouteSearchListener( new OnRouteSearchListenerAdapter() {
+ @Override
+ public void onDriveRouteSearched( DriveRouteResult driveRouteResult, int i ) {
+ super.onDriveRouteSearched( driveRouteResult, i );
+ if ( i != 1000 ) {
+ Logger.e( TAG, "算路失败. code = %d", i );
+ return;
+ }
+ mDrivingRouteOverlay = new DrivingRouteOverlay( context, null,
+ driveRouteResult.getPaths().get( 0 ),
+ driveRouteResult.getStartPos(),
+ driveRouteResult.getTargetPos(),
+ null );
+ mDrivingRouteOverlay.setNodeIconVisibility( false );
+ mDrivingRouteOverlay.setIsColorfulline( false );
+ mDrivingRouteOverlay.addToMap();
+ mDrivingRouteOverlay.zoomToSpan();
+ }
+ } );
+ }
+
+ public void removeAll() {
+ if ( mDrivingRouteOverlay != null ) {
+ mDrivingRouteOverlay.removeFromMap();
+ }
+ mDrivingRouteOverlay = null;
+ }
+}
diff --git a/libraries/map-amap/src/main/res/drawable/amap_bus.png b/libraries/map-amap/src/main/res/drawable/amap_bus.png
new file mode 100755
index 0000000000..66f73f4454
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_bus.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_car.png b/libraries/map-amap/src/main/res/drawable/amap_car.png
new file mode 100755
index 0000000000..b12b10c83f
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_car.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_end.png b/libraries/map-amap/src/main/res/drawable/amap_end.png
new file mode 100755
index 0000000000..5503dc5a28
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_end.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_man.png b/libraries/map-amap/src/main/res/drawable/amap_man.png
new file mode 100755
index 0000000000..16842d5d12
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_man.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_ride.png b/libraries/map-amap/src/main/res/drawable/amap_ride.png
new file mode 100755
index 0000000000..2fa5633c59
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_ride.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_0_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_0_arrow.png
new file mode 100755
index 0000000000..21793fea2b
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_0_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_1_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_1_arrow.png
new file mode 100755
index 0000000000..d7d832857f
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_1_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_2_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_2_arrow.png
new file mode 100755
index 0000000000..c1d019b4ae
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_2_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_3_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_3_arrow.png
new file mode 100755
index 0000000000..b3318ad436
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_3_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_4_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_4_arrow.png
new file mode 100755
index 0000000000..038e63f485
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_4_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_5_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_5_arrow.png
new file mode 100755
index 0000000000..e15ce84e87
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_5_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_6_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_6_arrow.png
new file mode 100755
index 0000000000..9f3540757a
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_6_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_7_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_7_arrow.png
new file mode 100755
index 0000000000..cef675f06f
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_7_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_8_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_8_arrow.png
new file mode 100755
index 0000000000..c4d67d38a4
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_8_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_9_arrow.png b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_9_arrow.png
new file mode 100755
index 0000000000..3c92f82f0d
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_route_color_texture_9_arrow.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_start.png b/libraries/map-amap/src/main/res/drawable/amap_start.png
new file mode 100755
index 0000000000..cd716c8840
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_start.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/amap_through.png b/libraries/map-amap/src/main/res/drawable/amap_through.png
new file mode 100755
index 0000000000..e636b446c1
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/amap_through.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/app_icon.png b/libraries/map-amap/src/main/res/drawable/app_icon.png
new file mode 100644
index 0000000000..c97be4be12
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/app_icon.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/default_image.png b/libraries/map-amap/src/main/res/drawable/default_image.png
new file mode 100644
index 0000000000..fdc210cd25
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/default_image.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir1.png b/libraries/map-amap/src/main/res/drawable/dir1.png
new file mode 100755
index 0000000000..fec3f4ec69
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir1.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir10.png b/libraries/map-amap/src/main/res/drawable/dir10.png
new file mode 100755
index 0000000000..34c2228f6c
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir10.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir11.png b/libraries/map-amap/src/main/res/drawable/dir11.png
new file mode 100755
index 0000000000..df9e8dc67c
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir11.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir12.png b/libraries/map-amap/src/main/res/drawable/dir12.png
new file mode 100755
index 0000000000..a4ba8c22cb
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir12.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir13.png b/libraries/map-amap/src/main/res/drawable/dir13.png
new file mode 100755
index 0000000000..39ad870c5f
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir13.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir14.png b/libraries/map-amap/src/main/res/drawable/dir14.png
new file mode 100755
index 0000000000..a3c1632562
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir14.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir15.png b/libraries/map-amap/src/main/res/drawable/dir15.png
new file mode 100755
index 0000000000..c99fb65b94
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir15.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir16.png b/libraries/map-amap/src/main/res/drawable/dir16.png
new file mode 100755
index 0000000000..86898c2144
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir16.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir2.png b/libraries/map-amap/src/main/res/drawable/dir2.png
new file mode 100755
index 0000000000..750b6fbb7e
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir2.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir3.png b/libraries/map-amap/src/main/res/drawable/dir3.png
new file mode 100755
index 0000000000..8cbe886e81
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir3.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir4.png b/libraries/map-amap/src/main/res/drawable/dir4.png
new file mode 100755
index 0000000000..cfe7d6c0fb
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir4.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir5.png b/libraries/map-amap/src/main/res/drawable/dir5.png
new file mode 100755
index 0000000000..e465d5eec2
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir5.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir6.png b/libraries/map-amap/src/main/res/drawable/dir6.png
new file mode 100755
index 0000000000..0d2f3c0360
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir6.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir7.png b/libraries/map-amap/src/main/res/drawable/dir7.png
new file mode 100755
index 0000000000..e53c9ff451
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir7.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir8.png b/libraries/map-amap/src/main/res/drawable/dir8.png
new file mode 100755
index 0000000000..edfdbe1df0
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir8.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir9.png b/libraries/map-amap/src/main/res/drawable/dir9.png
new file mode 100755
index 0000000000..a762d0b74a
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir9.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir_end.png b/libraries/map-amap/src/main/res/drawable/dir_end.png
new file mode 100755
index 0000000000..f3cb78aed4
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir_end.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir_start.png b/libraries/map-amap/src/main/res/drawable/dir_start.png
new file mode 100755
index 0000000000..4d2a797823
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir_start.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/dir_station.png b/libraries/map-amap/src/main/res/drawable/dir_station.png
new file mode 100755
index 0000000000..2ed622283b
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/dir_station.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/ic_refresh.png b/libraries/map-amap/src/main/res/drawable/ic_refresh.png
new file mode 100644
index 0000000000..d86c3f8024
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/ic_refresh.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/ic_snapshot_ph.png b/libraries/map-amap/src/main/res/drawable/ic_snapshot_ph.png
new file mode 100644
index 0000000000..281f1bb163
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/ic_snapshot_ph.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/join_checkbox_bg.png b/libraries/map-amap/src/main/res/drawable/join_checkbox_bg.png
new file mode 100755
index 0000000000..89d00803c5
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/join_checkbox_bg.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/live_exit.png b/libraries/map-amap/src/main/res/drawable/live_exit.png
new file mode 100644
index 0000000000..7d9b50f159
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/live_exit.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/location_city_image.png b/libraries/map-amap/src/main/res/drawable/location_city_image.png
new file mode 100644
index 0000000000..ce5515c529
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/location_city_image.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/main_solid_left_page_up_normal.png b/libraries/map-amap/src/main/res/drawable/main_solid_left_page_up_normal.png
new file mode 100644
index 0000000000..9c1a2a4aea
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/main_solid_left_page_up_normal.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/main_solid_left_page_up_press.png b/libraries/map-amap/src/main/res/drawable/main_solid_left_page_up_press.png
new file mode 100644
index 0000000000..d927b18877
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/main_solid_left_page_up_press.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/main_solid_right_page_up_normal.png b/libraries/map-amap/src/main/res/drawable/main_solid_right_page_up_normal.png
new file mode 100644
index 0000000000..dda526f475
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/main_solid_right_page_up_normal.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/main_solid_right_page_up_press.png b/libraries/map-amap/src/main/res/drawable/main_solid_right_page_up_press.png
new file mode 100644
index 0000000000..2289209d9a
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/main_solid_right_page_up_press.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/mainpage_location_img.png b/libraries/map-amap/src/main/res/drawable/mainpage_location_img.png
new file mode 100644
index 0000000000..7a463ac3ab
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/mainpage_location_img.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/map_location_normal.png b/libraries/map-amap/src/main/res/drawable/map_location_normal.png
new file mode 100644
index 0000000000..53f5b5a14a
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/map_location_normal.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/map_location_press.png b/libraries/map-amap/src/main/res/drawable/map_location_press.png
new file mode 100644
index 0000000000..e3e430c8d6
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/map_location_press.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/not_join_checkbox_bg.png b/libraries/map-amap/src/main/res/drawable/not_join_checkbox_bg.png
new file mode 100755
index 0000000000..663addd255
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/not_join_checkbox_bg.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/public_arrow_back_iv.png b/libraries/map-amap/src/main/res/drawable/public_arrow_back_iv.png
new file mode 100644
index 0000000000..cd7159e219
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/public_arrow_back_iv.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/search_information_normal.png b/libraries/map-amap/src/main/res/drawable/search_information_normal.png
new file mode 100644
index 0000000000..69529ef0bd
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/search_information_normal.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/search_information_press.png b/libraries/map-amap/src/main/res/drawable/search_information_press.png
new file mode 100644
index 0000000000..8338cc95ae
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/search_information_press.png differ
diff --git a/libraries/map-amap/src/main/res/drawable/video_loading_img.png b/libraries/map-amap/src/main/res/drawable/video_loading_img.png
new file mode 100644
index 0000000000..48be2bdd18
Binary files /dev/null and b/libraries/map-amap/src/main/res/drawable/video_loading_img.png differ
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java
index 8eac9516c3..50c75c5dc1 100644
--- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java
@@ -1,5 +1,9 @@
package com.mogo.map.marker;
+import android.content.Context;
+
+import com.mogo.map.MogoLatLng;
+
import java.util.ArrayList;
import java.util.List;
@@ -55,4 +59,19 @@ public interface IMogoMarkerManager {
* @param tag 需要保留的类型
*/
void removeMarkersExcept( String tag );
+
+ /**
+ * 添加搜索路线
+ *
+ * @param context 上下文
+ * @param startPoint 起点
+ * @param endPoint 终点
+ * @param wayPoints 途经点
+ */
+ void addRouteWay( Context context, MogoLatLng startPoint, MogoLatLng endPoint, List< MogoLatLng > wayPoints );
+
+ /**
+ * 移除添加的导航预测路线
+ */
+ void removeRouteWayOverlay();
}
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java
index c72ff5ffcc..adb910084b 100644
--- a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/IMogoNavi.java
@@ -69,4 +69,11 @@ public interface IMogoNavi {
* @return
*/
boolean isNaviing();
+
+ /**
+ * 获取路线规划策略
+ *
+ * @return 规划的路线
+ */
+ List< MogoCalculatePath > getCalculatedStrategies();
}
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java
new file mode 100644
index 0000000000..6034fddefe
--- /dev/null
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/navi/MogoCalculatePath.java
@@ -0,0 +1,106 @@
+package com.mogo.map.navi;
+
+/**
+ * @author congtaowang
+ * @since 2020-01-08
+ *
+ * 规划路线信息
+ */
+public class MogoCalculatePath {
+
+ /**
+ * 策略名称
+ */
+ public String mStrategyName;
+
+ /**
+ * 时间
+ */
+ public String mTime;
+
+ /**
+ * 距离
+ */
+ public String mDistance;
+
+ /**
+ * 红绿灯个数
+ */
+ public int mTrafficLights;
+
+ /**
+ * 路线ID,用于选择那一条线
+ */
+ public String mTagId;
+
+ /**
+ * 规划的线路ID
+ */
+ public int mPathId;
+
+ /**
+ * 点击事件
+ */
+ public OnItemClickInteraction mOnItemClickInteraction;
+
+ public MogoCalculatePath( OnItemClickInteraction onItemClickInteraction ) {
+ this.mOnItemClickInteraction = onItemClickInteraction;
+ }
+
+ public String getStrategyName() {
+ return mStrategyName;
+ }
+
+ public void setStrategyName( String mStrategyName ) {
+ this.mStrategyName = mStrategyName;
+ }
+
+ public String getTime() {
+ return mTime;
+ }
+
+ public void setTime( String mTime ) {
+ this.mTime = mTime;
+ }
+
+ public String getDistance() {
+ return mDistance;
+ }
+
+ public void setDistance( String mDistance ) {
+ this.mDistance = mDistance;
+ }
+
+ public int getTrafficLights() {
+ return mTrafficLights;
+ }
+
+ public void setTrafficLights( int mTrafficLights ) {
+ this.mTrafficLights = mTrafficLights;
+ }
+
+ public String getTagId() {
+ return mTagId;
+ }
+
+ public void setTagId( String mTagId ) {
+ this.mTagId = mTagId;
+ }
+
+ public int getPathId() {
+ return mPathId;
+ }
+
+ public void setPathId( int mPathId ) {
+ this.mPathId = mPathId;
+ }
+
+ public interface OnItemClickInteraction {
+
+ void onItemClicked( String tagId );
+ }
+
+ public OnItemClickInteraction getOnItemClickInteraction() {
+ return mOnItemClickInteraction;
+ }
+}
diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java
index 7e9baa5ef9..3072f7e06d 100644
--- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java
+++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java
@@ -3,6 +3,7 @@ package com.mogo.map;
import android.content.Context;
import com.mogo.map.impl.amap.InterceptorHandler;
+import com.mogo.map.impl.amap.overlay.RouteOverlayHelper;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
@@ -81,4 +82,14 @@ public class MogoMarkerManager implements IMogoMarkerManager {
public void removeMarkersExcept( String tag ) {
MogoMarkersHandler.getInstance().deleteAllExcept( tag );
}
+
+ @Override
+ public void addRouteWay( Context context, MogoLatLng startPoint, MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
+ RouteOverlayHelper.getInstance().addRouteWay( context, startPoint, endPoint, wayPoints );
+ }
+
+ @Override
+ public void removeRouteWayOverlay() {
+ RouteOverlayHelper.getInstance().removeAll();
+ }
}
diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java
index 4dca64d5c6..48be28d3a7 100644
--- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java
+++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoNavi.java
@@ -4,6 +4,7 @@ import android.content.Context;
import com.mogo.map.impl.amap.navi.NaviClient;
import com.mogo.map.navi.IMogoNavi;
+import com.mogo.map.navi.MogoCalculatePath;
import com.mogo.map.navi.MogoNaviConfig;
import java.util.List;
@@ -95,4 +96,12 @@ public class MogoNavi implements IMogoNavi {
}
return false;
}
+
+ @Override
+ public List< MogoCalculatePath > getCalculatedStrategies() {
+ if ( mDelegate != null ) {
+ return mDelegate.getCalculatedStrategies();
+ }
+ return null;
+ }
}
diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/receiver/AppInstallReceiver.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/receiver/AppInstallReceiver.java
index a75f52ee00..218704c86a 100644
--- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/receiver/AppInstallReceiver.java
+++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/receiver/AppInstallReceiver.java
@@ -6,6 +6,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import com.mogo.module.apps.RefreshAppsListLiveData;
+
public class AppInstallReceiver extends BroadcastReceiver {
@Override
@@ -37,6 +39,6 @@ public class AppInstallReceiver extends BroadcastReceiver {
}
private void notifyRefreshAppsList( String packageName ) {
-
+ RefreshAppsListLiveData.getInstance().postValue( packageName );
}
}
\ No newline at end of file
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
index 16cd869302..95a59f095f 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/MainActivity.java
@@ -1,6 +1,12 @@
package com.mogo.module.main;
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.os.Build;
import android.os.Bundle;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
+import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
@@ -33,6 +39,7 @@ import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.utils.logger.Logger;
import java.util.List;
+import java.util.UUID;
/**
* @author congtaowang
"));
+ }
+
+ public static String colorFont(String src, String color) {
+ StringBuffer strBuf = new StringBuffer();
+
+ strBuf.append("").append(src)
+ .append("");
+ return strBuf.toString();
+ }
+
+ public static String makeHtmlNewLine() {
+ return "
";
+ }
+
+ public static String makeHtmlSpace(int number) {
+ final String space = " ";
+ StringBuilder result = new StringBuilder();
+ for (int i = 0; i < number; i++) {
+ result.append(space);
+ }
+ return result.toString();
+ }
+
+ public static String getFriendlyLength(int lenMeter) {
+ if (lenMeter > 10000) // 10 km
+ {
+ int dis = lenMeter / 1000;
+ return dis + ChString.Kilometer;
+ }
+
+ if (lenMeter > 1000) {
+ float dis = (float) lenMeter / 1000;
+ DecimalFormat fnum = new DecimalFormat("##0.0");
+ String dstr = fnum.format(dis);
+ return dstr + ChString.Kilometer;
+ }
+
+ if (lenMeter > 100) {
+ int dis = lenMeter / 50 * 50;
+ return dis + ChString.Meter;
+ }
+
+ int dis = lenMeter / 10 * 10;
+ if (dis == 0) {
+ dis = 10;
+ }
+
+ return dis + ChString.Meter;
+ }
+
+ public static boolean IsEmptyOrNullString(String s) {
+ return (s == null) || (s.trim().length() == 0);
+ }
+
+ /**
+ * 把LatLng对象转化为LatLonPoint对象
+ */
+ public static LatLonPoint convertToLatLonPoint(LatLng latlon) {
+ return new LatLonPoint(latlon.latitude, latlon.longitude);
+ }
+
+ /**
+ * 把LatLonPoint对象转化为LatLon对象
+ */
+ public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
+ return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
+ }
+
+ /**
+ * 把集合体的LatLonPoint转化为集合体的LatLng
+ */
+ public static ArrayList