1. 解决高德地图导航实例无法inflate的问题
2. 在主页中加载换肤模块
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.impl.amap.AMapViewHandler;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/9/10
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class MogoMapViewInstanceHandler implements IMogoMapViewInstanceHandler {
|
||||
|
||||
private static volatile MogoMapViewInstanceHandler sInstance;
|
||||
|
||||
private MogoMapViewInstanceHandler(){}
|
||||
|
||||
public static MogoMapViewInstanceHandler getInstance(){
|
||||
if( sInstance == null ){
|
||||
synchronized( MogoMapViewInstanceHandler.class ) {
|
||||
if( sInstance == null ){
|
||||
sInstance = new MogoMapViewInstanceHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release(){
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMapViewInstance( Context context ) {
|
||||
AMapViewHandler.createMapView( context );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
AMapViewHandler.destroy();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user