改版小地图 实现 方式
This commit is contained in:
@@ -44,10 +44,12 @@ dependencies {
|
||||
api rootProject.ext.dependencies.modulemain
|
||||
implementation rootProject.ext.dependencies.mogooch
|
||||
implementation rootProject.ext.dependencies.moduleservice
|
||||
implementation rootProject.ext.dependencies.moduleSmallMap
|
||||
} else {
|
||||
api project(":modules:mogo-module-main")
|
||||
implementation project(":OCH:mogo-och")
|
||||
implementation project(':modules:mogo-module-service')
|
||||
implementation project(':modules:mogo-module-smp')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.small.map.SmallVisionProvider;
|
||||
import com.mogo.och.IMogoOCH;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
@@ -116,6 +117,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
protected void loadOthersModules() {
|
||||
super.loadOthersModules();
|
||||
loadOCHModule();
|
||||
loadSmpModule();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,6 +130,16 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载小地图模块
|
||||
*/
|
||||
private void loadSmpModule() {
|
||||
SmallVisionProvider smp = ARouter.getInstance().navigation(SmallVisionProvider.class);
|
||||
if (smp != null) {
|
||||
smp.init(this, R.id.module_main_id_smp_fragment);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
@@ -141,6 +141,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--小地图视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_smp_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--冷启动过渡Logo-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/module_main_id_cover_up"
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.amap.api.col.n3.lg;
|
||||
@@ -35,6 +36,8 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
private final String TAG = "SmallVisionProvider";
|
||||
|
||||
private Context mContext;
|
||||
private int mContainerId;
|
||||
private FragmentActivity mActivity;
|
||||
|
||||
private WindowManagerView mWindowManagerView;
|
||||
private SmallMapDirectionView mSmallMapDirectionView;
|
||||
@@ -60,6 +63,12 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
return ModuleType.TYPE_SERVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FragmentActivity activity, int containerId) {
|
||||
mContainerId = containerId;
|
||||
mActivity = activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Log.d(TAG, "小地图模块初始化……");
|
||||
@@ -91,6 +100,7 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
mWindowManagerView = null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showPanel() {
|
||||
Log.d(TAG, "小地图模块触发展示……");
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.service.map;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
@@ -8,6 +11,13 @@ import com.mogo.service.module.IMogoModuleProvider;
|
||||
*/
|
||||
public interface IMogoSmallMapProvider extends IMogoModuleProvider {
|
||||
|
||||
/**
|
||||
* 初始化网约车容器
|
||||
*
|
||||
* @param activity
|
||||
* @param containerId 容器ID
|
||||
*/
|
||||
void init(FragmentActivity activity, @IdRes int containerId );
|
||||
|
||||
/**
|
||||
* 显示面板
|
||||
|
||||
Reference in New Issue
Block a user