diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 663459aa50..0d156937bb 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -3,9 +3,18 @@
+ * 描述
+ */
+class SmallMapDelegateFactory {
+
+ private static final String TAG = "MogoMapDelegateFactory";
+
+ private static IMogoMapApiBuilder sApiBuilder;
+
+ private static IMogoMapApiBuilder getApiBuilder() {
+ if ( sApiBuilder == null ) {
+ synchronized ( SmallMapDelegateFactory.class ) {
+ if ( sApiBuilder == null ) {
+ sApiBuilder = ARouter.getInstance().navigation( IMogoMapApiBuilder.class );
+ }
+ }
+ }
+ return sApiBuilder;
+ }
+
+
+ public static IMogoAimless getAimless( Context context ) {
+ return getApiBuilder().getAimless( context );
+ }
+
+ public static void createMapViewInstance( Context context ) {
+ getApiBuilder().createMapView( context );
+ }
+
+ public static void destroy() {
+ getApiBuilder().destroy();
+ }
+
+ public static IMogoMapView getMapView(Context context ) {
+ return getApiBuilder().getMapView( context );
+ }
+
+ public static IMogoTrafficSearch getTrafficSearch() {
+ return getApiBuilder().getTrafficSearch();
+ }
+}
diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java
index de26ba6776..bdf5c46fa9 100644
--- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java
+++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapService.java
@@ -79,8 +79,8 @@ public class SmallMapService extends Service {
WindowManager.LayoutParams.WRAP_CONTENT
)
.position(
- getResources().getDimensionPixelOffset(R.dimen.module_mvision_view_x),
- getResources().getDimensionPixelOffset(R.dimen.module_mvision_view_y)
+ getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_x),
+ getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_y)
)
.gravity(Gravity.TOP | Gravity.LEFT)
.showInWindowManager();
diff --git a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java
index 62e75cdc07..139eb28c22 100644
--- a/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java
+++ b/modules/mogo-module-smp/src/main/java/com/mogo/module/small/map/SmallMapView.java
@@ -1,7 +1,11 @@
package com.mogo.module.small.map;
import android.content.Context;
+import android.os.Bundle;
import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
import androidx.annotation.Nullable;
@@ -31,5 +35,52 @@ public class SmallMapView extends MogoBaseMapView {
@Override
protected void addMapView(Context context) {
Logger.d(TAG, "addMapView");
+ mMapView = SmallMapDelegateFactory.getMapView(context);
+ if (mMapView != null) {
+ final View mapView = mMapView.getMapView();
+ if (mapView != null) {
+ addView(mapView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+ } else {
+ Logger.e(TAG, "create MapView instance failed.");
+ }
+ } else {
+ Logger.e(TAG, "create IMogoMapView instance failed.");
+ }
}
+
+
+ @Override
+ public void onCreate( Bundle bundle ) {
+ super.onCreate( bundle );
+ Logger.d( TAG, "onCreate" );
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ Logger.d( TAG, "onResume" );
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ Logger.d( TAG, "onPause" );
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ Logger.d( TAG, "onDestroy" );
+ }
+
+ @Override
+ public void onSaveInstanceState( Bundle outState ) {
+ super.onSaveInstanceState( outState );
+ }
+
+ @Override
+ public void onLowMemory() {
+ super.onLowMemory();
+ }
+
}
\ No newline at end of file
diff --git a/modules/mogo-module-smp/src/main/res/layout/module_small_map_view.xml b/modules/mogo-module-smp/src/main/res/layout/module_small_map_view.xml
index e5d1dbfe79..346805d461 100644
--- a/modules/mogo-module-smp/src/main/res/layout/module_small_map_view.xml
+++ b/modules/mogo-module-smp/src/main/res/layout/module_small_map_view.xml
@@ -1,16 +1,31 @@