merge branch
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -59,7 +59,6 @@
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-splash-noop" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-v2x" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-widgets" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-modules-mvision" />
|
||||
<option value="$PROJECT_DIR$/services" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service-api" />
|
||||
|
||||
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
@@ -1,5 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ASMIdeaPluginConfiguration">
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ASMPluginConfiguration">
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
|
||||
BIN
bak/screenrecord
Normal file
BIN
bak/screenrecord
Normal file
Binary file not shown.
@@ -26,13 +26,13 @@ class HttpDnsNoop implements IMogoHttpDns {
|
||||
|
||||
@Override
|
||||
public String getCachedHttpDnsIps( String host,int type ) {
|
||||
return null;
|
||||
return host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHttpDnsIp( String host,int type, boolean useCache, IHttpDnsCallback callback ) {
|
||||
if ( callback != null ) {
|
||||
callback.onParsed( null );
|
||||
callback.onParsed( host );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
@Keep
|
||||
public class WebSocketConstant {
|
||||
|
||||
private static final String HOST_DEV = "ws://62.234.196.121";
|
||||
private static final String HOST_QA = "ws://62.234.196.121";
|
||||
private static final String HOST_DEMO = "ws://62.234.196.121";
|
||||
private static final String HOST_DEV = "ws://119.45.249.167";
|
||||
private static final String HOST_QA = "ws://119.45.249.167";
|
||||
private static final String HOST_DEMO = "ws://119.45.249.167";
|
||||
@Keep
|
||||
private static final String HOST_RELEASE = "ws://62.234.196.121";
|
||||
private static final String HOST_RELEASE = "ws://119.45.249.167";
|
||||
// private static final String PORT = ":14001/ws";
|
||||
@Keep
|
||||
public static final String PATH = "/ws";
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.base.websocket;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
@@ -186,7 +187,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
|
||||
@Override
|
||||
public void handleMessage(String message) {
|
||||
Logger.d(TAG, "websocket received msg = " + message);
|
||||
Logger.d(TAG, "websocket received msg = %s", message);
|
||||
WebSocketData webSocketData = GsonUtil.objectFromJson(message, WebSocketData.class);
|
||||
int msgType = webSocketData.getMsgType();
|
||||
Logger.d(TAG, "websocket received msg type = " + msgType);
|
||||
@@ -198,9 +199,11 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
while (iterator.hasNext()) {
|
||||
IMogoOnWebSocketMessageListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = " + webSocketData.getData());
|
||||
Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = %s", webSocketData.getData());
|
||||
Object receiveObj = GsonUtil.objectFromJson(webSocketData.getData(),listener.target());
|
||||
final long start = System.currentTimeMillis();
|
||||
listener.onMsgReceived(receiveObj);
|
||||
Logger.d("WebSocketManager-sdk-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,4 +76,44 @@ public class CoordinateUtils {
|
||||
return var10000;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lon1
|
||||
* @param lat1
|
||||
* @param lon2
|
||||
* @param lat2
|
||||
* @return 两坐标的距离 单位:米(M)
|
||||
*/
|
||||
public static float calculateLineDistance( double lon1, double lat1, double lon2, double lat2 ) {
|
||||
try {
|
||||
double var2 = lon1;
|
||||
double var4 = lat1;
|
||||
double var6 = lon2;
|
||||
double var8 = lat2;
|
||||
var2 *= 0.01745329251994329D;
|
||||
var4 *= 0.01745329251994329D;
|
||||
var6 *= 0.01745329251994329D;
|
||||
var8 *= 0.01745329251994329D;
|
||||
double var10 = Math.sin( var2 );
|
||||
double var12 = Math.sin( var4 );
|
||||
double var14 = Math.cos( var2 );
|
||||
double var16 = Math.cos( var4 );
|
||||
double var18 = Math.sin( var6 );
|
||||
double var20 = Math.sin( var8 );
|
||||
double var22 = Math.cos( var6 );
|
||||
double var24 = Math.cos( var8 );
|
||||
double[] var28 = new double[3];
|
||||
double[] var29 = new double[3];
|
||||
var28[0] = var16 * var14;
|
||||
var28[1] = var16 * var10;
|
||||
var28[2] = var12;
|
||||
var29[0] = var24 * var22;
|
||||
var29[1] = var24 * var18;
|
||||
var29[2] = var20;
|
||||
return ( float ) ( Math.asin( Math.sqrt( ( var28[0] - var29[0] ) * ( var28[0] - var29[0] ) + ( var28[1] - var29[1] ) * ( var28[1] - var29[1] ) + ( var28[2] - var29[2] ) * ( var28[2] - var29[2] ) ) / 2.0D ) * 1.27420015798544E7D );
|
||||
} catch ( Throwable var26 ) {
|
||||
var26.printStackTrace();
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,11 +20,12 @@ public class ViewUtils {
|
||||
view.destroyDrawingCache();
|
||||
view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
|
||||
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
|
||||
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas( bitmap );
|
||||
view.draw( canvas );
|
||||
return bitmap;
|
||||
// return (bitmap = view.getDrawingCache()) != null ? bitmap.copy(Bitmap.Config.ARGB_8888, false) : null;
|
||||
// Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
// Canvas canvas = new Canvas( bitmap );
|
||||
// view.draw( canvas );
|
||||
// return bitmap;
|
||||
Bitmap bitmap = null;
|
||||
return (bitmap = view.getDrawingCache()) != null ? bitmap.copy(Bitmap.Config.ARGB_8888, false) : null;
|
||||
}
|
||||
|
||||
public static void processChildView(View view) {
|
||||
|
||||
@@ -239,7 +239,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
public void onDestroy() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onDestroy();
|
||||
AMapUIController.getInstance().release();
|
||||
AMapUIController.release();
|
||||
AMapWrapper.release();
|
||||
Logger.d( TAG, "map onDestroy" );
|
||||
}
|
||||
|
||||
@@ -47,11 +47,16 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
public void initClient(IMogoMapUIController client) {
|
||||
Logger.d( "whatthefuck-AMapUIController", "init %s", this );
|
||||
this.mClient = client;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
public synchronized void destroy(){
|
||||
mClient = null;
|
||||
}
|
||||
|
||||
public static synchronized void release() {
|
||||
sInstance.destroy();
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@@ -80,6 +85,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void changeMapMode(EnumMapUI mode) {
|
||||
Logger.d( "whatthefuck-AMapUIController", "%s", this );
|
||||
if (mClient != null) {
|
||||
mClient.changeMapMode(mode);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ class MogoMapApi {
|
||||
public static IMogoMapApiBuilder getApiBuilder() {
|
||||
if ( sApiBuilder == null ) {
|
||||
synchronized ( AutoNaviClient.class ) {
|
||||
sApiBuilder = ARouter.getInstance().navigation( IMogoMapApiBuilder.class );
|
||||
if ( sApiBuilder == null ) {
|
||||
sApiBuilder = ARouter.getInstance().navigation( IMogoMapApiBuilder.class );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sApiBuilder;
|
||||
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.7'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.8.1'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.5-log-1'
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
@@ -70,7 +71,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private IMogoMap mIMap;
|
||||
|
||||
private AMapMarkerClickHandler mMarkerClickHandler;
|
||||
private EnumMapUI mCurrentUIMode;
|
||||
private EnumMapUI mCurrentCarUIMode;
|
||||
|
||||
private boolean mIsCarLocked = false;
|
||||
private int mLockZoom = 16;
|
||||
@@ -85,6 +86,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
private Location mLastDriveLocationShadow = null;
|
||||
private EnumMapUI mCurrentUI;
|
||||
private boolean mIsLightStyle = false;
|
||||
private boolean mMapLoaded = false;
|
||||
private boolean mIsFirstLocated = true;
|
||||
private boolean mIsDelayed = false;
|
||||
|
||||
public AMapViewWrapper( MapAutoView mMapView ) {
|
||||
startTime = System.currentTimeMillis();
|
||||
@@ -216,8 +221,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onCreate( bundle );
|
||||
Logger.d( TAG, "map onCreate" );
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +244,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onDestroy() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onDestroy();
|
||||
mMapView.setOnMarkClickListener( null );
|
||||
mMapView.setOnMapLoadedListener( null );
|
||||
mMapView.setOnMapTouchListener( null );
|
||||
mMapView.setOnMapClickListener( null );
|
||||
mMapView.getLocationClient().unRegisterListener( this );
|
||||
mMapView.setMOnCameraChangeListener( null );
|
||||
Logger.d( TAG, "map onDestroy" );
|
||||
}
|
||||
}
|
||||
@@ -297,13 +306,13 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom( float zoom ) {
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
Logger.d( TAG, "changeZoom %s", zoom );
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
getMap().changeZoom( zoom );
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
@@ -313,6 +322,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if ( ui == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "设置的样式 = %s", ui );
|
||||
if ( checkAMapView() ) {
|
||||
switch ( ui ) {
|
||||
case CarUp_2D:
|
||||
@@ -326,10 +336,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
case Type_Light:
|
||||
mMapView.getMapAutoViewHelper().setAutoSwitchStyle( false );
|
||||
mMapView.getMapAutoViewHelper().setMapStyle( MapAutoApi.MAP_STYLE_DAY );
|
||||
mIsLightStyle = true;
|
||||
break;
|
||||
case Type_Night:
|
||||
mMapView.getMapAutoViewHelper().setAutoSwitchStyle( false );
|
||||
mMapView.getMapAutoViewHelper().setMapStyle( MapAutoApi.MAP_STYLE_NIGHT );
|
||||
mIsLightStyle = false;
|
||||
break;
|
||||
case Type_AUTO_LIGHT_Night:
|
||||
mMapView.getMapAutoViewHelper().setAutoSwitchStyle( true );
|
||||
@@ -341,11 +353,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void moveToCenter( MogoLatLng latLng ) {
|
||||
|
||||
moveToCenter( latLng, true );
|
||||
}
|
||||
|
||||
private void setUIMode( EnumMapUI ui ) {
|
||||
this.mCurrentUIMode = ui;
|
||||
this.mCurrentCarUIMode = ui;
|
||||
if ( mMapView.getMapAutoViewHelper() != null ) {
|
||||
switch ( ui ) {
|
||||
case CarUp_2D:
|
||||
@@ -353,6 +365,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective( MapAutoApi.MAP_PERSPECTIVE_UP_CAR );
|
||||
break;
|
||||
case NorthUP_2D:
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective( MapAutoApi.MAP_PERSPECTIVE_UP_NORTH );
|
||||
break;
|
||||
}
|
||||
@@ -369,6 +384,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void moveToCenter( MogoLatLng latLng, boolean animate ) {
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "move to center %s", latLng );
|
||||
if ( latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d ) {
|
||||
Logger.e( TAG, "latlng = null or is illegal" );
|
||||
@@ -384,6 +402,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
Logger.d( TAG, "showMyLocation1 %s", visible );
|
||||
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
@@ -436,6 +459,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
// if ( DebugConfig.isDebug() ) {
|
||||
// Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
// }
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "锁车" );
|
||||
// mMapView.getMapAutoViewHelper().setZoom(mLockZoom);
|
||||
mMapView.getMapAutoViewHelper().setLockMode( true );
|
||||
@@ -445,8 +471,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void loseLockMode() {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "解锁锁车" );
|
||||
mMapView.getMapAutoViewHelper().setLockMode( false );
|
||||
@@ -501,6 +527,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( checkAMapView() ) {
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY );
|
||||
mMapView.getMapAutoViewHelper().setPointToCenter( ( float ) mapCenterX, ( float ) mapCenterY );
|
||||
}
|
||||
@@ -572,11 +601,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if ( !checkAMapView() ) {
|
||||
return;
|
||||
}
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
Logger.w( TAG, "vr 模式下忽略该设置" );
|
||||
return;
|
||||
}
|
||||
Logger.i( TAG, "showBounds:%s -%s-%s- %b ", tag, carPosition.toString(), bound.toShortString(), lockCarPosition );
|
||||
try {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds( carPosition, lonLats, lockCarPosition );
|
||||
if ( !lockCarPosition ) {
|
||||
loseLockMode();
|
||||
@@ -606,7 +636,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public EnumMapUI getCurrentUiMode() {
|
||||
return mCurrentUIMode;
|
||||
return mCurrentCarUIMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -620,6 +650,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption( CarCursorOption option ) {
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
return;
|
||||
}
|
||||
if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) {
|
||||
mCarCursorOption.destroy();
|
||||
}
|
||||
@@ -690,7 +723,23 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
NaviClient.getInstance( getContext() ).syncCarLocation( sysLocation );
|
||||
MapStyleController.getInstance().onLocationChanged( location, this );
|
||||
if ( checkAMapView() && mMapLoaded ) {
|
||||
// 地图初始化完成后,每隔5s自动判断当前地图的模式
|
||||
if ( mIsFirstLocated ) {
|
||||
if ( !mIsDelayed ) {
|
||||
mIsDelayed = true;
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
Logger.d( TAG, "倒计时结束" );
|
||||
mIsFirstLocated = false;
|
||||
}, 5_000L );
|
||||
}
|
||||
} else {
|
||||
mIsFirstLocated = true;
|
||||
mIsDelayed = false;
|
||||
Logger.d( TAG, "同步定位" );
|
||||
MapStyleController.getInstance().onLocationChanged( location, this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -705,6 +754,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onMapLoaded() {
|
||||
Logger.i( TAG, "autoop--onMapLoaded: " );
|
||||
MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
if ( cameraPosition != null ) {
|
||||
Trace.beginSection( "timer.onCameraChangeFinish" );
|
||||
@@ -714,9 +764,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
cameraPosition.getBearing() );
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
getMap().getUIController().setAnchorRate( 0.01f );
|
||||
getMap().getUIController().setAnchorScale( 1.2f, 2.7f );
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -737,17 +786,17 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void onMapStatusChanged( int type, int value ) {
|
||||
Logger.i( TAG, "mapop--onMapStatusChanged-: " + type + "," + value );
|
||||
// Logger.i( TAG, "mapop--onMapStatusChanged-: " + type + "," + value );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange( int type, int value ) {
|
||||
Logger.i( TAG, "mapop--onCameraChange-: " + type + "," + value );
|
||||
// Logger.i( TAG, "mapop--onCameraChange-: " + type + "," + value );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChangeFinish( @Nullable CameraPosition cameraPosition ) {
|
||||
Logger.i( TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
|
||||
// Logger.i( TAG, "mapop--onCameraChangeFinish-: " + cameraPosition + "cost:" + ( System.currentTimeMillis() - startTime ) );
|
||||
if ( cameraPosition != null ) {
|
||||
Trace.beginSection( "timer.onCameraChangeFinish" );
|
||||
MogoMapListenerHandler.getInstance().onMapChanged( ObjectUtils.fromAMap( cameraPosition.getTarget() ),
|
||||
@@ -773,8 +822,15 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
}
|
||||
|
||||
//目前切换完vr之后,会立即回调其他样式,这里做一个判断
|
||||
// private boolean mVrModeAutoChangedFlag = false;
|
||||
|
||||
@Override
|
||||
public void onChangeMapStyle( int i ) {
|
||||
|
||||
EnumMapUI last = mCurrentUI;
|
||||
Logger.d( TAG, "currentMapStyle = %s", i );
|
||||
|
||||
if ( i == MapAutoApi.MAP_STYLE_DAY
|
||||
|| i == MapAutoApi.MAP_STYLE_DAY_NAV ) {
|
||||
mCurrentUI = EnumMapUI.Type_Light;
|
||||
@@ -783,11 +839,30 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mCurrentUI = EnumMapUI.Type_Night;
|
||||
} else if ( i == MapAutoApi.MAP_STYLE_VR ) {
|
||||
mCurrentUI = EnumMapUI.Type_VR;
|
||||
} else if ( i == MapAutoApi.MAP_PERSPECTIVE_2D ) {
|
||||
mCurrentUI = EnumMapUI.CarUp_2D;
|
||||
} else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) {
|
||||
mCurrentUI = EnumMapUI.CarUp_3D;
|
||||
}
|
||||
// else if ( i == MapAutoApi.MAP_PERSPECTIVE_2D ) {
|
||||
// mCurrentUI = EnumMapUI.CarUp_2D;
|
||||
// } else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) {
|
||||
// mCurrentUI = EnumMapUI.CarUp_3D;
|
||||
// }
|
||||
|
||||
if ( last == mCurrentUI ) {
|
||||
Logger.d( TAG, "currentUI is same as last = %s", mCurrentUI );
|
||||
return;
|
||||
}
|
||||
|
||||
// vr 模式切换到普通模式下,保持之前的白天模式 wtf.
|
||||
if ( last == EnumMapUI.Type_VR && mCurrentUI != last ) {
|
||||
if ( mIsLightStyle ) {
|
||||
changeMapMode( EnumMapUI.Type_Light );
|
||||
return;
|
||||
}
|
||||
// if ( mVrModeAutoChangedFlag ) {
|
||||
// mVrModeAutoChangedFlag = false;
|
||||
// return;
|
||||
// }
|
||||
}
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
if ( mCurrentUI != null ) {
|
||||
UiThreadHandler.post( () -> {
|
||||
try {
|
||||
@@ -809,16 +884,32 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onStyleAutoChanged( boolean isVrMode ) {
|
||||
if ( isVrMode ) {
|
||||
if ( mCurrentUI != EnumMapUI.Type_VR ) {
|
||||
changeZoom( 20 );
|
||||
changeMapMode( EnumMapUI.Type_VR );
|
||||
Logger.d( TAG, "自动切换为vr模式" );
|
||||
// mVrModeAutoChangedFlag = true;
|
||||
changeMapMode( EnumMapUI.Type_VR );
|
||||
}
|
||||
} else {
|
||||
if ( mCurrentUI == EnumMapUI.Type_VR ) {
|
||||
changeZoom( 16 );
|
||||
changeMapMode( EnumMapUI.Type_Night );
|
||||
Logger.d( TAG, "自动切换为2D模式" );
|
||||
if ( mIsLightStyle ) {
|
||||
changeMapMode( EnumMapUI.Type_Light );
|
||||
} else {
|
||||
changeMapMode( EnumMapUI.Type_Night );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean mRtkEnable = false;
|
||||
|
||||
@Override
|
||||
public void rtkEnable( boolean enable ) {
|
||||
try {
|
||||
mRtkEnable = !mRtkEnable;
|
||||
TipToast.shortTip( mRtkEnable ? "已开启gps道路匹配" : "已开启rtk道路匹配" );
|
||||
mMapView.getLocationClient().rtkEnable( mRtkEnable );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "rtkEnable" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.map.impl.custom;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.CoordinatesTransformer;
|
||||
import com.mogo.map.IMogoMapApiBuilder;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
@@ -92,16 +93,14 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
@Override
|
||||
public IMogoMapView getMapView( Context context ) {
|
||||
NavAutoApi.INSTANCE.init( context, MapParams.Companion.init()
|
||||
.setDebugMode( true )
|
||||
.setDebugMode( DebugConfig.isDebug() )
|
||||
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
|
||||
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
|
||||
.setStyleDir( "sdcard/shmdata_asset/mogo_style" )
|
||||
.setCachePath( "sdcard/tiles" )
|
||||
.setZoom( 16 )
|
||||
.setPointToCenter( 0.734375f, 0.5f )
|
||||
.setStyleMode( MapParams.MAP_STYLE_NIGHT ), NavParams.Companion.init() );
|
||||
MapAutoView mapAutoView = new MapAutoView( context );
|
||||
IMogoMapView mapView = new AMapViewWrapper( mapAutoView );
|
||||
MapAutoView mapAutoView = new MapAutoView(context);
|
||||
IMogoMapView mapView = new AMapViewWrapper(mapAutoView);
|
||||
return mapView;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
marker.setMObject( this );
|
||||
MarkerWrapperClickHelper.getInstance().setMogoMarkerMap( marker.getId(), this );
|
||||
}
|
||||
marker.setSaveBitmapEnable( true );
|
||||
setObject( mogoMarkerOptions.getObject() );
|
||||
this.mMogoMarkerOptions = mogoMarkerOptions;
|
||||
mMogoMarkerOptions.addObserver( this );
|
||||
@@ -141,12 +140,12 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
if ( icons == null || icons.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
ArrayList<BitmapDescriptor> descriptors = new ArrayList<>();
|
||||
ArrayList< BitmapDescriptor > descriptors = new ArrayList<>();
|
||||
for ( Bitmap icon : icons ) {
|
||||
if ( icon == null || icon.isRecycled() ) {
|
||||
continue;
|
||||
}
|
||||
descriptors.add( BitmapDescriptorFactory.INSTANCE.fromBitmap(icon));
|
||||
descriptors.add( BitmapDescriptorFactory.INSTANCE.fromBitmap( icon ) );
|
||||
}
|
||||
if ( descriptors.isEmpty() ) {
|
||||
return;
|
||||
@@ -265,16 +264,16 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
@Override
|
||||
public void setOnMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
mMogoMarkerClickListener = listener;
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setOnMarkClickListener( new OnMarkClickListener() {
|
||||
@Override
|
||||
public void onMarkClick( @NotNull Marker marker ) {
|
||||
if ( mMogoMarkerClickListener != null ) {
|
||||
mMogoMarkerClickListener.onMarkerClicked( AMapMarkerWrapper.this );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
// if ( mMarker != null ) {
|
||||
// mMarker.setOnMarkClickListener( new OnMarkClickListener() {
|
||||
// @Override
|
||||
// public void onMarkClick( @NotNull Marker marker ) {
|
||||
// if ( mMogoMarkerClickListener != null ) {
|
||||
// mMogoMarkerClickListener.onMarkerClicked( AMapMarkerWrapper.this );
|
||||
// }
|
||||
// }
|
||||
// } );
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -505,9 +504,14 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
@Override
|
||||
public void use3DResource( int model3D ) {
|
||||
try {
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().marker3DIcon( model3D ) );
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().anchorColor("#00FF00").marker3DIcon( model3D ) );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "use3DResource" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorColor( String anchorColor ) {
|
||||
mMarker.setMarkerOptions( mMarker.getMarkeOptions().anchorColor( anchorColor ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,12 @@ import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -291,4 +289,11 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
public void setAnchorRate( float rate ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rtkEnable( boolean enable ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.rtkEnable( enable );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.map.impl.custom.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
@@ -89,6 +90,11 @@ public class ObjectUtils {
|
||||
}
|
||||
if (opt.getIcon3DRes() != 0) {
|
||||
markerOptions.marker3DIcon(opt.getIcon3DRes());
|
||||
try {
|
||||
Color.parseColor(opt.getAnchorColor());
|
||||
markerOptions.anchorColor( opt.getAnchorColor() );
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
}
|
||||
if (!TextUtils.isEmpty(opt.getTitle())) {
|
||||
markerOptions.title(opt.getTitle());
|
||||
|
||||
@@ -349,4 +349,12 @@ public interface IMogoMarker {
|
||||
default void use3DResource( @RawRes int model3D ) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置3D车模颜色
|
||||
* @param anchorColor
|
||||
*/
|
||||
default void setAnchorColor(String anchorColor){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ public class MogoMarkerOptions extends Observable {
|
||||
|
||||
private @RawRes
|
||||
int mIcon3DRes = 0;
|
||||
private String mAnchorColor;
|
||||
|
||||
private boolean mIs3DMode = false;
|
||||
|
||||
@@ -233,6 +234,11 @@ public class MogoMarkerOptions extends Observable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoMarkerOptions anchorColor( String anchorColor ) {
|
||||
this.mAnchorColor = anchorColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
@@ -334,6 +340,10 @@ public class MogoMarkerOptions extends Observable {
|
||||
return mIcon3DRes;
|
||||
}
|
||||
|
||||
public String getAnchorColor() {
|
||||
return mAnchorColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoMarkerOptions{" +
|
||||
|
||||
@@ -238,7 +238,20 @@ public interface IMogoMapUIController {
|
||||
|
||||
}
|
||||
|
||||
default void testGpsData(){
|
||||
default void testGpsData() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自研地图是否匹配道路
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
default void rtkEnable( boolean enable ) {
|
||||
|
||||
}
|
||||
|
||||
default void destroy(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
* 描述
|
||||
*/
|
||||
public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
|
||||
private static final String TAG = "MogoMapUIController";
|
||||
|
||||
private IMogoMapUIController mDelegate;
|
||||
@@ -31,13 +31,13 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
private static volatile MogoMapUIController sInstance;
|
||||
|
||||
private MogoMapUIController() {
|
||||
mDelegate = MogoMapDelegateFactory.getMapUIControllerDelegate();
|
||||
initDelegate();
|
||||
}
|
||||
|
||||
public static MogoMapUIController getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoMapUIController.class) {
|
||||
if (sInstance == null) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoMapUIController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MogoMapUIController();
|
||||
}
|
||||
}
|
||||
@@ -49,53 +49,54 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
this.mDelegate = mDelegate;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
public static synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setTrafficEnabled(visible);
|
||||
public void setTrafficEnabled( boolean visible ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setTrafficEnabled( visible );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom( boolean zoom) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.changeZoom(zoom);
|
||||
public MapControlResult changeZoom( boolean zoom ) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.changeZoom( zoom );
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.changeZoom(zoom);
|
||||
public MapControlResult changeZoom( float zoom ) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.changeZoom( zoom );
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapMode(EnumMapUI mode) {
|
||||
if (mDelegate != null) {
|
||||
public void changeMapMode( EnumMapUI mode ) {
|
||||
if ( mDelegate != null ) {
|
||||
Logger.d( "whatthefuck-MogoMapUIController", "%s", this );
|
||||
Logger.d( TAG, "set type: %s", mode.name() );
|
||||
mDelegate.changeMapMode(mode);
|
||||
mDelegate.changeMapMode( mode );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng, boolean animate) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.moveToCenter(latLng, animate);
|
||||
public void moveToCenter( MogoLatLng latLng, boolean animate ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.moveToCenter( latLng, animate );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.showMyLocation(visible);
|
||||
public void showMyLocation( boolean visible ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.showMyLocation( visible );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if (mDelegate != null) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.recoverLockMode();
|
||||
}
|
||||
}
|
||||
@@ -128,22 +129,22 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockZoom(int var1) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setLockZoom(var1);
|
||||
public void setLockZoom( int var1 ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setLockZoom( var1 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.displayOverview(bounds);
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.displayOverview( bounds );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if (mDelegate != null) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getScalePerPixel();
|
||||
}
|
||||
return 0;
|
||||
@@ -151,7 +152,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
if (mDelegate != null) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getZoomLevel();
|
||||
}
|
||||
return 0;
|
||||
@@ -159,7 +160,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraNorthEastPosition() {
|
||||
if (mDelegate != null) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCameraNorthEastPosition();
|
||||
}
|
||||
return null;
|
||||
@@ -167,38 +168,39 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraSouthWestPosition() {
|
||||
if (mDelegate != null) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getCameraSouthWestPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public MogoLatLng getWindowCenterLocation() {
|
||||
if (mDelegate != null) {
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getWindowCenterLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter(double mapCenterX, double mapCenterY) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setPointToCenter(mapCenterX, mapCenterY);
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.setPointToCenter( mapCenterX, mapCenterY );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen( MogoLatLng latLng ) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLocationPointInScreen(latLng);
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getLocationPointInScreen( latLng );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLocationMogoLatLngInScreen(point);
|
||||
public MogoLatLng getLocationMogoLatLngInScreen( Point point ) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.getLocationMogoLatLngInScreen( point );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -218,7 +220,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBounds(String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) {
|
||||
public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.showBounds( tag, carPosition, lonLats, bound, lockCarPosition );
|
||||
}
|
||||
@@ -283,4 +285,23 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.changeBearing( bearing );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rtkEnable( boolean enable ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.rtkEnable( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mDelegate = null;
|
||||
release();
|
||||
}
|
||||
|
||||
private void initDelegate() {
|
||||
if ( mDelegate == null ) {
|
||||
mDelegate = MogoMapDelegateFactory.getMapUIControllerDelegate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class HttpConstants {
|
||||
companion object {
|
||||
|
||||
const val DEV_BASE_URL_OWNER = "http://dzt-test.zhidaozhixing.com/"
|
||||
const val RELEASE_BASE_URL_OWNER = "http://dzt.zhidaohulian.com/"
|
||||
const val RELEASE_BASE_URL_OWNER = "http://dzt.zhidaozhixing.com/"
|
||||
const val SHOW_BASE_URL_OWNER = "http://dzt-show.zhidaozhixing.com/"
|
||||
|
||||
fun getBaseUrl(): String {
|
||||
|
||||
@@ -12,7 +12,6 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
@@ -34,6 +33,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.callchatprovider
|
||||
api "com.mogo.libs:hook:1.0"
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
api rootProject.ext.dependencies.mogomapapi
|
||||
|
||||
@@ -73,11 +73,27 @@ public class BezierAnimationView extends RelativeLayout implements View.OnClickL
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
public void bezierAnimationStart(){
|
||||
runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Log.d("点赞--", "");
|
||||
bezierAnimation(resource);
|
||||
handler.postDelayed(this, 500);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
private void bezierAnimation(int resource) {
|
||||
final ImageView imageView = new ImageView(context);
|
||||
imageView.setBackgroundResource(animation_drawable[resource]);
|
||||
RelativeLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.addRule(ALIGN_BOTTOM);
|
||||
// params.addRule(ALIGN_BOTTOM);
|
||||
params.addRule(CENTER_HORIZONTAL);
|
||||
imageView.setLayoutParams(params);
|
||||
addView(imageView);
|
||||
|
||||
@@ -13,10 +13,8 @@ import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.constants.AdasRecognizedType;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedListResult;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -68,8 +66,6 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
// adas marker 缓存
|
||||
private Map< String, IMogoMarker > mAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
|
||||
|
||||
private boolean mIsVrMode = false;
|
||||
|
||||
public void renderAdasRecognizedResult( List< ADASRecognizedListResult > resultList, boolean machineVision, double curSpeed ) {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers( DataTypes.TYPE_MARKER_ADAS );
|
||||
@@ -100,15 +96,6 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
continue;
|
||||
}
|
||||
mAdasRecognizedMarkersCaches.put( uniqueKey, marker );
|
||||
} else {
|
||||
if ( mIsVrMode != MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
mIsVrMode = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode();
|
||||
if ( mIsVrMode ) {
|
||||
marker.use3DResource( getVrModel() );
|
||||
} else {
|
||||
marker.setIcon( ViewUtils.fromView( inflateView( recognizedListResult, machineVision, 0 ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MogoLatLng lastPosition = mLastPositions.get( uniqueKey );
|
||||
@@ -122,8 +109,6 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
if ( latLon == null ) {
|
||||
continue;
|
||||
}
|
||||
// double targetPos[] = transformGcj02ToFitMap( latLon.lat, latLon.lon );
|
||||
// points.add( endLatLon = new MogoLatLng( targetPos[POS_LAT], targetPos[POS_LON] ) );
|
||||
points.add( endLatLon = new MogoLatLng( latLon.lat, latLon.lon ) );
|
||||
}
|
||||
|
||||
@@ -135,8 +120,6 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
continue;
|
||||
}
|
||||
points.add( lastPosition );
|
||||
// double targetPos[] = transformGcj02ToFitMap( latLon.lat, latLon.lon );
|
||||
// points.add( endLatLon = new MogoLatLng( targetPos[POS_LAT], targetPos[POS_LON] ) );
|
||||
points.add( endLatLon = new MogoLatLng( latLon.lat, latLon.lon ) );
|
||||
}
|
||||
mLastPositions.put( uniqueKey, endLatLon );
|
||||
@@ -191,25 +174,18 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return null;
|
||||
}
|
||||
|
||||
// double targetPos[] = transformGcj02ToFitMap( recognizedListResult.latLonList.get( 0 ).lat, recognizedListResult.latLonList.get( 0 ).lon );
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( DataTypes.TYPE_MARKER_ADAS )
|
||||
.anchor( 0.5f, 0.5f )
|
||||
.set3DMode( true )
|
||||
.icon3DRes( getVrModel() )
|
||||
.rotate( ( float ) recognizedListResult.heading )
|
||||
// .position( new MogoLatLng( targetPos[POS_LAT], targetPos[POS_LON] ) );
|
||||
.position( new MogoLatLng( recognizedListResult.latLonList.get( 0 ).lat, recognizedListResult.latLonList.get( 0 ).lon ) );
|
||||
|
||||
if ( mIsVrMode = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
options.icon3DRes( getVrModel() );
|
||||
} else {
|
||||
options.icon( inflateView( recognizedListResult, machineVision, curSpeed ) );
|
||||
}
|
||||
|
||||
return MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_ADAS, options );
|
||||
}
|
||||
|
||||
private int getVrModel() {
|
||||
return R.raw.taxi;
|
||||
return R.raw.carred;
|
||||
}
|
||||
|
||||
private View inflateView( ADASRecognizedListResult data, boolean machineVision, double curSpeed ) {
|
||||
@@ -225,7 +201,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
// safeType
|
||||
// ) );
|
||||
|
||||
iv.setImageResource( R.drawable.icon_map_marker_car_type_taxi );
|
||||
iv.setImageResource( R.drawable.icon_map_marker_car_gray );
|
||||
return rootView;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -9,15 +8,20 @@ import android.widget.ImageView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.entity.CloudRoadData;
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.carchattingprovider.ICarsChattingProvider;
|
||||
@@ -36,16 +40,19 @@ public
|
||||
*
|
||||
* 云端数据绘制
|
||||
*/
|
||||
class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListener {
|
||||
class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListener, IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "SnapshotSetDataDrawer";
|
||||
|
||||
private static volatile SnapshotSetDataDrawer sInstance;
|
||||
|
||||
private Context mContext;
|
||||
private boolean mChangeCarModeStatus;
|
||||
|
||||
private SnapshotSetDataDrawer() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getStatusManagerApi().registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, this );
|
||||
}
|
||||
|
||||
public static SnapshotSetDataDrawer getInstance() {
|
||||
@@ -71,13 +78,38 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
// 云端 marker 缓存
|
||||
private Map< String, IMogoMarker > mCloudSnapshotMarkersCaches = new ConcurrentHashMap<>();
|
||||
|
||||
private int mPurseCounter = 0;
|
||||
|
||||
private Map< String, MogoLatLng > mLastPositions = new ConcurrentHashMap<>();
|
||||
private Map< String, CloudRoadData > mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
private boolean mIsVrMode = false;
|
||||
|
||||
private long mLastReceiveTime = 0L;
|
||||
// private long mLastReceiveTime = 0L;
|
||||
// private long mAnimationDuration = 500L;
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
Logger.d( TAG, "%s - %s", descriptor, isTrue );
|
||||
mChangeCarModeStatus = true;
|
||||
ThreadPoolService.execute( () -> {
|
||||
clearOldStyleMarkers();
|
||||
} );
|
||||
}
|
||||
|
||||
private void clearOldStyleMarkers() {
|
||||
try {
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getMapServiceApi().getMarkerManager( mContext )
|
||||
.removeMarkers( DataTypes.TYPE_MARKER_CLOUD_DATA );
|
||||
mLastPositions.clear();
|
||||
mCloudSnapshotMarkersCaches.clear();
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
try {
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getMapServiceApi().getMarkerManager( mContext )
|
||||
.removeMarkers( DataTypes.TYPE_MARKER_ADAS );
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他车辆、rsu 车辆数据
|
||||
@@ -86,6 +118,10 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
*/
|
||||
public void renderSnapshotData( MogoSnapshotSetData data,
|
||||
boolean machineVision ) {
|
||||
recordTimeFlag();
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched() ) {
|
||||
return;
|
||||
}
|
||||
if ( data == null || (
|
||||
( data.getAllList() == null || data.getAllList().isEmpty() ) &&
|
||||
( data.getNearList() == null || data.getNearList().isEmpty() ) ) ) {
|
||||
@@ -93,19 +129,7 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
return;
|
||||
}
|
||||
List< CloudRoadData > allDatumsList = new ArrayList<>();
|
||||
allDatumsList.addAll( data.getAllList() );
|
||||
// allDatumsList.addAll( data.getNearList() );
|
||||
// if ( machineVision ) {
|
||||
// allDatumsList.addAll( data.getAllList() );
|
||||
// allDatumsList.addAll( data.getNearList() );
|
||||
// } else {
|
||||
// allDatumsList.addAll( data.getAllList() );
|
||||
// }
|
||||
mPurseCounter++;
|
||||
if ( mPurseCounter >= 100 ) {
|
||||
mPurseCounter = 0;
|
||||
}
|
||||
purgeCloudSnapshotData( allDatumsList );
|
||||
prepareData( data.getAllList(), allDatumsList );
|
||||
for ( CloudRoadData cloudRoadData : allDatumsList ) {
|
||||
if ( cloudRoadData == null ) {
|
||||
continue;
|
||||
@@ -118,7 +142,6 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IMogoMarker marker = null;
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
if ( TextUtils.isEmpty( uniqueKey ) ) {
|
||||
@@ -127,7 +150,6 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
if ( mCloudSnapshotMarkersCaches.containsKey( uniqueKey ) ) {
|
||||
marker = mCloudSnapshotMarkersCaches.get( uniqueKey );
|
||||
}
|
||||
MogoLatLng target = new MogoLatLng( cloudRoadData.getLat(), cloudRoadData.getLon() );
|
||||
if ( marker == null || marker.isDestroyed() ) {
|
||||
marker = drawSnapshotDataMarker( cloudRoadData, machineVision, data.curSpeed );
|
||||
if ( marker == null ) {
|
||||
@@ -138,38 +160,104 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
}
|
||||
mCloudSnapshotMarkersCaches.put( uniqueKey, marker );
|
||||
} else {
|
||||
if ( mIsVrMode != MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
if ( mChangeCarModeStatus ) {
|
||||
mChangeCarModeStatus = false;
|
||||
mIsVrMode = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode();
|
||||
if ( mIsVrMode ) {
|
||||
Logger.d( TAG, "3D模型-%s", uniqueKey );
|
||||
marker.getMogoMarkerOptions().set3DMode( true );
|
||||
marker.use3DResource( getVrModel( cloudRoadData ) );
|
||||
} else {
|
||||
Logger.d( TAG, "2D贴图-%s", uniqueKey );
|
||||
marker.getMogoMarkerOptions().set3DMode( false );
|
||||
marker.setIcon( ViewUtils.fromView( inflateView( cloudRoadData, machineVision, 0 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
MogoLatLng lastPosition = mLastPositions.get( uniqueKey );
|
||||
// double targetPos[] = transformGcj02ToFitMap( target.lat, target.lon );
|
||||
// double lastPos[] = transformGcj02ToFitMap( lastPosition.lat, lastPosition.lon );
|
||||
CloudRoadData lastPosition = mLastPositions.get( uniqueKey );
|
||||
if ( lastPosition != null ) {
|
||||
if ( lastPosition.equals( target ) ) {
|
||||
marker.setPosition( lastPosition.lat, lastPosition.lon );
|
||||
if ( lastPosition.equals( cloudRoadData ) ) {
|
||||
if ( ( ( int ) cloudRoadData.getSpeed() ) == 0 ) {
|
||||
MapCameraPosition position = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getMapCameraPosition();
|
||||
if ( position != null ) {
|
||||
marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() - position.getBearing() );
|
||||
} else {
|
||||
marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() );
|
||||
}
|
||||
}
|
||||
Logger.d( TAG, "保持位置 - %s", uniqueKey );
|
||||
marker.setPosition( lastPosition.getLat(), lastPosition.getLon() );
|
||||
} else {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
points.add( new MogoLatLng( lastPosition.lat, lastPosition.lon ) );
|
||||
points.add( new MogoLatLng( target.lat, target.lon ) );
|
||||
marker.startSmoothInMs( points, 500L );
|
||||
points.add( new MogoLatLng( lastPosition.getLat(), lastPosition.getLon() ) );
|
||||
points.add( new MogoLatLng( cloudRoadData.getLat(), cloudRoadData.getLon() ) );
|
||||
marker.startSmoothInMs( points, cloudRoadData.getSystemTime() - lastPosition.getSystemTime() );
|
||||
Logger.d( TAG, "平滑移动 - %s duration = %s", uniqueKey, cloudRoadData.getSystemTime() - lastPosition.getSystemTime() );
|
||||
}
|
||||
} else {
|
||||
marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() );
|
||||
marker.setPosition( target.lat, target.lon );
|
||||
MapCameraPosition position = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getMapCameraPosition();
|
||||
if ( position != null ) {
|
||||
marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() - position.getBearing() );
|
||||
} else {
|
||||
marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() );
|
||||
}
|
||||
marker.setPosition( cloudRoadData.getLat(), cloudRoadData.getLon() );
|
||||
}
|
||||
}
|
||||
mLastPositions.put( uniqueKey, target );
|
||||
mLastReceiveTime = SystemClock.elapsedRealtime();
|
||||
mLastPositions.put( uniqueKey, cloudRoadData );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤数据
|
||||
*
|
||||
* @param in 输入集合
|
||||
* @param out 输出集合
|
||||
*/
|
||||
private void prepareData( List< CloudRoadData > in, List< CloudRoadData > out ) {
|
||||
filterData( in );
|
||||
out.addAll( in );
|
||||
purgeCloudSnapshotData( out );
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录时间
|
||||
*/
|
||||
private void recordTimeFlag() {
|
||||
// if ( mLastReceiveTime != 0 ) {
|
||||
// mAnimationDuration = System.currentTimeMillis() - mLastReceiveTime;
|
||||
// if ( mAnimationDuration > 1000L ) {
|
||||
// mAnimationDuration = 500L;
|
||||
// }
|
||||
// } else {
|
||||
// mAnimationDuration = 500L;
|
||||
// }
|
||||
// mLastReceiveTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* vr 模式下显示合并数据,否则只显示上报位置的车辆
|
||||
*
|
||||
* @param dataList
|
||||
*/
|
||||
private void filterData( List< CloudRoadData > dataList ) {
|
||||
if ( dataList == null || dataList.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
return;
|
||||
}
|
||||
List< CloudRoadData > newList = new ArrayList<>();
|
||||
for ( CloudRoadData cloudRoadData : dataList ) {
|
||||
if ( cloudRoadData.getFromType() != CloudRoadData.FROM_MY_LOCATION ) {
|
||||
continue;
|
||||
}
|
||||
newList.add( cloudRoadData );
|
||||
}
|
||||
dataList.clear();
|
||||
dataList.addAll( newList );
|
||||
}
|
||||
|
||||
private void bindClickListener( IMogoMarker marker ) {
|
||||
if ( marker == null || marker.isDestroyed() ) {
|
||||
return;
|
||||
@@ -224,17 +312,20 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
}
|
||||
|
||||
Logger.d( TAG, "draw marker uniqueKey = %s", data.getUniqueKey() );
|
||||
// double coor[] = transformGcj02ToFitMap( data.getLat(), data.getLon() );
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( DataTypes.TYPE_MARKER_CLOUD_DATA )
|
||||
.anchor( 0.5f, 0.5f )
|
||||
.rotate( ( float ) data.getHeading() )
|
||||
.object( data )
|
||||
// .position( new MogoLatLng( coor[POS_LAT], coor[POS_LON] ) );
|
||||
.position( new MogoLatLng( data.getLat(), data.getLon() ) );
|
||||
if ( mIsVrMode = MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
options.set3DMode( true );
|
||||
options.anchorColor( "#00FF00" );
|
||||
Logger.d( TAG, "3D模型 - %s", data.getUniqueKey() );
|
||||
options.icon3DRes( getVrModel( data ) );
|
||||
} else {
|
||||
options.set3DMode( false );
|
||||
Logger.d( TAG, "2D贴图 - %s", data.getUniqueKey() );
|
||||
options.icon( inflateView( data, machineVision, curSpeed ) );
|
||||
}
|
||||
return MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_CLOUD_DATA, options );
|
||||
@@ -243,9 +334,9 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
private int getVrModel( CloudRoadData data ) {
|
||||
switch ( data.getFromType() ) {
|
||||
case CloudRoadData.FROM_ADAS:
|
||||
return R.raw.taxi;
|
||||
// return R.raw.taxi;
|
||||
case CloudRoadData.FROM_ROAD_UNIT:
|
||||
return R.raw.bus;
|
||||
// return R.raw.bus;
|
||||
case CloudRoadData.FROM_MY_LOCATION:
|
||||
default:
|
||||
return R.raw.carred;
|
||||
@@ -272,9 +363,9 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
private int get2DModel( CloudRoadData data ) {
|
||||
switch ( data.getFromType() ) {
|
||||
case CloudRoadData.FROM_ADAS:
|
||||
return R.drawable.icon_map_marker_car_type_taxi;
|
||||
// return R.drawable.icon_map_marker_car_type_taxi;
|
||||
case CloudRoadData.FROM_ROAD_UNIT:
|
||||
return R.drawable.icon_map_marker_car_type_bus;
|
||||
// return R.drawable.icon_map_marker_car_type_bus;
|
||||
case CloudRoadData.FROM_MY_LOCATION:
|
||||
default:
|
||||
return R.drawable.icon_map_marker_car_gray;
|
||||
|
||||
@@ -50,10 +50,10 @@ public class MapMarkerAdapter {
|
||||
* @return MarkerView
|
||||
*/
|
||||
public static IMarkerView getMarkerInfoWindowView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
|
||||
if ( markerShowEntity.isChecked() ) {
|
||||
return new MapMarkerInfoView( context, markerShowEntity, options );
|
||||
} else {
|
||||
return new MapMarkerView( context, markerShowEntity, options );
|
||||
}
|
||||
// if ( markerShowEntity.isChecked() ) {
|
||||
// return new MapMarkerInfoView( context, markerShowEntity, options );
|
||||
// } else {
|
||||
// }
|
||||
return new MapMarkerView( context, markerShowEntity, options );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,9 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV
|
||||
}
|
||||
|
||||
private void loadPoiTypeIconInUiThread(String url,int res) {
|
||||
|
||||
if (mMarker != null) {
|
||||
mMarker.setIcon( ViewUtils.fromView(MapMarkerBaseView.this));
|
||||
}
|
||||
if (!url.isEmpty()) {
|
||||
ivIcon.setPlaceHolder(res);
|
||||
ivIcon.setFailureHolder(res);
|
||||
|
||||
@@ -52,7 +52,11 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
public MapMarkerInfoView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
|
||||
super( context );
|
||||
mOptions = options;
|
||||
updateView( markerShowEntity );
|
||||
try {
|
||||
updateView( markerShowEntity );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +64,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout_info, this );
|
||||
ivUserHead = findViewById( R.id.ivUserHead );
|
||||
// ivIcon = findViewById( R.id.ivIcon );
|
||||
ivIcon = findViewById(R.id.ivIcon);
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
clMarkerContent = findViewById( R.id.clMarkerContent );
|
||||
ivReverseTriangle = findViewById( R.id.ivReverseTriangle );
|
||||
ivCar = findViewById( R.id.ivCar );
|
||||
@@ -69,84 +73,80 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
|
||||
@Override
|
||||
public void updateView( MarkerShowEntity markerShowEntity ) {
|
||||
try {
|
||||
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow_vr );
|
||||
} else {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
|
||||
}
|
||||
clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info );
|
||||
ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow );
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_CARS_CHATTING:
|
||||
case ModuleNames.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility( View.VISIBLE );
|
||||
ivIcon.setVisibility( View.INVISIBLE );
|
||||
loadImageWithMarker( markerShowEntity );
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
|
||||
//ivCar.setRotation(new Random().nextInt(360));
|
||||
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType(poiType);
|
||||
if (poiWrapper != null) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon(poiWrapper.getIconInfoUrl(),poiWrapper.getIconInfoRes());
|
||||
}else{
|
||||
Logger.e(TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerShareMusic ) {
|
||||
// 2 为书籍听书,3 为新闻,1 为qq音乐,int
|
||||
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
|
||||
case 1:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
case 2:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
|
||||
break;
|
||||
case 3:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
|
||||
break;
|
||||
default:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) {
|
||||
String content;
|
||||
if ( markerShowEntity.getTextContent().length() > 8 ) {
|
||||
content = markerShowEntity.getTextContent().substring( 0, 7 ) + "...";
|
||||
} else {
|
||||
content = markerShowEntity.getTextContent();
|
||||
}
|
||||
tvMarkerContent.setText( content );
|
||||
}
|
||||
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow_vr );
|
||||
} else {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
|
||||
}
|
||||
clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info );
|
||||
ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow );
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_CARS_CHATTING:
|
||||
case ModuleNames.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility( View.VISIBLE );
|
||||
ivIcon.setVisibility( View.INVISIBLE );
|
||||
loadImageWithMarker( markerShowEntity );
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
|
||||
//ivCar.setRotation(new Random().nextInt(360));
|
||||
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType( poiType );
|
||||
if ( poiWrapper != null ) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon( poiWrapper.getIconInfoUrl(), poiWrapper.getIconInfoRes() );
|
||||
} else {
|
||||
Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerShareMusic ) {
|
||||
// 2 为书籍听书,3 为新闻,1 为qq音乐,int
|
||||
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
|
||||
case 1:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
case 2:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
|
||||
break;
|
||||
case 3:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
|
||||
break;
|
||||
default:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) {
|
||||
String content;
|
||||
if ( markerShowEntity.getTextContent().length() > 8 ) {
|
||||
content = markerShowEntity.getTextContent().substring( 0, 7 ) + "...";
|
||||
} else {
|
||||
content = markerShowEntity.getTextContent();
|
||||
}
|
||||
tvMarkerContent.setText( content );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ import com.mogo.utils.logger.Logger;
|
||||
* desc : 地图Marker图标
|
||||
* version: 1.0
|
||||
*/
|
||||
public class
|
||||
MapMarkerView extends MapMarkerBaseView {
|
||||
public class MapMarkerView extends MapMarkerBaseView {
|
||||
private String TAG = "MapMarkerView";
|
||||
|
||||
private FrameLayout clMarkerTopView;
|
||||
private MarkerShowEntity mMarkerShowEntity;
|
||||
|
||||
public MapMarkerView( Context context ) {
|
||||
super( context );
|
||||
@@ -45,7 +45,12 @@ MapMarkerView extends MapMarkerBaseView {
|
||||
public MapMarkerView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
|
||||
super( context );
|
||||
mOptions = options;
|
||||
updateView( markerShowEntity );
|
||||
mMarkerShowEntity = markerShowEntity;
|
||||
try {
|
||||
updateView( markerShowEntity );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,37 +60,35 @@ MapMarkerView extends MapMarkerBaseView {
|
||||
} else {
|
||||
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout, this );
|
||||
}
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
clMarkerTopView = findViewById( R.id.clMarkerTopView );
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
ivCar = findViewById( R.id.ivCar );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView( MarkerShowEntity markerShowEntity ) {
|
||||
try {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType( poiType );
|
||||
if ( poiWrapper != null ) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon( poiWrapper.getIconUrl(), poiWrapper.getIconRes() );
|
||||
} else {
|
||||
Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染marker====" + poiType );
|
||||
}
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
if ( mMarkerShowEntity != null && mMarkerShowEntity.isChecked() ) {
|
||||
clMarkerTopView.setBackgroundResource( R.drawable.module_services_marker_vr_bkg_checked );
|
||||
}
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType( poiType );
|
||||
if ( poiWrapper != null ) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon( poiWrapper.getIconUrl(), poiWrapper.getIconRes() );
|
||||
} else {
|
||||
Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染marker====" + poiType );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -17,6 +18,8 @@ public
|
||||
*/
|
||||
class RoadConditionInfoWindow3DAdapter implements IMogoInfoWindowAdapter {
|
||||
|
||||
private static final String TAG = "RoadConditionInfoWindow3DAdapter";
|
||||
|
||||
private MarkerShowEntity mEntity;
|
||||
private Context mContext;
|
||||
private MogoMarkerOptions mOptions;
|
||||
@@ -31,6 +34,7 @@ class RoadConditionInfoWindow3DAdapter implements IMogoInfoWindowAdapter {
|
||||
|
||||
@Override
|
||||
public View getInfoWindow( IMogoMarker marker ) {
|
||||
Logger.d( TAG, "创建marker的infowindow" );
|
||||
IMarkerView creator = MapMarkerAdapter.getMarkerInfoWindowView( mContext, mEntity, mOptions );
|
||||
return creator.getView();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.common.entity;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.utils.CoordinateUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -133,7 +133,7 @@ public class CloudRoadData implements Parcelable {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
public void setUuid( String uuid ) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
@@ -222,4 +222,19 @@ public class CloudRoadData implements Parcelable {
|
||||
return new CloudRoadData[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean equals( Object o ) {
|
||||
if ( this == o ) {
|
||||
return true;
|
||||
}
|
||||
if ( o == null || getClass() != o.getClass() ) {
|
||||
return false;
|
||||
}
|
||||
CloudRoadData that = ( CloudRoadData ) o;
|
||||
return Double.compare( that.lat, lat ) == 0 &&
|
||||
Double.compare( that.lon, lon ) == 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -270,7 +270,10 @@ public class MapCenterPointStrategy {
|
||||
if ( controller == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.e( TAG, "scene"+scene );
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
Logger.w( TAG, "vr 模式下忽略该设置" );
|
||||
return;
|
||||
}
|
||||
Map< Integer, Map< String, MapCenterPoint > > strategies = sCommonStrategies;
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
strategies = sVrStrategies;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#890">
|
||||
|
||||
<com.mogo.module.common.animation.BezierAnimationView
|
||||
android:id="@+id/bezier_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#7810" />
|
||||
|
||||
</RelativeLayout>
|
||||
BIN
modules/mogo-module-common/src/main/res/raw/car.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/car.n3d
Normal file
Binary file not shown.
@@ -839,11 +839,16 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
handler.post(() -> seekHelpGroup.setVisibility(View.GONE));
|
||||
}
|
||||
} else if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
enterVrMode();
|
||||
} else {
|
||||
exitVrMode();
|
||||
try {
|
||||
if (isTrue) {
|
||||
enterVrMode();
|
||||
} else {
|
||||
exitVrMode();
|
||||
}
|
||||
} catch( Exception e ){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.view.VerticalTrafficLightView;
|
||||
|
||||
import static com.mogo.module.common.constants.TrafficLightConst.TRAFFIC_LIGHT_COLOR_GRAY;
|
||||
|
||||
/**
|
||||
* vr模式下导航信息封装
|
||||
*
|
||||
@@ -28,14 +30,14 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
private final VerticalTrafficLightView turnAroundLight, turnLeftLight, straightLight, turnRightLight;
|
||||
|
||||
private final ImageView ivTurnIcon;
|
||||
private final TextView tvDistance,tvDistanceUnit, tvNextRoad;
|
||||
private final TextView tvDistance, tvDistanceUnit, tvNextRoad;
|
||||
|
||||
private final TextView tvCurrentSpeed;
|
||||
|
||||
private final Handler handler = new Handler(this);
|
||||
|
||||
public VrModeNavInfoView(Context context) {
|
||||
this(context,null);
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public VrModeNavInfoView(Context context, AttributeSet attrs) {
|
||||
@@ -72,7 +74,7 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
}
|
||||
|
||||
public void refreshLimitSpeed(int limitSpeed) {
|
||||
if(getVisibility() != View.VISIBLE){
|
||||
if (getVisibility() != View.VISIBLE) {
|
||||
return;
|
||||
}
|
||||
handler.removeMessages(MSG_HIDE_LIMIT_SPEED);
|
||||
@@ -91,6 +93,14 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
private int[] lightArray = new int[4];
|
||||
private String[] surplusTimeArray = new String[4];
|
||||
|
||||
/**
|
||||
* 将红绿灯状态全部置灰,相当于隐藏红绿灯状态
|
||||
*/
|
||||
public void hideTrafficLightStatus() {
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT);
|
||||
refreshTrafficLightStatus(new int[]{TRAFFIC_LIGHT_COLOR_GRAY, TRAFFIC_LIGHT_COLOR_GRAY, TRAFFIC_LIGHT_COLOR_GRAY, TRAFFIC_LIGHT_COLOR_GRAY}, new String[]{"", "", "", ""});
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新红绿灯显示状态
|
||||
*
|
||||
@@ -107,12 +117,15 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
turnRightLight.setTrafficLightStatus(laneLight[3], surplusTime[3]);
|
||||
// todo 再根据当前所在车道,置灰不需关注的灯
|
||||
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT);
|
||||
handler.sendEmptyMessageDelayed(MSG_HIDE_TRAFFIC_LIGHT, HIDE_TRAFFIC_LIGHT_DELAY);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据所在车道,控制红绿灯展示
|
||||
*/
|
||||
public void refreshLaneStatus(){
|
||||
public void refreshLaneStatus() {
|
||||
|
||||
}
|
||||
|
||||
@@ -136,16 +149,24 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
public boolean isVisible() {
|
||||
return navGroup.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
private static final int MSG_HIDE_LIMIT_SPEED = 1001;
|
||||
private static final long HIDE_LIMIT_SPEED_DELAY = 5000;
|
||||
|
||||
private static final int MSG_HIDE_TRAFFIC_LIGHT = 1002;
|
||||
private static final long HIDE_TRAFFIC_LIGHT_DELAY = 1000;
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if (!isAttachedToWindow()||getVisibility() != View.VISIBLE) {
|
||||
if (!isAttachedToWindow() || getVisibility() != View.VISIBLE) {
|
||||
return false;
|
||||
}
|
||||
if (msg.what == MSG_HIDE_LIMIT_SPEED) {
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
return true;
|
||||
} else if (msg.what == MSG_HIDE_TRAFFIC_LIGHT) {
|
||||
hideTrafficLightStatus();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -158,8 +158,9 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
String obuLightAction = intent.getStringExtra("action");
|
||||
if ("1".equals(obuLightAction)) {
|
||||
// 隐藏红绿灯
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
vrModeNavInfoView.hideTrafficLightStatus();
|
||||
// handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
// handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
} else {
|
||||
// 红绿灯处理
|
||||
String data = intent.getStringExtra("data");
|
||||
|
||||
@@ -100,7 +100,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addVrCameraMarker(CloudRoadData roadData) {
|
||||
Log.d(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
Log.e(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
if (!TextUtils.isEmpty(roadData.getRtmpUrl())) {
|
||||
removeCameraMarker();
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
@@ -127,7 +127,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addNormalCameraMarker(CloudRoadData roadData) {
|
||||
Log.d(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
Log.e(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
if (!TextUtils.isEmpty(roadData.getRtmpUrl())) {
|
||||
removeCameraMarker();
|
||||
if (mMogoMarker != null) {
|
||||
@@ -178,7 +178,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
if (TextUtils.equals(mCurrentUuid, mCloudRoadData.getUuid())) {
|
||||
if (isVrMode == isVrModeMarker) {
|
||||
// do nothing.
|
||||
Log.e(TAG, "-------------1------------");
|
||||
Log.d(TAG, "-------------1------------");
|
||||
} else {
|
||||
if (isVrMode) {
|
||||
Log.d(TAG, "-------------2------------");
|
||||
|
||||
@@ -199,6 +199,16 @@ public class TopViewAnimHelper {
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException("method addTopView params LayoutParams is null");
|
||||
}
|
||||
|
||||
if (isOuting) {
|
||||
if (motionViewCache != null) {
|
||||
motionViewCache.statusListener.beforeViewRemoveAnim(motionViewCache.view);
|
||||
motionViewCache.statusListener.onViewRemoved(motionViewCache.view);
|
||||
}
|
||||
motionViewCache = new MotionViewCache(view, params, statusListener);
|
||||
// return;
|
||||
}
|
||||
|
||||
if (!viewCaches.contains(view)) {
|
||||
// 判断此view是否已经增加到了顶部view,如果增加过就不增加了
|
||||
currentAnimatingView = view;
|
||||
@@ -278,6 +288,9 @@ public class TopViewAnimHelper {
|
||||
// 顶部view还没有内容,需要整体下移
|
||||
viewCaches.add(view);
|
||||
topContainer.addView(view, params);
|
||||
LayoutParams p = topContainer.getLayoutParams();
|
||||
p.height = params.height;
|
||||
topContainer.setLayoutParams(p);
|
||||
Logger.d(TAG, "整体进入==== view.visibility: " + view.getVisibility() + " view" +
|
||||
".position: (" + view.getX() + ", " + view.getY() + ") params.width: " + params.width + " params.height: " + params.height);
|
||||
if (statusListenerMap.get(view) != null) {
|
||||
@@ -333,6 +346,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
Logger.d("TopViewAnimHelper", "startTopOutAnim=====");
|
||||
if (!isTopViewOut && viewCaches.contains(view)) {
|
||||
isOuting = true;
|
||||
// 顶部view仅剩一个view,需要整体上移
|
||||
if (statusListenerMap.get(view) != null) {
|
||||
statusListenerMap.get(view).beforeViewRemoveAnim(view);
|
||||
@@ -341,7 +355,7 @@ public class TopViewAnimHelper {
|
||||
|
||||
NoMapTopViewShaderHelper.getInstance().hideShader();
|
||||
|
||||
topContainer.animate().translationY(-topContainer.getTranslationY()).setListener(mainAnimListener).start();
|
||||
topContainer.animate().translationY(0).setListener(mainAnimListener).start();
|
||||
|
||||
checkCameraModePosition(false);
|
||||
|
||||
@@ -389,6 +403,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
Logger.d("TopViewAnimHelper", "hideNaviView=====");
|
||||
animNavInfoView.setTranslationY(0);
|
||||
animNavInfoView.setVisibility(View.GONE);
|
||||
vrModeNavInfoView.stopNav();
|
||||
int scene = 0;
|
||||
@@ -441,6 +456,7 @@ public class TopViewAnimHelper {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainer.setTranslationY(0);
|
||||
topContainer.removeAllViews();
|
||||
hideNaviView();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS);
|
||||
@@ -496,6 +512,11 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
topContainer.removeAllViews();
|
||||
currentAnimatingView = null;
|
||||
isOuting = false;
|
||||
// if (motionViewCache != null) {
|
||||
// startTopInAnim(motionViewCache.view, motionViewCache.params, motionViewCache.statusListener);
|
||||
// motionViewCache = null;
|
||||
// }
|
||||
} else {
|
||||
listener = statusListenerMap.get(currentAnimatingView);
|
||||
if (listener != null) {
|
||||
@@ -516,4 +537,21 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private MotionViewCache motionViewCache = null;
|
||||
private boolean isOuting = false;
|
||||
|
||||
private static class MotionViewCache {
|
||||
private final View view;
|
||||
private final LayoutParams params;
|
||||
private final IMogoTopViewStatusListener statusListener;
|
||||
|
||||
public MotionViewCache(View view, LayoutParams params, IMogoTopViewStatusListener statusListener) {
|
||||
this.view = view;
|
||||
this.params = params;
|
||||
this.statusListener = statusListener;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
android:id="@+id/module_ext_id_tv_speed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_nav_common_margin_top"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_in_vr_speed_margin_start"
|
||||
android:text="--"
|
||||
android:textColor="#fff"
|
||||
@@ -53,6 +54,8 @@
|
||||
android:id="@+id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode"
|
||||
android:layout_width="@dimen/module_ext_navi_in_vr_navi_icon_size"
|
||||
android:layout_height="@dimen/module_ext_navi_in_vr_navi_icon_size"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_nav_common_margin_top"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_in_vr_limit_speed_margin_start"
|
||||
android:src="@drawable/tc_11"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_traffic_bg"
|
||||
@@ -65,6 +68,7 @@
|
||||
android:text="200"
|
||||
android:textColor="#f1f1f1"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_next_info_txt_size"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_navi_next_info_road_in_vr_mode"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode"
|
||||
app:layout_constraintTop_toTopOf="@id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode" />
|
||||
|
||||
@@ -85,6 +89,7 @@
|
||||
android:text="北三环东路辅路"
|
||||
android:textColor="#f1f1f1"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_next_info_road_txt_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_navi_next_info_distance_in_vr_mode"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_map_id_navi_next_info_distance_in_vr_mode" />
|
||||
|
||||
@@ -94,6 +99,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/module_ext_navi_in_vr_limit_speed_margin_end"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_limit_speed_margin_top"
|
||||
android:background="@drawable/module_ext_vr_mode_limit_speed_bg"
|
||||
android:gravity="center"
|
||||
android:text="80"
|
||||
@@ -148,14 +154,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="module_ext_id_tv_speed,module_ext_id_tv_speed_unit"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone" />
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/module_ext_id_group_navi_in_vr_nav_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:visibility="gone"
|
||||
app:constraint_referenced_ids="module_map_id_navi_next_info_road_turn_icon_in_vr_mode,module_map_id_navi_next_info_distance_in_vr_mode,module_map_id_navi_next_info_distance_unit_in_vr_mode,module_map_id_navi_next_info_road_in_vr_mode" />
|
||||
|
||||
<!-- 除了上面两个group以外的其他view的group,方便整体控制显示隐藏,不包含limitSpeed,需要单独控制它的显示隐藏 -->
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="12"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_traffic_light_left_time_margin_top"
|
||||
android:textColor="#fff"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_traffic_light_left_time_txt_size"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_traffic_light_icon"
|
||||
app:layout_constraintRight_toLeftOf="@id/module_ext_id_traffic_light_left_time_unit"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_ext_id_traffic_light_icon" />
|
||||
app:layout_constraintTop_toTopOf="@id/module_ext_id_traffic_light_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_traffic_light_left_time_unit"
|
||||
|
||||
@@ -226,18 +226,21 @@
|
||||
<dimen name="module_ext_navi_in_vr_traffic_bg_margin_bottom">60px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_text_size">100px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_unit_size">30px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_unit_margin_start">30px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_unit_margin_start">15px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_margin_start">70px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_margin_top">22px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_size">78px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_end">66px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_top">43px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_nav_common_margin_top">23px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_top">30px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_start">20px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_text_size">40px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_bg_corner">20px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_margin_top">17px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_txt_size">36px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_margin_top">60px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_unit_size">21px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_no_time_margin_top">21px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_no_time_margin_top">11px</dimen>
|
||||
<dimen name="module_video_window_width_content">400px</dimen>
|
||||
<dimen name="module_video_window_height_content">300px</dimen>
|
||||
|
||||
|
||||
@@ -159,14 +159,14 @@ public class EventDispatchCenter implements
|
||||
this.mMapLoadedCallback = callback;
|
||||
}
|
||||
|
||||
private boolean mIsMapLoaded = false;
|
||||
// private boolean mIsMapLoaded = false;
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if ( mIsMapLoaded ) {
|
||||
return;
|
||||
}
|
||||
mIsMapLoaded = true;
|
||||
// if ( mIsMapLoaded ) {
|
||||
// return;
|
||||
// }
|
||||
// mIsMapLoaded = true;
|
||||
if ( mMapLoadedCallback != null ) {
|
||||
mMapLoadedCallback.run();
|
||||
mMapLoadedCallback = null;
|
||||
|
||||
@@ -182,6 +182,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
EventDispatchCenter.getInstance().setMapLoadedCallback( () -> {
|
||||
Logger.d( TAG, "map loaded." + Thread.currentThread().getName() );
|
||||
resetMapCenterPoint();
|
||||
resetMapUiStyle();
|
||||
loadOthersModules();
|
||||
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
} );
|
||||
@@ -203,6 +204,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
|
||||
}
|
||||
|
||||
private void resetMapUiStyle(){
|
||||
final EnumMapUI mapUI = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getCurrentSkinMode();
|
||||
mServiceApis.getMapServiceApi().getMapUIController().changeMapMode( mapUI );
|
||||
}
|
||||
|
||||
private void resetMapCenterPoint() {
|
||||
// 右移地图中心点
|
||||
MapCenterPointStrategy.init();
|
||||
@@ -374,6 +380,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoFragmentManager.unregisterMainFragmentStackTransactionListener();
|
||||
mMogoFragmentManager = null;
|
||||
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().destroy();
|
||||
mServiceApis.getMapServiceApi().getMapUIController().destroy();
|
||||
AdasConfigApiController.getInstance().release();
|
||||
mServiceApis.getAdasControllerApi().release();
|
||||
Logger.d( TAG, "destroy." );
|
||||
|
||||
@@ -154,10 +154,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
if ( mMogoMap.getUIController() != null ) {
|
||||
mMogoMap.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
}
|
||||
|
||||
|
||||
final EnumMapUI mapUI = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getCurrentSkinMode();
|
||||
getUIController().changeMapMode( mapUI );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval"
|
||||
android:useLevel="false">
|
||||
<solid android:color="#000000" />
|
||||
<size
|
||||
android:width="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:height="@dimen/module_media_pop_window_anim_img_size_new" />
|
||||
</shape>
|
||||
@@ -7,45 +7,59 @@
|
||||
|
||||
<com.mogo.module.media.widget.CircleNumberProgress
|
||||
android:id="@+id/window_circle_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:circleBackground="@color/modules_media_music_bg_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:circleBackground="@color/modules_media_music_bg_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<!-- app:ringColor="@color/modules_media_music_circle_color"-->
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!-- app:ringColor="@color/modules_media_music_circle_color"-->
|
||||
|
||||
<!-- <com.mogo.module.media.widget.PercentageRingView-->
|
||||
<!-- android:id="@+id/window_circle_bg"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent" />-->
|
||||
<!-- <com.mogo.module.media.widget.PercentageRingView-->
|
||||
<!-- android:id="@+id/window_circle_bg"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent" />-->
|
||||
|
||||
<com.mogo.module.media.widget.AnimCircleImageView
|
||||
android:id="@+id/window_circle_img_new"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:src="@drawable/module_media_default_music_img_new"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/module_media_default_music_img_new"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause_new"
|
||||
android:layout_width="@dimen/module_media_pop_window_pause"
|
||||
android:layout_height="@dimen/module_media_pop_window_pause"
|
||||
android:background="@drawable/module_media_play_bg_selector"
|
||||
android:src="@drawable/module_media_window_pop_play_new"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_obscuration"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:alpha="0.5"
|
||||
android:background="@drawable/module_media_circle_bg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause_new"
|
||||
android:layout_width="@dimen/module_media_pop_window_pause"
|
||||
android:layout_height="@dimen/module_media_pop_window_pause"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:background="@drawable/module_media_play_bg_selector"
|
||||
android:src="@drawable/module_media_window_pop_play_new" />
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class MockUtil:Handler.Callback {
|
||||
if (msg.what == 1001) {
|
||||
Logger.d(TAG,"准备添加调试view")
|
||||
val api = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context) as IMogoServiceApis
|
||||
api.windowManagerApi.addView(view, 500, 300, false)
|
||||
api.windowManagerApi.addView(view, 800, 300, false)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -103,8 +103,8 @@ public class MogoServiceProvider implements IMogoModuleProvider {
|
||||
MogoRTKLocation.getInstance().init();
|
||||
}
|
||||
MogoServices.getInstance().preInit( context );
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
}, 5_000L );
|
||||
}
|
||||
|
||||
|
||||
@@ -326,6 +326,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.TOP_VIEW, statusChangedListener );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListener );
|
||||
mStatusManager.setAIAssistReady( TAG, AIAssist.getInstance( mContext ).hasFlush() );
|
||||
|
||||
}
|
||||
|
||||
public void init( Context context ) {
|
||||
@@ -337,9 +338,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
registerInternalUnWakeupWords();
|
||||
|
||||
mRegisterCenter = MarkerServiceHandler.getRegisterCenter();
|
||||
mRegisterCenter.registerMogoMapListener( ServiceConst.TYPE, this );
|
||||
mRegisterCenter.registerMogoLocationListener( ServiceConst.TYPE, this );
|
||||
mRegisterCenter.registerMogoNaviListener( ServiceConst.TYPE, this );
|
||||
mRegisterCenter.registerMogoMapListener( ServiceConst.TYPE, this );
|
||||
mRegisterCenter.registerMogoAimlessModeListener( ServiceConst.TYPE, this );
|
||||
mRegisterCenter.registerCarLocationChangedListener( ServiceConst.TYPE, this );
|
||||
|
||||
@@ -555,6 +556,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
MapMarkerManager.getInstance().syncLocation( latLng.lon, latLng.lat );
|
||||
|
||||
Logger.d( TAG, "zoom = %s", zoom );
|
||||
|
||||
if ( mIsCameraInited ) {
|
||||
mLastZoomLevel = zoom;
|
||||
mLastCustomRefreshCenterLocation = latLng;
|
||||
@@ -925,16 +928,26 @@ public class MogoServices implements IMogoMapListener,
|
||||
return mLastCarLocation;
|
||||
}
|
||||
|
||||
private boolean mLastStatusIsVr = false;
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
if ( ui == EnumMapUI.Type_VR ) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
if ( !mLastStatusIsVr ) {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已进入鹰眼模式" );
|
||||
mLastStatusIsVr = true;
|
||||
}
|
||||
} else {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
if ( mLastStatusIsVr ) {
|
||||
mLastStatusIsVr = false;
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已离开鹰眼模式" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,6 +383,10 @@ public class MockIntentHandler implements IntentHandler {
|
||||
centerMarker.destroy();
|
||||
}
|
||||
break;
|
||||
case 38:
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
|
||||
.rtkEnable( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,16 +158,13 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
@Override
|
||||
public void onMsgReceived( MogoSnapshotSetData data ) {
|
||||
if ( data == null ) {
|
||||
return;
|
||||
}
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
// return;
|
||||
}
|
||||
|
||||
if ( MogoServices.getInstance().getLastCarLocation() != null ) {
|
||||
data.curSpeed = MogoServices.getInstance().getLastCarLocation().getSpeed();
|
||||
}
|
||||
// if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
//// return;
|
||||
// }
|
||||
//
|
||||
// if ( MogoServices.getInstance().getLastCarLocation() != null ) {
|
||||
// data.curSpeed = MogoServices.getInstance().getLastCarLocation().getSpeed();
|
||||
// }
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData( data, false );
|
||||
// VrModeController.getInstance().renderMogoSnapshotSetData( data );
|
||||
}
|
||||
|
||||
@@ -90,13 +90,13 @@ class SnapshotUploadInTime implements MogoRTKLocation.RTKLocationListener {
|
||||
locationResult.lastCoordinate = lastInfo;
|
||||
locationResult.mortonCode = MortonCode.wrapEncodeMorton( lastInfo.getLon(), lastInfo.getLat() );
|
||||
}
|
||||
locationResult.coordinates = new ArrayList<>();
|
||||
// locationResult.coordinates = new ArrayList<>();
|
||||
locationResult.sn = com.mogo.commons.network.Utils.getSn();
|
||||
if ( cloudLocationInfo == null ) {
|
||||
locationResult.coordinates.addAll( new ArrayList<>() );
|
||||
} else {
|
||||
locationResult.coordinates.addAll( cloudLocationInfo );
|
||||
}
|
||||
// if ( cloudLocationInfo == null ) {
|
||||
// locationResult.coordinates.addAll( new ArrayList<>() );
|
||||
// } else {
|
||||
// locationResult.coordinates.addAll( cloudLocationInfo );
|
||||
// }
|
||||
}
|
||||
List< ADASRecognizedResult > recognizedResults = MarkerServiceHandler.getADASController().getLastADASRecognizedResult();
|
||||
OnePerSecondSendContent content = new OnePerSecondSendContent();
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener;
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAuthorizeModuleManager;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.module.common.utils.CloudPoiManager;
|
||||
import com.mogo.module.share.bean.FixableButton;
|
||||
@@ -193,13 +194,13 @@ public class ShareControl implements IMogoShareManager, Handler.Callback {
|
||||
// if (!DebugConfig.isLauncher()) {
|
||||
ServiceApisManager.serviceApis.getStatusManagerApi().registerStatusChangedListener(TAG,
|
||||
StatusDescriptor.MAIN_PAGE_RESUME, new IMogoStatusChangedListener() {
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (!isTrue) {
|
||||
dismissShareDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (!isTrue) {
|
||||
dismissShareDialog();
|
||||
}
|
||||
}
|
||||
});
|
||||
// }
|
||||
|
||||
// if (!DebugConfig.isLauncher()) {
|
||||
@@ -300,6 +301,9 @@ public class ShareControl implements IMogoShareManager, Handler.Callback {
|
||||
}
|
||||
break;
|
||||
case VOICE_CMD_PUB_TROUBLE_HELP:
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
return;
|
||||
}
|
||||
if (needAuth()) {
|
||||
goAuth(STEP_AFTER_AUTH_TYPE_SEEK_HELP, TYPE_DENSE_FOG, false);
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.navi.IMogoAimless;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
@@ -35,7 +36,7 @@ public class TanluServiceManager {
|
||||
private static IMogoAimless mIMogoAimless;
|
||||
|
||||
public static void init(Context context) {
|
||||
mServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
mMapService = mServiceApis.getMapServiceApi();
|
||||
mIMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mAnalytics = mServiceApis.getAnalyticsApi();
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ShareConstants {
|
||||
// 此处只记录了事故、实时路况、道路积水、道路结冰、浓雾,至于拥堵、交通检查和封路是在extention模块里面管理
|
||||
|
||||
public static final String VOICE_CMD_PUB_TROUBLE_HELP = "com.zhidao.auxiliaryDriving" +
|
||||
".pubTroubleHelp";
|
||||
".pubTroubleHelp";/*唤醒词 发起故障求助*/
|
||||
public static final String VOICE_CMD_GO_TO_SHARE = "com.zhidao.share";
|
||||
|
||||
public static final String TAG = "/tanlu/ui";
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.small.map">
|
||||
|
||||
<application>
|
||||
<!--<application>
|
||||
<service
|
||||
android:name=".SmallMapService"
|
||||
android:exported="false"
|
||||
android:process=":smallMap"/>
|
||||
</application>
|
||||
/>
|
||||
</application>-->
|
||||
</manifest>
|
||||
@@ -0,0 +1,186 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by Fernflower decompiler)
|
||||
//
|
||||
|
||||
package com.amap.api.col.n3;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.Resources.Theme;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.LayoutInflater.Factory;
|
||||
import android.view.View;
|
||||
import android.view.ViewStub;
|
||||
|
||||
import com.android.internal.policy.MyPhoneLayoutInflater;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
public final class le2 extends ContextThemeWrapper {
|
||||
private Resources a = lg.a();
|
||||
private Theme b;
|
||||
private LayoutInflater c;
|
||||
private ClassLoader d;
|
||||
private int e;
|
||||
private static final String[] f = new String[]{"android.widget", "android.webkit", "android.app"};
|
||||
private le2.a g = new le2.a();
|
||||
private Factory h = new Factory() {
|
||||
public final View onCreateView(String var1, Context var2, AttributeSet var3) {
|
||||
return le2.this.a(var1, var2, var3);
|
||||
}
|
||||
};
|
||||
|
||||
public le2(Context var1, int var2, ClassLoader var3) {
|
||||
super(var1, var2);
|
||||
this.d = var3;
|
||||
this.b = lg.b();
|
||||
this.e = var2;
|
||||
super.onApplyThemeResource(this.b, this.e, true);
|
||||
(new StringBuilder("classloader:")).append(this.d);
|
||||
}
|
||||
|
||||
public final Resources getResources() {
|
||||
return this.a != null ? this.a : super.getResources();
|
||||
}
|
||||
|
||||
public final void a(int var1) {
|
||||
if (var1 != this.e) {
|
||||
this.e = var1;
|
||||
super.onApplyThemeResource(this.b, this.e, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final Theme getTheme() {
|
||||
return this.b != null ? this.b : super.getTheme();
|
||||
}
|
||||
|
||||
public final Object getSystemService(String var1) {
|
||||
if ("layout_inflater".equals(var1)) {
|
||||
if (this.c == null) {
|
||||
// 这里构建一个自己对的布局填充器
|
||||
// 与已经被修改的context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)
|
||||
// 隔离从而保证高德地图SDK能正常初始化
|
||||
LayoutInflater var2 = new MyPhoneLayoutInflater(getBaseContext());
|
||||
this.c = var2.cloneInContext(this);
|
||||
this.c.setFactory(this.h);
|
||||
this.c = this.c.cloneInContext(this);
|
||||
}
|
||||
|
||||
return this.c;
|
||||
} else {
|
||||
return super.getSystemService(var1);
|
||||
}
|
||||
}
|
||||
|
||||
private final View a(String var1, Context var2, AttributeSet var3) {
|
||||
if (this.g.a.contains(var1)) {
|
||||
return null;
|
||||
} else {
|
||||
Constructor var4;
|
||||
if ((var4 = (Constructor) this.g.b.get(var1)) == null) {
|
||||
Class var5 = null;
|
||||
boolean var6 = false;
|
||||
String var7 = "api.navi";
|
||||
|
||||
label71:
|
||||
{
|
||||
label70:
|
||||
{
|
||||
Throwable var10000;
|
||||
label79:
|
||||
{
|
||||
boolean var10001;
|
||||
try {
|
||||
if (var1.contains(var7)) {
|
||||
var5 = this.d.loadClass(var1);
|
||||
} else {
|
||||
String[] var17;
|
||||
int var8 = (var17 = f).length;
|
||||
int var9 = 0;
|
||||
|
||||
while (var9 < var8) {
|
||||
String var10 = var17[var9];
|
||||
|
||||
try {
|
||||
var5 = this.d.loadClass(var10 + "." + var1);
|
||||
break;
|
||||
} catch (Throwable var13) {
|
||||
++var9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (var5 == null) {
|
||||
break label71;
|
||||
}
|
||||
} catch (Throwable var15) {
|
||||
var10000 = var15;
|
||||
var10001 = false;
|
||||
break label79;
|
||||
}
|
||||
|
||||
if (var5 == ViewStub.class) {
|
||||
break label71;
|
||||
}
|
||||
|
||||
try {
|
||||
if (var5.getClassLoader() != this.d) {
|
||||
break label71;
|
||||
}
|
||||
break label70;
|
||||
} catch (Throwable var14) {
|
||||
var10000 = var14;
|
||||
var10001 = false;
|
||||
}
|
||||
}
|
||||
|
||||
Throwable var18 = var10000;
|
||||
(new StringBuilder("load view err:")).append(Log.getStackTraceString(var18));
|
||||
break label71;
|
||||
}
|
||||
|
||||
var6 = true;
|
||||
}
|
||||
|
||||
if (!var6) {
|
||||
this.g.a.add(var1);
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
var4 = var5.getConstructor(Context.class, AttributeSet.class);
|
||||
this.g.b.put(var1, var4);
|
||||
} catch (Throwable var12) {
|
||||
(new StringBuilder("create view err:")).append(Log.getStackTraceString(var12));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
View var16 = null;
|
||||
if (var4 != null) {
|
||||
var16 = (View) var4.newInstance(var2, var3);
|
||||
}
|
||||
|
||||
return var16;
|
||||
} catch (Throwable var11) {
|
||||
(new StringBuilder("create view err:")).append(Log.getStackTraceString(var11));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class a {
|
||||
public HashSet<String> a = new HashSet();
|
||||
public HashMap<String, Constructor<?>> b = new HashMap();
|
||||
|
||||
public a() {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.amap.api.col.n3;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
/**
|
||||
* 这里是为了解决 使用换肤框架后,高德地图初始化有问题加入的
|
||||
* 问题原因是:
|
||||
* skin 框架会替换 LayoutInflater 中的 setFactory2 从而导致高德 le 中的 setFactory 失效。
|
||||
* 解决方案为:
|
||||
* 直接通过内存地址替换整个 ArtMethod,来将需要修改的高德SDK中的方法指向我们修改过后的方法。
|
||||
*/
|
||||
public class lg2 extends lg {
|
||||
static le2 b;
|
||||
|
||||
public static View a(Context var0, int var1, ViewGroup var2) {
|
||||
XmlResourceParser var9 = a().getXml(var1);
|
||||
if (!a) {
|
||||
return LayoutInflater.from(var0).inflate(var9, var2);
|
||||
} else {
|
||||
try {
|
||||
if (b == null) {
|
||||
b = new le2(var0, c == -1 ? 0 : c, lg.class.getClassLoader());
|
||||
}
|
||||
b.a(c == -1 ? 0 : c);
|
||||
View var3 = LayoutInflater.from(b).inflate(var9, var2);
|
||||
return var3;
|
||||
} catch (Throwable var7) {
|
||||
var7.printStackTrace();
|
||||
np.c(var7, "ResourcesUtil", "selfInflate(Activity activity, int resource, ViewGroup root)");
|
||||
} finally {
|
||||
var9.close();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.android.internal.policy;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/25/20 5:12 PM
|
||||
*/
|
||||
public class MyPhoneLayoutInflater extends LayoutInflater {
|
||||
private static final String[] sClassPrefixList = {
|
||||
"android.widget.",
|
||||
"android.webkit.",
|
||||
"android.app."
|
||||
};
|
||||
|
||||
/**
|
||||
* Instead of instantiating directly, you should retrieve an instance
|
||||
* through {@link Context#getSystemService}
|
||||
*
|
||||
* @param context The Context in which in which to find resources and other
|
||||
* application-specific things.
|
||||
* @see Context#getSystemService
|
||||
*/
|
||||
public MyPhoneLayoutInflater(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
protected MyPhoneLayoutInflater(LayoutInflater original, Context newContext) {
|
||||
super(original, newContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Override onCreateView to instantiate names that correspond to the
|
||||
* widgets known to the Widget factory. If we don't find a match,
|
||||
* call through to our super class.
|
||||
*/
|
||||
@Override
|
||||
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
|
||||
for (String prefix : sClassPrefixList) {
|
||||
try {
|
||||
View view = createView(name, prefix, attrs);
|
||||
if (view != null) {
|
||||
return view;
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
// In this case we want to let the base class take a crack
|
||||
// at it.
|
||||
}
|
||||
}
|
||||
|
||||
return super.onCreateView(name, attrs);
|
||||
}
|
||||
|
||||
public LayoutInflater cloneInContext(Context newContext) {
|
||||
return new MyPhoneLayoutInflater(this, newContext);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ public class SmallMapDirectionView extends RelativeLayout {
|
||||
private AMapNaviView mAMapNaviView;
|
||||
private DirectionRotateAnimation mRotateAnimation;
|
||||
private int lastAngle = 0;
|
||||
private int zoomLevel = 15;
|
||||
|
||||
public SmallMapDirectionView(Context context) {
|
||||
this(context, null);
|
||||
@@ -133,19 +134,19 @@ public class SmallMapDirectionView extends RelativeLayout {
|
||||
options.setNaviArrowVisible(false);
|
||||
// 通过路线是否自动置灰,仅支持驾车导航
|
||||
options.setAfterRouteAutoGray(false);
|
||||
options.setZoom(((int) 9));
|
||||
//options.setZoom(((int) 9));
|
||||
//options.setPointToCenter(0.7D, 0.5D);
|
||||
// 2D模式
|
||||
options.setTilt(0);
|
||||
// 黑夜模式
|
||||
// options.setNaviNight(true);
|
||||
// options.setNaviNight(true);
|
||||
// 自定义地图样式
|
||||
options.setCustomMapStylePath(styleFilePath);
|
||||
mAMapNaviView.setViewOptions(options);
|
||||
}
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12);
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
|
||||
aMap.moveCamera(cameraUpdate);
|
||||
|
||||
aMap.setOnCameraChangeListener(new AMap.OnCameraChangeListener() {
|
||||
@@ -175,55 +176,53 @@ public class SmallMapDirectionView extends RelativeLayout {
|
||||
}
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12);
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
|
||||
aMap.moveCamera(cameraUpdate);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
// 判断是否有样式文件存在
|
||||
File styleExit = new File(styleFilePath);
|
||||
if (!styleExit.exists()) {
|
||||
FileUtils.copy(
|
||||
context.getAssets().open("small_map_style.data"),
|
||||
styleFilePath,
|
||||
new FileUtils.FileCopyListener() {
|
||||
//File styleExit = new File(styleFilePath);
|
||||
FileUtils.copy(
|
||||
context.getAssets().open("small_map_style.data"),
|
||||
styleFilePath,
|
||||
new FileUtils.FileCopyListener() {
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
Log.w("FileCopyListener", "onStart=");
|
||||
@Override
|
||||
public void onStart() {
|
||||
Log.w("FileCopyListener", "onStart=");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Exception e) {
|
||||
Log.w("FileCopyListener", "onFail=");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProcess(int process) {
|
||||
Log.w("FileCopyListener", "onProcess=" + process);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(String toPath) {
|
||||
Log.w("FileCopyListener", "onFinish toPath=" + toPath);
|
||||
|
||||
// 高德地图有bug,所以需要多次调用设置皮肤才能成功
|
||||
if (options != null) {
|
||||
options.setCustomMapStylePath(styleFilePath);
|
||||
mAMapNaviView.setViewOptions(options);
|
||||
}
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(12);
|
||||
aMap.moveCamera(cameraUpdate);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Exception e) {
|
||||
Log.w("FileCopyListener", "onFail=");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProcess(int process) {
|
||||
Log.w("FileCopyListener", "onProcess=" + process);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(String toPath) {
|
||||
Log.w("FileCopyListener", "onFinish toPath=" + toPath);
|
||||
|
||||
// 高德地图有bug,所以需要多次调用设置皮肤才能成功
|
||||
if (options != null) {
|
||||
options.setCustomMapStylePath(styleFilePath);
|
||||
mAMapNaviView.setViewOptions(options);
|
||||
}
|
||||
|
||||
//设置希望展示的地图缩放级别
|
||||
CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(zoomLevel);
|
||||
aMap.moveCamera(cameraUpdate);
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,22 +1,30 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.amap.api.col.n3.lg;
|
||||
import com.amap.api.col.n3.lg2;
|
||||
import com.mogo.hook.HookManager;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoSmallMapProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
@@ -26,9 +34,11 @@ import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusChangedListener {
|
||||
private final String TAG = "SmallVisionProvider";
|
||||
|
||||
private Intent mSmallMapServiceIntent;
|
||||
private Context mContext;
|
||||
|
||||
private WindowManagerView mWindowManagerView;
|
||||
private SmallMapDirectionView mSmallMapDirectionView;
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return null;
|
||||
@@ -76,22 +86,22 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
public void onDestroy() {
|
||||
Log.d(TAG, "小地图模块销毁……");
|
||||
hidePanel();
|
||||
// 释放组件内存
|
||||
mSmallMapDirectionView = null;
|
||||
mWindowManagerView = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPanel() {
|
||||
Log.d(TAG, "小地图模块触发展示……");
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
mSmallMapServiceIntent = new Intent(mContext, SmallMapService.class);
|
||||
mContext.startService(mSmallMapServiceIntent);
|
||||
}
|
||||
addSmallMapView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePanel() {
|
||||
Log.d(TAG, "小地图模块触发隐藏……");
|
||||
if (mSmallMapServiceIntent != null) {
|
||||
AbsMogoApplication.getApp().stopService(mSmallMapServiceIntent);
|
||||
if (mWindowManagerView != null && mWindowManagerView.isShowing()) {
|
||||
mWindowManagerView.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,4 +132,44 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加小地图View
|
||||
*/
|
||||
private void addSmallMapView() {
|
||||
Logger.d(TAG, "addSmallMapView");
|
||||
|
||||
try {
|
||||
// 替换高德地图的方法,解决因为加入换肤框架导致地图初始化失败
|
||||
Method srcMethod = lg.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class);
|
||||
Method destMethod = lg2.class.getDeclaredMethod("a", Context.class, int.class, ViewGroup.class);
|
||||
HookManager.get().hookMethod(srcMethod, destMethod);
|
||||
Logger.d(TAG, "hook 高德地图成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 初始化小地图控件
|
||||
if (mSmallMapDirectionView == null) {
|
||||
mSmallMapDirectionView = new SmallMapDirectionView(mContext);
|
||||
}
|
||||
|
||||
if (mWindowManagerView == null) {
|
||||
mWindowManagerView = new WindowManagerView.Builder(mContext)
|
||||
.contentView(mSmallMapDirectionView)
|
||||
.size(
|
||||
WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
WindowManager.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
.position(
|
||||
mContext.getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_x),
|
||||
mContext.getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_y)
|
||||
)
|
||||
.gravity(Gravity.TOP | Gravity.LEFT)
|
||||
.showInWindowManager();
|
||||
}
|
||||
mWindowManagerView.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XObuEventEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
@@ -178,6 +179,10 @@ public class V2XObuManager implements IObuCallback, Handler.Callback {
|
||||
@Override
|
||||
public void onEventInfoCallback(MogoObuEventInfo info) {
|
||||
Logger.d("V2X_OBU_EVENT", "carEventInfo==" + info);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
Logger.d("V2X_OBU_EVENT","vr模式下不展示obu事件");
|
||||
return;
|
||||
}
|
||||
Long last = intervalMap.get(info.getTypeCode());
|
||||
if (last == null) {
|
||||
last = 0L;
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.v2x.adapter.holder;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -10,11 +11,13 @@ import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.animation.BezierAnimationView;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
@@ -23,6 +26,7 @@ import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.common.entity.V2XLiveCarInfoEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
|
||||
@@ -81,7 +85,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
private HeartLikeView ivEventZan;
|
||||
|
||||
private ViewGroup mViewGroup;
|
||||
|
||||
private WindowManagerView mWindowManagerView;
|
||||
|
||||
// 上传事件的用户信息
|
||||
private MarkerUserInfo mUserInfo;
|
||||
@@ -312,7 +316,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 展示事件的图片/视频资源
|
||||
* */
|
||||
@@ -364,6 +368,53 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
private void bezierAnimation(int[] loc) {
|
||||
if (mWindowManagerView == null) {
|
||||
Log.d(TAG, "bezierAnimation:null");
|
||||
mWindowManagerView = new WindowManagerView.Builder(mContext.getApplicationContext())
|
||||
.contentView(R.layout.module_common_bezier_layout)
|
||||
.size(WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
WindowManager.LayoutParams.WRAP_CONTENT)
|
||||
.position(loc[0], loc[1])
|
||||
.gravity(Gravity.TOP | Gravity.LEFT)
|
||||
.showInWindowManager();
|
||||
}
|
||||
try {
|
||||
if (mWindowManagerView.isShowing()) {
|
||||
return;
|
||||
}
|
||||
mWindowManagerView.show();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
BezierAnimationView bezierAnimationView = mWindowManagerView.findViewById(R.id.bezier_view);
|
||||
bezierAnimationView.bezierAnimationStart();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// mWindowManagerView.dismiss();
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
public int[] getLocation(View v) {
|
||||
int[] loc = new int[4];
|
||||
int[] location = new int[2];
|
||||
v.getLocationOnScreen(location);
|
||||
loc[0] = location[0];
|
||||
loc[1] = location[1];
|
||||
int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
||||
int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
|
||||
v.measure(w, h);
|
||||
|
||||
loc[2] = v.getMeasuredWidth();
|
||||
loc[3] = v.getMeasuredHeight();
|
||||
|
||||
//base = computeWH();
|
||||
return loc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 为了给车聊聊更多的信息需要重新查询一次
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.v2x.scenario.impl;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
@@ -91,7 +92,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
mV2XScenario = new V2XIllegalParkScenario();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_EVENT_UGC_WARNING:
|
||||
mV2XScenario = new V2XEventUgcScenario();
|
||||
mV2XScenario = V2XServiceManager.getMoGoStatusManager().isVrMode() ? null : new V2XEventUgcScenario();
|
||||
break;
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW:
|
||||
mV2XScenario = new V2XVoiceCallLiveScenario();
|
||||
|
||||
@@ -59,7 +59,7 @@ public class V2XRoadVideoCarScenario extends AbsV2XScenario<V2XEventShowEntity>
|
||||
new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(int) V2XUtils.getApp().getResources()
|
||||
.getDimension(R.dimen.v2x_video_window_height));
|
||||
.getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode()? R.dimen.dp_394:R.dimen.v2x_video_window_height));
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<TextView
|
||||
android:id="@+id/tvEventTypeTitle"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_marginStart="@dimen/dp_31"
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
android:background="@drawable/bg_v2x_event_type_red_vr"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<TextView
|
||||
android:id="@+id/tvImgTextContent"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="@drawable/bg_v2x_event_type_orange_vr"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -140,20 +140,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="#2651A6"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="折行显示文案测试数据"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTriggerParkEvent"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -120,5 +120,4 @@
|
||||
<dimen name="v2x_driving_heigt">46px</dimen>
|
||||
<dimen name="v2x_recommond_route_size">26px</dimen>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -57,6 +57,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import static com.mogo.module.common.utils.SPConst.getSpGuide;
|
||||
@@ -85,7 +86,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
private IMogoStatusManager mStatusManager = SingletonsHolder.get( IMogoStatusManager.class );
|
||||
|
||||
private boolean mIsReleased = true;
|
||||
private List<IMogoAdasDataCallback> adasDataCallbackList = new ArrayList<>();
|
||||
private List< IMogoAdasDataCallback > adasDataCallbackList = new ArrayList<>();
|
||||
|
||||
private IAutopolitDataCallBack mAutopolitDataCallBack;
|
||||
|
||||
@@ -113,6 +114,13 @@ public class MogoADASController implements IMogoADASController {
|
||||
// 物体识别返回
|
||||
// Logger.d( TAG, "onRectData = %s", rectInfo.toString() );
|
||||
mLastFrameData = rectInfo;
|
||||
// 仅在 vr 模式下显示 adas 识别车辆
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
return;
|
||||
}
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched() ) {
|
||||
return;
|
||||
}
|
||||
handleAdasRecognizedData( rectInfo );
|
||||
}
|
||||
|
||||
@@ -210,7 +218,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
@Override
|
||||
public void showADAS() {
|
||||
|
||||
if( DebugConfig.isNeedLoadGuideModule() ){
|
||||
if ( DebugConfig.isNeedLoadGuideModule() ) {
|
||||
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( getSpGuide(), false ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -272,13 +280,13 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void requestGetCarModelListInfo() {
|
||||
if (DebugConfig.isMapBased()) {
|
||||
Logger.d(TAG, "requestGetCarModelListInfo");
|
||||
if ( DebugConfig.isMapBased() ) {
|
||||
Logger.d( TAG, "requestGetCarModelListInfo" );
|
||||
// 向adas发送车模list
|
||||
String carModelList = SharedPrefsMgr.getInstance(context).getString(
|
||||
"CAR_MODEL_LIST", "");
|
||||
if (carModelList != null && !carModelList.isEmpty()) {
|
||||
AutopilotServiceManage.getInstance().settingCarModelListInfo(carModelList);
|
||||
String carModelList = SharedPrefsMgr.getInstance( context ).getString(
|
||||
"CAR_MODEL_LIST", "" );
|
||||
if ( carModelList != null && !carModelList.isEmpty() ) {
|
||||
AutopilotServiceManage.getInstance().settingCarModelListInfo( carModelList );
|
||||
}
|
||||
// 此处进行网络请求,请求成功后再通知一次adas
|
||||
requestCarModelList();
|
||||
@@ -318,6 +326,10 @@ public class MogoADASController implements IMogoADASController {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
AutopilotServiceManage.getInstance().showAdas();
|
||||
} catch ( Exception e ) {
|
||||
@@ -368,6 +380,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
|
||||
private Context context;
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
AutopilotServiceManage.getInstance().init( context );
|
||||
@@ -464,40 +477,40 @@ public class MogoADASController implements IMogoADASController {
|
||||
private String currentSn = TEST_SN;
|
||||
|
||||
private void requestCarModelList() {
|
||||
Map<String, String> params = new HashMap<>(8);
|
||||
params.put("sn", Utils.getSn());
|
||||
Map< String, String > params = new HashMap<>( 8 );
|
||||
params.put( "sn", Utils.getSn() );
|
||||
// currentSn = useTestSn ? TEST_SN : Utils.getSn();
|
||||
// params.put("sn", currentSn);
|
||||
MogoApisHandler.getInstance().getApis().getNetworkApi().create(CarModelInfoNetApiServices.class, CarModelInfoNetApiServices.getBaseUrl()).
|
||||
requestCarModelList(params).
|
||||
subscribeOn(Schedulers.io()).
|
||||
observeOn(Schedulers.io()).
|
||||
subscribe(new SubscribeImpl<CarModelListResponse>(RequestOptions.create(context)) {
|
||||
MogoApisHandler.getInstance().getApis().getNetworkApi().create( CarModelInfoNetApiServices.class, CarModelInfoNetApiServices.getBaseUrl() ).
|
||||
requestCarModelList( params ).
|
||||
subscribeOn( Schedulers.io() ).
|
||||
observeOn( Schedulers.io() ).
|
||||
subscribe( new SubscribeImpl< CarModelListResponse >( RequestOptions.create( context ) ) {
|
||||
@Override
|
||||
public void onSuccess(CarModelListResponse o) {
|
||||
super.onSuccess(o);
|
||||
Logger.d(TAG, "请求车模列表成功: " + o);
|
||||
public void onSuccess( CarModelListResponse o ) {
|
||||
super.onSuccess( o );
|
||||
Logger.d( TAG, "请求车模列表成功: " + o );
|
||||
// 保存到sp中
|
||||
String value = GsonUtil.jsonFromObject(o.getResult());
|
||||
SharedPrefsMgr.getInstance(context).putString("CAR_MODEL_LIST",
|
||||
value);
|
||||
if(value != null && !value.isEmpty()){
|
||||
AutopilotServiceManage.getInstance().settingCarModelListInfo(value);
|
||||
String value = GsonUtil.jsonFromObject( o.getResult() );
|
||||
SharedPrefsMgr.getInstance( context ).putString( "CAR_MODEL_LIST",
|
||||
value );
|
||||
if ( value != null && !value.isEmpty() ) {
|
||||
AutopilotServiceManage.getInstance().settingCarModelListInfo( value );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
Logger.e(TAG, e, "请求自车模型失败");
|
||||
public void onError( Throwable e ) {
|
||||
super.onError( e );
|
||||
Logger.e( TAG, e, "请求自车模型失败" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
Logger.e(TAG, "请求自车模型失败: " + message);
|
||||
public void onError( String message, int code ) {
|
||||
super.onError( message, code );
|
||||
Logger.e( TAG, "请求自车模型失败: " + message );
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.service.impl.singleton;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.impl.fragmentmanager.MogoFragmentManager;
|
||||
import com.mogo.service.impl.map.MogoMapService;
|
||||
@@ -11,6 +12,8 @@ import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -34,9 +37,10 @@ public class SingletonsHolder {
|
||||
sSingletons.put( IMogoNetwork.class, new MogoNetWorkService() );
|
||||
sSingletons.put( IMogoMsgCenter.class, new MogoMsgCenter() );
|
||||
sSingletons.put( IMogoStatusManager.class, new MogoStatusManager() );
|
||||
sSingletons.put( IMogoRefreshStrategyController.class, ARouter.getInstance().navigation( IMogoRefreshStrategyController.class ) );
|
||||
}
|
||||
|
||||
public static < T > T get( Class<T> clazz ) {
|
||||
public static < T > T get( Class< T > clazz ) {
|
||||
return ( T ) sSingletons.get( clazz );
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ include ':app2'
|
||||
include ':foudations:httpdns-base'
|
||||
include ':foudations:httpdns-tencent'
|
||||
include ':foudations:httpdns-noop'
|
||||
include ':modules:mogo-modules-mvision'
|
||||
//include ':modules:mogo-modules-mvision'
|
||||
include ':foudations:mogo-base-websocket-sdk'
|
||||
include ':tts:tts-base'
|
||||
include ':tts:tts-di'
|
||||
|
||||
@@ -70,12 +70,16 @@ public class SkinCompatDelegate implements LayoutInflater.Factory2 {
|
||||
}
|
||||
|
||||
List<SkinWrapper> wrapperList = SkinCompatManager.getInstance().getWrappers();
|
||||
for (SkinWrapper wrapper : wrapperList) {
|
||||
Context wrappedContext = wrapper.wrapContext(mContext, parent, attrs);
|
||||
if (wrappedContext != null) {
|
||||
context = wrappedContext;
|
||||
|
||||
if ( wrapperList != null ) {
|
||||
for (SkinWrapper wrapper : wrapperList) {
|
||||
Context wrappedContext = wrapper.wrapContext(mContext, parent, attrs);
|
||||
if (wrappedContext != null) {
|
||||
context = wrappedContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mSkinCompatViewInflater.createView(parent, name, context, attrs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user