Merge branch 'dev' into dev_custom_map

This commit is contained in:
wangcongtao
2020-07-31 15:26:35 +08:00
3 changed files with 25 additions and 25 deletions

View File

@@ -22,16 +22,9 @@ public class MapCenterPointStrategy {
public static final MapCenterPoint DEFAULT = new MapCenterPoint( 0.677734D, 0.5733333D );
public static void init() {
// 普通场景,使用高德内部值
{
Map< Integer, MapCenterPoint > common = new HashMap<>();
common.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
common.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.5D, 0.666666666D ) );
common.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.5D, 0.666666666D ) );
common.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
sStrategies.put( Scene.COMMON, common );
}
private static MapCenterPoint sLastPoint = DEFAULT;
public static void init() {
{
// 选点场景,定位中心点
@@ -112,6 +105,22 @@ public class MapCenterPointStrategy {
categoryV2XEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.65D ) );
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
}
try {
sLastPoint = sStrategies.get( Scene.AIMLESS ).get( CarSeries.getSeries() );
} catch ( Exception e ) {
sLastPoint = DEFAULT;
}
}
public static void restoreLastScene( IMogoMapUIController controller ) {
if ( sLastPoint == null ) {
return;
}
if ( controller == null ) {
return;
}
controller.setPointToCenter( sLastPoint.x, sLastPoint.y );
}
public static void addScene( int scene, Map< Integer, MapCenterPoint > config ) {
@@ -138,6 +147,7 @@ public class MapCenterPointStrategy {
if ( !sStrategies.containsKey( scene ) ) {
Logger.w( TAG, "no strategy for scene: %s, use DEFAULT", scene );
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
sLastPoint = DEFAULT;
return;
}
Map< Integer, MapCenterPoint > points = sStrategies.get( scene );
@@ -145,14 +155,17 @@ public class MapCenterPointStrategy {
if ( !points.containsKey( car ) ) {
Logger.w( TAG, "no strategy for series: %s, use DEFAULT", scene );
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
sLastPoint = DEFAULT;
return;
}
MapCenterPoint point = points.get( car );
if ( point == null ) {
Logger.w( TAG, "no strategy config for series: %s, use DEFAULT", scene );
controller.setPointToCenter( DEFAULT.x, DEFAULT.y );
sLastPoint = DEFAULT;
return;
}
sLastPoint = point;
controller.setPointToCenter( point.x, point.y );
}

View File

@@ -192,6 +192,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
UiThreadHandler.removeCallbacks(mLockCarRunnable);
}
mStatusManager.setUserInteractionStatus(TAG, true, false);
MapCenterPointStrategy.restoreLastScene( mMApUIController );
mMApUIController.recoverLockMode();
}
});
@@ -293,9 +294,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
});
mMsgCounter = findViewById(R.id.module_ext_id_msg_counter);
mUserHeadImg.setOnClickListener(view -> {
// todo 测试代码
// mApis.getEventPanelManager().showPanel();
// 原始逻辑
try {
LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal");
// 埋点
@@ -354,6 +352,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
public void onDestroyView() {
super.onDestroyView();
isClickShare = false;
TopViewAnimHelper.getInstance().removeAllView();
}
@Override

View File

@@ -6,12 +6,8 @@ import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.module.extensions.R;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
@@ -25,18 +21,10 @@ public class TopViewManager implements IMogoTopViewManager {
private Context context;
private LayoutParams parentParams;
private IMogoServiceApis serviceApis;
@Override
public void init(Context context) {
this.context = context;
serviceApis =
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
serviceApis.getStatusManagerApi().registerStatusChangedListener(MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER, StatusDescriptor.MAIN_PAGE_RESUME, (descriptor, isTrue) -> {
if (!isTrue) {
TopViewAnimHelper.getInstance().removeAllView();
}
});
}
@Override