diff --git a/.idea/misc.xml b/.idea/misc.xml
index 707ee6e613..2dc54c489f 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index ed77fba51f..fe76aac9ed 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,9 +8,6 @@ buildscript {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
- maven {
- url 'http://nexus.zhidaoauto.com/repository/maven-snapshots/'
- }
maven {
url 'http://nexus.zhidaoauto.com/repository/maven-releases/'
}
@@ -34,9 +31,6 @@ allprojects {
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
- maven {
- url 'http://nexus.zhidaoauto.com/repository/maven-snapshots/'
- }
maven {
url 'http://nexus.zhidaoauto.com/repository/maven-releases/'
}
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java
index fcec7571f1..5aa3bb966e 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java
@@ -4,6 +4,7 @@ import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Point;
+import android.graphics.Rect;
import android.os.Bundle;
import android.os.SystemClock;
import android.view.MotionEvent;
@@ -15,6 +16,8 @@ import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.CameraPosition;
import com.amap.api.maps.model.LatLng;
+import com.amap.api.maps.model.LatLngBounds;
+import com.amap.api.maps.model.LatLngBoundsCreator;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MyLocationStyle;
import com.amap.api.maps.model.Poi;
@@ -42,6 +45,8 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.logger.Logger;
+import java.util.List;
+
import retrofit2.http.HEAD;
/**
@@ -465,10 +470,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
@Override
- public void setLockZoom(int var1) {
+ public void setLockZoom( int var1 ) {
if ( checkAMapView() ) {
Logger.d( TAG, "锁定锁车比例尺" );
- mMapView.setLockZoom(var1);
+ mMapView.setLockZoom( var1 );
}
}
@@ -624,14 +629,14 @@ public class AMapNaviViewWrapper implements IMogoMapView,
/**
* 模拟点击事件,达到锁车->普通事件
*/
- private void mockTouchEvent(){
+ private void mockTouchEvent() {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis() + 100;
int metaState = 0;
- MotionEvent motionEvent = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, metaState);
- mMapView.dispatchTouchEvent(motionEvent);
- MotionEvent upEvent = MotionEvent.obtain(downTime + 100, eventTime + 100, MotionEvent.ACTION_UP, 0,0, metaState);
- mMapView.dispatchTouchEvent(upEvent);
+ MotionEvent motionEvent = MotionEvent.obtain( downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, metaState );
+ mMapView.dispatchTouchEvent( motionEvent );
+ MotionEvent upEvent = MotionEvent.obtain( downTime + 100, eventTime + 100, MotionEvent.ACTION_UP, 0, 0, metaState );
+ mMapView.dispatchTouchEvent( upEvent );
}
@Override
@@ -643,4 +648,26 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
}
}
+
+ @Override
+ public void showBounds( List< MogoLatLng > lonLats, Rect bound ) {
+ if ( checkAMapView() ) {
+ if ( lonLats == null ) {
+ return;
+ }
+ try {
+ LatLngBounds.Builder builder = new LatLngBounds.Builder();
+ for ( MogoLatLng lonLat : lonLats ) {
+ builder.include( ObjectUtils.fromMogo2( lonLat ) );
+ }
+ if ( bound == null ) {
+ bound = new Rect();
+ }
+ LatLngBounds latLngBounds = builder.build();
+ mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLngBoundsRect( latLngBounds, bound.left, bound.right, bound.top, bound.bottom ) );
+ } catch ( Exception e ) {
+ Logger.e( TAG, e, "error." );
+ }
+ }
+ }
}
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java
index aa872c69b9..5b072919c5 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/uicontroller/AMapUIController.java
@@ -1,6 +1,7 @@
package com.mogo.map.impl.amap.uicontroller;
import android.graphics.Point;
+import android.graphics.Rect;
import android.view.animation.Interpolator;
import com.mogo.map.MogoLatLng;
@@ -10,6 +11,8 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.utils.logger.Logger;
+import java.util.List;
+
/**
* @author congtaowang
* @since 2019-12-26
@@ -184,4 +187,11 @@ public class AMapUIController implements IMogoMapUIController {
mClient.setRenderFps( fps );
}
}
+
+ @Override
+ public void showBounds( List< MogoLatLng > lonLats, Rect bound ) {
+ if ( mClient != null ) {
+ mClient.showBounds( lonLats, bound );
+ }
+ }
}
diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java
index 764808e96c..e3e74fe034 100644
--- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java
+++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java
@@ -1,11 +1,14 @@
package com.mogo.map.uicontroller;
import android.graphics.Point;
+import android.graphics.Rect;
import android.view.animation.Interpolator;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
+import java.util.List;
+
/**
* @author congtaowang
* @since 2019-12-26
@@ -146,4 +149,10 @@ public interface IMogoMapUIController {
* @param fps
*/
void setRenderFps( int fps );
+
+ /**
+ * @param lonLats 经纬度围成的范围
+ * @param bound 地图上可显示的范围
+ */
+ void showBounds( List< MogoLatLng > lonLats, Rect bound );
}
diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java
index b1f6d6e6f6..a805cf6d88 100644
--- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java
+++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java
@@ -1,6 +1,7 @@
package com.mogo.map;
import android.graphics.Point;
+import android.graphics.Rect;
import android.view.animation.Interpolator;
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
@@ -8,6 +9,8 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
+import java.util.List;
+
/**
* @author congtaowang
* @since 2019-12-26
@@ -177,4 +180,11 @@ public class MogoMapUIController implements IMogoMapUIController {
mDelegate.setRenderFps( fps );
}
}
+
+ @Override
+ public void showBounds( List< MogoLatLng > lonLats, Rect bound ) {
+ if ( mDelegate != null ) {
+ mDelegate.showBounds( lonLats, bound );
+ }
+ }
}
diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
index d4b7a7baf5..5c12f60e1a 100644
--- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
+++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
@@ -1,5 +1,6 @@
package com.mogo.module.extensions.entrance;
+import android.graphics.Rect;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
@@ -39,6 +40,7 @@ import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.statusmanager.IMogoStatusManager;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -50,7 +52,7 @@ import java.util.Map;
*/
public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresenter > implements EntranceView,
IMogoNaviListener, IMogoMapListener {
-
+
private static final String TAG = "EntranceFragment";
@@ -122,8 +124,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
mUploadRoadCondition.setOnClickListener( view -> {
- ShareControl.getInstance(getActivity()).showDialog();
- traceData("1");
+ ShareControl.getInstance( getActivity() ).showDialog();
+ traceData( "1" );
} );
mVRMode = findViewById( R.id.module_entrance_id_vr_mode );
@@ -138,7 +140,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mMApUIController.changeZoom( 16.0f );
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
mMApUIController.recoverLockMode();
-// mMApUIController.moveToCenter( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
}
} );
@@ -147,8 +148,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mExitNavi.setOnClickListener( view -> {
if ( mMogoNavi != null ) {
//if ( mIsLock ) {
- NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog( getContext() );
- naviNoticeDialog.show();
+ NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog( getContext() );
+ naviNoticeDialog.show();
//} else {
// mMApUIController.recoverLockMode();
//}
@@ -163,7 +164,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
@NonNull
@Override
protected EntrancePresenter createPresenter() {
- return new EntrancePresenter(getContext(), this );
+ return new EntrancePresenter( getContext(), this );
}
@Override
@@ -174,8 +175,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mMApUIController = mService.getMapUIController();
mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
mMogoNavi = mService.getNavi( getContext() );
- mAnalytics = (IMogoAnalytics) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(getContext());
- mMogoStatusManager = (IMogoStatusManager )ARouter.getInstance().build( MogoServicePaths.PATH_STATUS_MANAGER ).navigation( getContext() );
+ mAnalytics = ( IMogoAnalytics ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_ANALYTICS ).navigation( getContext() );
+ mMogoStatusManager = ( IMogoStatusManager ) ARouter.getInstance().build( MogoServicePaths.PATH_STATUS_MANAGER ).navigation( getContext() );
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
@@ -280,10 +281,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
}
- private void traceData(String from) {
- Map properties = new HashMap<>();
- properties.put("from", from);
- mAnalytics.track("Launcher_Share_Click", properties);
+ private void traceData( String from ) {
+ Map< String, Object > properties = new HashMap<>();
+ properties.put( "from", from );
+ mAnalytics.track( "Launcher_Share_Click", properties );
}
}