This commit is contained in:
unknown
2020-11-19 11:25:29 +08:00
649 changed files with 4371 additions and 2766 deletions

1
.idea/gradle.xml generated
View File

@@ -77,7 +77,6 @@
</set> </set>
</option> </option>
<option name="resolveModulePerSourceSet" value="false" /> <option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" /> <asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" /> <groovy codeStyle="LEGACY" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
</project> </project>

View File

@@ -2,6 +2,7 @@ package com.mogo.launcher;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Process;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
@@ -27,6 +28,7 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths; import com.mogo.service.MogoServicePaths;
import com.mogo.service.passport.IMogoTicketCallback; import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.test.crashreport.ITestCrashReportProvider; import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.ProcessUtils;
import com.mogo.utils.UiThreadHandler; import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel; import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger; import com.mogo.utils.logger.Logger;
@@ -70,6 +72,9 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) ); MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
} else { } else {
} }
// TODO
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) ); MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) { if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) ); MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
@@ -90,7 +95,7 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) ); MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) ); MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE,"GlobalUnwake")); MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake" ) );
if ( !DebugConfig.isLauncher() ) { if ( !DebugConfig.isLauncher() ) {
PersistentManager.getInstance().initManager( this ); PersistentManager.getInstance().initManager( this );
@@ -109,13 +114,11 @@ public class MogoApplication extends AbsMogoApplication {
@Override @Override
protected boolean shouldInit() { protected boolean shouldInit() {
return !LeakCanary.isInAnalyzerProcess( this ); Logger.w( TAG, "evaluate shouldInit() with: %s", ProcessUtils.getProcessName( Process.myPid() ) );
return ProcessUtils.isMainProcess( this );
} }
private void initDebugConfig() { private void initDebugConfig() {
if ( !shouldInit() ) {
return;
}
DebugConfig.setNetMode( BuildConfig.NET_ENV ); DebugConfig.setNetMode( BuildConfig.NET_ENV );
DebugConfig.setDebug( BuildConfig.DEBUG ); DebugConfig.setDebug( BuildConfig.DEBUG );
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE ); DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
@@ -186,10 +189,12 @@ public class MogoApplication extends AbsMogoApplication {
private void prepareSocketAndLocationServices( IMogoServiceApis apis ) { private void prepareSocketAndLocationServices( IMogoServiceApis apis ) {
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() ); apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() );
apis.getLocationInfoApi().start(); if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> { apis.getLocationInfoApi().start();
apis.getLocationInfoApi().provideLocation( location ); apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
} ); apis.getLocationInfoApi().provideLocation( location );
} );
}
} }
@Override @Override

View File

@@ -157,7 +157,7 @@ targetSdkVersion : 22,
gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}", gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}", gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
adasapi : "com.zhidao.autopilot.support:adas:1.0.1", adasapi : "com.zhidao.autopilot.support:adas:1.0.6.3",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5", adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5",
// 个人中心的SDK // 个人中心的SDK

View File

@@ -144,7 +144,6 @@ public class SocketManager implements IMogoSocketManager, OnSocketReceiveCallbac
if ( listener != null ) { if ( listener != null ) {
listener.onAck( msgId ); listener.onAck( msgId );
} }
Logger.d( TAG, "send message success: msgType = %d, appId = %s, productLine = %d", msgType, appId, productLine );
} catch ( InvalidProtocolBufferException e ) { } catch ( InvalidProtocolBufferException e ) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@@ -67,7 +67,7 @@ public class ProcessUtils {
* @param pid 进程号 * @param pid 进程号
* @return 进程名 * @return 进程名
*/ */
private static String getProcessName( int pid ) { public static String getProcessName( int pid ) {
BufferedReader reader = null; BufferedReader reader = null;
try { try {
reader = new BufferedReader( new FileReader( "/proc/" + pid + "/cmdline" ) ); reader = new BufferedReader( new FileReader( "/proc/" + pid + "/cmdline" ) );

View File

@@ -52,80 +52,80 @@ PASSWORD=xintai2018
RELEASE=false RELEASE=false
# 模块版本 # 模块版本
## 工程内模块 ## 工程内模块
MOGO_COMMONS_VERSION=2.0.6 MOGO_COMMONS_VERSION=2.0.7
MOGO_UTILS_VERSION=2.0.6 MOGO_UTILS_VERSION=2.0.7
MAP_AMAP_VERSION=2.0.6 MAP_AMAP_VERSION=2.0.7
MAP_AUTONAVI_VERSION=2.0.6 MAP_AUTONAVI_VERSION=2.0.7
MOGO_MAP_VERSION=2.0.6 MOGO_MAP_VERSION=2.0.7
MOGO_MAP_API_VERSION=2.0.6 MOGO_MAP_API_VERSION=2.0.7
MOGO_SERVICE_VERSION=2.0.6 MOGO_SERVICE_VERSION=2.0.7
MOGO_SERVICE_API_VERSION=2.0.6 MOGO_SERVICE_API_VERSION=2.0.7
MOGO_CONNECTION_VERSION=2.0.6 MOGO_CONNECTION_VERSION=2.0.7
MOGO_MODULE_APPS_VERSION=2.0.6 MOGO_MODULE_APPS_VERSION=2.0.7
MOGO_MODULE_NAVI_VERSION=2.0.6 MOGO_MODULE_NAVI_VERSION=2.0.7
MOGO_MODULE_SHARE_VERSION=2.0.6 MOGO_MODULE_SHARE_VERSION=2.0.7
MOGO_MODULE_COMMON_VERSION=2.0.6 MOGO_MODULE_COMMON_VERSION=2.0.7
MOGO_MODULE_MAIN_VERSION=2.0.6 MOGO_MODULE_MAIN_VERSION=2.0.7
MOGO_MODULE_MAP_VERSION=2.0.6 MOGO_MODULE_MAP_VERSION=2.0.7
MOGO_MODULE_SERVICE_VERSION=2.0.6 MOGO_MODULE_SERVICE_VERSION=2.0.7
MOGO_MODULE_EXTENSIONS_VERSION=2.0.6 MOGO_MODULE_EXTENSIONS_VERSION=2.0.7
MOGO_MODULE_SEARCH_VERSION=2.0.6 MOGO_MODULE_SEARCH_VERSION=2.0.7
MOGO_MODULE_BACK_VERSION=2.0.6 MOGO_MODULE_BACK_VERSION=2.0.7
MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.6 MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.7
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.6 MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.7
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.6 MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.7
MOGO_MODULE_AUTHORIZE_VERSION=2.0.6 MOGO_MODULE_AUTHORIZE_VERSION=2.0.7
MOGO_MODULE_GUIDE_VERSION=2.0.6 MOGO_MODULE_GUIDE_VERSION=2.0.7
MOGO_MODULE_MEDIA_VERSION=2.0.6 MOGO_MODULE_MEDIA_VERSION=2.0.7
MOGO_MODULE_MAIN_LAUNCHER_VERSION=2.0.6 MOGO_MODULE_MAIN_LAUNCHER_VERSION=2.0.7
MOGO_MODULE_MAIN_INDEPENDENT_VERSION=2.0.6 MOGO_MODULE_MAIN_INDEPENDENT_VERSION=2.0.7
MOGO_MODULE_V2X_VERSION=2.0.6 MOGO_MODULE_V2X_VERSION=2.0.7
# 基础服务实现passport、socket、location # 基础服务实现passport、socket、location
MOGO_BASE_SERVICES_APK_VERSION=2.0.6 MOGO_BASE_SERVICES_APK_VERSION=2.0.7
MOGO_BASE_SERVICES_SDK_VERSION=2.0.6 MOGO_BASE_SERVICES_SDK_VERSION=2.0.7
## 工程外部模块 ## 工程外部模块
# 探路 # 探路
MOGO_MODULE_TANLU_VERSION=2.0.6 MOGO_MODULE_TANLU_VERSION=2.0.7
# 视频引导 # 视频引导
MOGO_MODULE_GUIDESHOW_VERSION=2.0.6 MOGO_MODULE_GUIDESHOW_VERSION=2.0.7
# 推送 # 推送
MOGO_MODULE_PUSH_VERSION=2.0.6 MOGO_MODULE_PUSH_VERSION=2.0.7
MOGO_MODULE_PUSH_BASE_VERSION=2.0.6 MOGO_MODULE_PUSH_BASE_VERSION=2.0.7
MOGO_MODULE_PUSH_NOOP_VERSION=2.0.6 MOGO_MODULE_PUSH_NOOP_VERSION=2.0.7
# 探路上报和分享模块 # 探路上报和分享模块
TANLULIB_VERSION=2.0.6 TANLULIB_VERSION=2.0.7
MOGO_TANLU_API_VERSION=2.0.6 MOGO_TANLU_API_VERSION=2.0.7
#左侧面板模块 #左侧面板模块
MOGO_MODULE_LEFT_PANEL_VERSION=2.0.6 MOGO_MODULE_LEFT_PANEL_VERSION=2.0.7
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.6 MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.7
# 小控件 # 小控件
MOGO_MODULE_WIDGETS_VERSION=2.0.6 MOGO_MODULE_WIDGETS_VERSION=2.0.7
# obu # obu
MOGO_MODULE_OBU_VERSION=2.0.6 MOGO_MODULE_OBU_VERSION=2.0.7
# 皮肤 # 皮肤
MOGO_SKIN_SUPPORT_VERSION=2.0.6 MOGO_SKIN_SUPPORT_VERSION=2.0.7
MOGO_SKIN_LIGHT_VERSION=2.0.6 MOGO_SKIN_LIGHT_VERSION=2.0.7
MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.6 MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.7
MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.6 MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.7
SKIN_SUPPORT_VERSION=2.0.6 SKIN_SUPPORT_VERSION=2.0.7
SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.6 SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.7
SKIN_SUPPORT_CARDVIEW_VERSION=2.0.6 SKIN_SUPPORT_CARDVIEW_VERSION=2.0.7
SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.6 SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.7
SKIN_SUPPORT_DESIGN_VERSION=2.0.6 SKIN_SUPPORT_DESIGN_VERSION=2.0.7
# 闪屏页 # 闪屏页
MOGO_MODULE_SPLASH_VERSION=2.0.6 MOGO_MODULE_SPLASH_VERSION=2.0.7
MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.6 MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.7
# monitor # monitor
MOGO_MODULE_MONITOR_VERSION=2.0.6 MOGO_MODULE_MONITOR_VERSION=2.0.7
# bugly # bugly
CRASHREPORT_VERSION=2.0.6 CRASHREPORT_VERSION=2.0.7
CRASHREPORT_BUGLY_VERSION=2.0.6 CRASHREPORT_BUGLY_VERSION=2.0.7
CRASHREPORT_NOOP_VERSION=2.0.6 CRASHREPORT_NOOP_VERSION=2.0.7
## tts ## tts
TTS_BASE_VERSION=2.0.6 TTS_BASE_VERSION=2.0.7
TTS_DI_VERSION=2.0.6 TTS_DI_VERSION=2.0.7
TTS_ZHI_VERSION=2.0.6 TTS_ZHI_VERSION=2.0.7
TTS_NOOP_VERSION=2.0.6 TTS_NOOP_VERSION=2.0.7
######## 外部依赖引用 ######## 外部依赖引用
# 车聊聊 # 车聊聊

View File

@@ -1,18 +1,27 @@
package com.mogo.map.impl.amap; package com.mogo.map.impl.amap;
import android.content.Context; import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.location.Location; import android.location.Location;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock; import android.os.SystemClock;
import android.os.Trace; import android.os.Trace;
import android.util.Log; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.animation.Interpolator; import android.view.animation.Interpolator;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.amap.api.maps.AMap; import com.amap.api.maps.AMap;
import com.amap.api.maps.AMapUtils; import com.amap.api.maps.AMapUtils;
@@ -32,7 +41,9 @@ import com.amap.api.navi.AMapNaviViewListener;
import com.amap.api.navi.AMapNaviViewOptions; import com.amap.api.navi.AMapNaviViewOptions;
import com.amap.api.navi.enums.AMapNaviViewShowMode; import com.amap.api.navi.enums.AMapNaviViewShowMode;
import com.amap.api.navi.model.NaviInfo; import com.amap.api.navi.model.NaviInfo;
import com.mogo.commons.debug.DebugConfig; import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.mogo.map.IMogoMap; import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoMapView; import com.mogo.map.IMogoMapView;
import com.mogo.map.MogoLatLng; import com.mogo.map.MogoLatLng;
@@ -51,8 +62,11 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition; import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult; import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WindowUtils; import com.mogo.utils.WindowUtils;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger; import com.mogo.utils.logger.Logger;
import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.List; import java.util.List;
@@ -73,7 +87,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
AMapNaviViewListener, AMapNaviViewListener,
AMapMessageListener, AMapMessageListener,
AMap.OnCameraChangeListener, AMap.OnCameraChangeListener,
AMap.OnMyLocationChangeListener { AMap.OnMyLocationChangeListener,
Handler.Callback{
private static final String TAG = "AMapNaviViewWrapper"; private static final String TAG = "AMapNaviViewWrapper";
@@ -122,6 +137,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。 // 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() ); // options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
// 设置自车的图片对象 // 设置自车的图片对象
checkDefaultOption();
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) ); options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) );
// 设置指南针图标否在导航界面显示默认显示。true显示false隐藏。 // 设置指南针图标否在导航界面显示默认显示。true显示false隐藏。
options.setCompassEnabled( false ); options.setCompassEnabled( false );
@@ -525,9 +541,12 @@ public class AMapNaviViewWrapper implements IMogoMapView,
} }
} }
private boolean isVisible = false;
@Override @Override
public void showMyLocation( boolean visible ) { public void showMyLocation( boolean visible ) {
Logger.d( TAG, "showMyLocation1 %s", visible ); Logger.d( TAG, "showMyLocation1 %s", visible );
isVisible = visible;
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) { if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
return; return;
} }
@@ -543,14 +562,23 @@ public class AMapNaviViewWrapper implements IMogoMapView,
} else { } else {
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW ); style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW );
} }
mMapView.getMap().setMyLocationStyle( style );
if ( visible ) { if ( visible ) {
// 强制刷新一遍车标 // 强制刷新一遍车标
style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) ); setCarCursorOption(null);
// style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
} }
mMapView.getMap().setMyLocationStyle( style );
} }
} }
private boolean isInEmphasizeAnim = false;
@Override
public void emphasizeMyLocation() {
isInEmphasizeAnim = true;
setCarCursorOption(null);
}
@Override @Override
public void showMyLocation( View view ) { public void showMyLocation( View view ) {
if ( NaviClient.getInstance( getContext() ).isNaviing() ) { if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
@@ -874,7 +902,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
} else { } else {
if ( ( int ) location.getBearing() == 0 if ( ( int ) location.getBearing() == 0
&& mLastDriveLocationShadow != null ) { && mLastDriveLocationShadow != null ) {
if ( mMyLocationMarker == null ) { if ( mMyLocationMarker == null || mMyLocationMarker.isRemoved() ) {
initMyLocationMarker(); initMyLocationMarker();
} }
if ( mMyLocationMarker != null ) { if ( mMyLocationMarker != null ) {
@@ -911,18 +939,41 @@ public class AMapNaviViewWrapper implements IMogoMapView,
return mIsCarLocked; return mIsCarLocked;
} }
private String myLocationConfigCache = null;
private boolean isUseDefaultOption = false;
private void checkDefaultOption(){
String myLocationConfig = SharedPrefsMgr.getInstance(getContext()).getString(
"MY_LOCATION_CONFIG", "");
if (myLocationConfigCache == null || !myLocationConfigCache.equals(myLocationConfig)) {
// 内存缓存的地址为空,或者内存缓存的地址和sp保存的config不一致那得重新获取bitmap
loadMyLocationIcon(myLocationConfig);
} else if (isInEmphasizeAnim) {
DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(myLocationBitmap));
}
}
@Override @Override
public void setCarCursorOption( CarCursorOption option ) { public void setCarCursorOption( CarCursorOption option ) {
if (!isVisible) {
// 当前自车图标没有显示,所以先不走下面的流程
return;
}
if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) { if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) {
mCarCursorOption.destroy(); mCarCursorOption.destroy();
} }
checkDefaultOption();
if ( option != null ) { if ( option != null ) {
try { try {
isUseDefaultOption = false;
mCarCursorOption = option.clone(); mCarCursorOption = option.clone();
} catch ( Exception e ) { } catch ( Exception e ) {
isUseDefaultOption = true;
mCarCursorOption = DEFAULT_OPTION; mCarCursorOption = DEFAULT_OPTION;
} }
} else { } else {
isUseDefaultOption = true;
mCarCursorOption = DEFAULT_OPTION; mCarCursorOption = DEFAULT_OPTION;
} }
if ( !checkAMapView() ) { if ( !checkAMapView() ) {
@@ -981,4 +1032,96 @@ public class AMapNaviViewWrapper implements IMogoMapView,
mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) ); mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) );
} }
} }
protected void loadMyLocationIcon(String url) {
if ( Looper.myLooper() != Looper.getMainLooper() ) {
UiThreadHandler.post( ()-> loadMyLocationIconInUiThread(url));
} else {
loadMyLocationIconInUiThread(url);
}
}
private void loadMyLocationIconInUiThread(String url) {
if (!url.isEmpty()) {
RequestOptions options = new RequestOptions()
.placeholder( DEFAULT_OPTION.getCarCursorRes() )
.error( DEFAULT_OPTION.getCarCursorRes() )
.dontAnimate();
GlideApp.with( getContext() )
.asBitmap()
.load( url )
.apply( options )
.into( new SimpleTarget< Bitmap >() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition< ? super Bitmap > transition ) {
if (isUseDefaultOption) {
myLocationConfigCache = url;
myLocationBitmap = resource;
DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(resource));
setCarCursorOption(null);
}
}
@Override
public void onLoadStarted( @Nullable Drawable placeholder ) {
}
@Override
public void onLoadCleared( @Nullable Drawable placeholder ) {
}
@Override
public void onLoadFailed( @Nullable Drawable errorDrawable ) {
}
} );
}
}
private float emphasizeAnimOffset = 1f;
private Bitmap inflateMyLocation(Bitmap res) {
if (res == null) {
throw new IllegalArgumentException("inflate myLocation bitmap can not be null!");
}
View root =
LayoutInflater.from(getContext()).inflate(R.layout.module_map_amap_my_location, null, false);
ImageView iv = root.findViewById(R.id.module_map_amap_my_location_iv);
iv.setImageBitmap(res);
if (isInEmphasizeAnim) {
iv.setScaleX(emphasizeAnimOffset);
iv.setScaleY(emphasizeAnimOffset);
handler.sendEmptyMessageDelayed(MSG_CONTINUE_EMPHASIZE_ANIM, EMPHASIZE_ANIM_DELAY);
}
return BitmapDescriptorFactory.fromView(root).getBitmap();
}
/**
* 目前仅用于强调动画
*/
private Handler handler = new Handler(this);
private static final int MSG_CONTINUE_EMPHASIZE_ANIM = 1001;
private static final long EMPHASIZE_ANIM_DELAY = 80;
private int emphasizeAnimProgress = 0;
private Bitmap myLocationBitmap;
@Override
public boolean handleMessage(Message msg) {
if (msg.what == MSG_CONTINUE_EMPHASIZE_ANIM) {
if (emphasizeAnimProgress < 5) {
emphasizeAnimOffset += 0.1;
emphasizeAnimProgress++;
}else if(emphasizeAnimProgress<10){
emphasizeAnimOffset -= 0.1;
emphasizeAnimProgress++;
} else if (emphasizeAnimProgress == 10) {
isInEmphasizeAnim = false;
emphasizeAnimProgress = 0;
emphasizeAnimOffset = 1;
}
setCarCursorOption(null);
return true;
}
return false;
}
} }

View File

@@ -426,6 +426,11 @@ public class AMapViewWrapper implements IMogoMapView,
} }
} }
@Override
public void emphasizeMyLocation() {
// 空实现
}
@Override @Override
public void showMyLocation( View view ) { public void showMyLocation( View view ) {
if ( NaviClient.getInstance( getContext() ).isNaviing() ) { if ( NaviClient.getInstance( getContext() ).isNaviing() ) {

View File

@@ -99,6 +99,13 @@ public class AMapUIController implements IMogoMapUIController {
} }
} }
@Override
public void emphasizeMyLocation() {
if ( mClient != null ) {
mClient.emphasizeMyLocation();
}
}
@Override @Override
public void showMyLocation( View view ) { public void showMyLocation( View view ) {
if ( mClient != null ) { if ( mClient != null ) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView
android:id="@+id/module_map_amap_my_location_bg_iv"
android:layout_width="@dimen/module_map_amap_my_location_bg_size"
android:layout_height="@dimen/module_map_amap_my_location_bg_size"
android:src="@drawable/map_api_ic_current_location2"/>
<ImageView
android:id="@+id/module_map_amap_my_location_iv"
android:layout_width="@dimen/module_map_amap_my_location_icon_width"
android:layout_height="@dimen/module_map_amap_my_location_icon_height"
android:layout_gravity="center"
android:src="@drawable/module_map_amap_my_location_icon"/>
</FrameLayout>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_map_amap_my_location_bg_size">370px</dimen>
<dimen name="module_map_amap_my_location_icon_width">78px</dimen>
<dimen name="module_map_amap_my_location_icon_height">120px</dimen>
</resources>

View File

@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="path_width">60px</dimen> <dimen name="path_width">60px</dimen>
<dimen name="module_map_amap_my_location_icon_width">78px</dimen>
<dimen name="module_map_amap_my_location_icon_height">120px</dimen>
<dimen name="module_map_amap_my_location_bg_size">146px</dimen>
</resources> </resources>

View File

@@ -58,7 +58,6 @@ public class AutoNaviReceiver extends BroadcastReceiver {
} }
int keyType = intent.getIntExtra( "KEY_TYPE", 0 ); int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
Logger.d( TAG, "receive: keyType = %d", keyType );
switch ( keyType ) { switch ( keyType ) {
case 10001: case 10001:
handleAutoNaviInfo( context, intent ); handleAutoNaviInfo( context, intent );

View File

@@ -71,6 +71,11 @@ public interface IMogoMapUIController {
*/ */
void showMyLocation( View view ); void showMyLocation( View view );
/**
* 强调自车位置,加个动画突显一下自车位置
*/
void emphasizeMyLocation();
/** /**
* 以外部定位的方式改变当前位置 * 以外部定位的方式改变当前位置
* *

View File

@@ -92,6 +92,13 @@ public class MogoMapUIController implements IMogoMapUIController {
} }
} }
@Override
public void emphasizeMyLocation() {
if ( mDelegate != null ) {
mDelegate.emphasizeMyLocation();
}
}
@Override @Override
public void showMyLocation( View view ) { public void showMyLocation( View view ) {
if ( mDelegate != null ) { if ( mDelegate != null ) {

View File

@@ -4,15 +4,15 @@
package com.zhidao.mogo.tanlu.api; package com.zhidao.mogo.tanlu.api;
public final class BuildConfig { public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final boolean DEBUG = false;
public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.mogo.tanlu.api"; public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.mogo.tanlu.api";
/** /**
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME * @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
*/ */
@Deprecated @Deprecated
public static final String APPLICATION_ID = "com.zhidao.mogo.tanlu.api"; public static final String APPLICATION_ID = "com.zhidao.mogo.tanlu.api";
public static final String BUILD_TYPE = "debug"; public static final String BUILD_TYPE = "release";
public static final String FLAVOR = ""; public static final String FLAVOR = "";
public static final int VERSION_CODE = 1; public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "2.0.0"; public static final String VERSION_NAME = "2.0.1";
} }

View File

@@ -1 +0,0 @@
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.0","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]

View File

@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zhidao.mogo.tanlu.api" package="com.zhidao.mogo.tanlu.api"
android:versionCode="1" android:versionCode="1"
android:versionName="2.0.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="19" android:minSdkVersion="19"

View File

@@ -0,0 +1 @@
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.1","enabled":true,"outputFile":"mogo-tanlu-api-release.aar","fullName":"release","baseName":"release"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/jniLibs"/></dataSet></merger>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/shaders"/></dataSet></merger>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\jniLibs"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\jniLibs"/></dataSet></merger>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\shaders"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\shaders"/></dataSet></merger>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/assets"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/assets"/></dataSet></merger>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/res"/></dataSet><mergedItems/></merger>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\assets"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\intermediates\shader_assets\release\compileReleaseShaders\out"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\assets"/></dataSet></merger>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\res"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\rs\release"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\res"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\rs\release"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release" generated-set="release$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\res"/></dataSet><mergedItems/></merger>

View File

@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zhidao.mogo.tanlu.api" package="com.zhidao.mogo.tanlu.api"
android:versionCode="1" android:versionCode="1"
android:versionName="2.0.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="19" android:minSdkVersion="19"

View File

@@ -2,13 +2,13 @@
2<manifest xmlns:android="http://schemas.android.com/apk/res/android" 2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.zhidao.mogo.tanlu.api" 3 package="com.zhidao.mogo.tanlu.api"
4 android:versionCode="1" 4 android:versionCode="1"
5 android:versionName="2.0.0" > 5 android:versionName="2.0.1" >
6 6
7 <uses-sdk 7 <uses-sdk
8 android:minSdkVersion="19" 8 android:minSdkVersion="19"
8-->/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml 8-->F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
9 android:targetSdkVersion="22" /> 9 android:targetSdkVersion="22" />
9-->/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml 9-->F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
10 / 10 /
11 11
12</manifest> 12</manifest>

View File

@@ -1 +0,0 @@
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.0","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"../../library_manifest/debug/AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]

View File

@@ -0,0 +1 @@
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.1","enabled":true,"outputFile":"mogo-tanlu-api-release.aar","fullName":"release","baseName":"release"},"path":"..\\..\\library_manifest\\release\\AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]

View File

@@ -618,6 +618,7 @@ dimen compat_button_padding_vertical_material
dimen compat_control_corner_material dimen compat_control_corner_material
dimen compat_notification_large_icon_max_height dimen compat_notification_large_icon_max_height
dimen compat_notification_large_icon_max_width dimen compat_notification_large_icon_max_width
dimen corner_radius_cancel
dimen disabled_alpha_material_dark dimen disabled_alpha_material_dark
dimen disabled_alpha_material_light dimen disabled_alpha_material_light
dimen dp_0 dimen dp_0

View File

@@ -1,37 +0,0 @@
-- Merging decision tree log ---
manifest
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
package
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:2:5-40
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
android:versionName
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
android:versionCode
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
xmlns:android
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:11-69
uses-sdk
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml reason: use-sdk injection requested
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
android:targetSdkVersion
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
android:minSdkVersion
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml

View File

@@ -0,0 +1,37 @@
-- Merging decision tree log ---
manifest
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
package
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:2:5-40
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
android:versionName
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
android:versionCode
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
xmlns:android
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:11-69
uses-sdk
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml reason: use-sdk injection requested
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
android:targetSdkVersion
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
android:minSdkVersion
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml

View File

@@ -7,9 +7,9 @@ class HttpConstants {
companion object { companion object {
const val DEV_BASE_URL_OWNER = "http://dzt-test.zhidaohulian.com/" 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.zhidaohulian.com/"
const val SHOW_BASE_URL_OWNER = "http://dzt-show.zhidaohulian.com/" const val SHOW_BASE_URL_OWNER = "http://dzt-show.zhidaozhixing.com/"
fun getBaseUrl(): String { fun getBaseUrl(): String {
return when (DebugConfig.getNetMode()) { return when (DebugConfig.getNetMode()) {

View File

@@ -22,5 +22,6 @@ data class InformationBody(
val direction: Float, val direction: Float,
val poiType: String, //类型分类 val poiType: String, //类型分类
val mainInfoId: Long, //事件id val mainInfoId: Long, //事件id
val speed: Float //车速 val speed: Float, //车速
val fromType: String //上报触发来源
) )

View File

@@ -105,7 +105,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
latitude: Double, latitude: Double,
speed: Float speed: Float
) { ) {
Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType ---type = $type ---speed = $speed" ) Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType ---type = $type ---speed = $speed")
this.mType = type this.mType = type
this.mainInfoId = mainInfoId this.mainInfoId = mainInfoId
this.mFromType = fromType this.mFromType = fromType
@@ -114,7 +114,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
this.mSpeed = speed this.mSpeed = speed
if (DebugConfig.getCarMachineType() == 0) { //自研车机 if (DebugConfig.getCarMachineType() == 0) { //自研车机
outputVideoPath = getCompressVideoPath() outputVideoPath = getCompressVideoPath()
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id,fromType)) CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id, fromType))
zdCarCoderController.takeVideo(cameraId, duration) zdCarCoderController.takeVideo(cameraId, duration)
trackGetVideo(1) trackGetVideo(1)
} else { //比亚迪 } else { //比亚迪
@@ -123,7 +123,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
// TipToast.shortTip("分享失败,请检查网络") // TipToast.shortTip("分享失败,请检查网络")
// } else { // } else {
//失败了,传空地址,发起请求 //失败了,传空地址,发起请求
val entity = TakeEntity(isCustom, id,fromType) val entity = TakeEntity(isCustom, id, fromType)
videoAndThumbMap["video"] = "" videoAndThumbMap["video"] = ""
videoAndThumbMap["thumb"] = "" videoAndThumbMap["thumb"] = ""
@@ -165,42 +165,20 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
val isCustom = CustomStatusHandler.pollPhotoStatus() val isCustom = CustomStatusHandler.pollPhotoStatus()
val entity = TakeEntity(isCustom, 0L) val entity = TakeEntity(isCustom, 0L)
Log.e(TAG, "onTakePhotoFail -----mType = $mType --- isCustom = $isCustom") Log.e(TAG, "onTakePhotoFail -----mType = $mType --- isCustom = $isCustom")
//语音播报 1上报路况2交通检查3封路 默认 mType 应该为null //获取图片失败也上报,图片不打点
// if (mType.equals(TANLU_ROAD_CONGESTION) || mType.equals(TANLU_TRAFFIC_CHECK) || mType.equals( if (isCustom) {
// TANLU_ROAD_CLOSURE CosStatusController().sendInformationDirectly(
// ) INFO_TYPE_IMG,
// || mType.equals(TANLU_ROAD_CURRENT) || mType.equals(TANLU_ROAD_PONDING) || mType.equals( mutableMapOf("pic" to ""),
// TANLU_ROAD_ICING mType,
// ) entity,
// || mType.equals(TANLU_ROAD_HEAVY_FOG) || mType.equals(TANLU_ROAD_ACCIDENT) || mType.equals( mainInfoId,
// TANLU_ROAD_WORK mLongitude,
// ) mLatitude,
// ) { mSpeed
// taskAsync(1_500) { )
// try { }
// VoiceController.speakVoice("上报失败")
// if (isCustom) {
// sendGetInfoFailedReceiver(mType)
// }
// } catch (e: java.lang.Exception) {
// e.printStackTrace()
// }
// }
//获取图片失败也上报,图片不打点
if (isCustom) {
CosStatusController().sendInformationDirectly(
INFO_TYPE_IMG,
mutableMapOf("pic" to ""),
mType,
entity,
mainInfoId,
mLongitude,
mLatitude,
mSpeed
)
}
// }
} }
//拍照成功回调返回图片本地路径 //拍照成功回调返回图片本地路径
@@ -314,7 +292,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
entity?.let { entity?.let {
if (it.isCustom) { if (it.isCustom) {
compressVideo(videoPath, thumbnailPath, it) compressVideo(videoPath, thumbnailPath, it)
}else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) { } else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) {
// 属于策略上报 // 属于策略上报
compressVideo(videoPath, thumbnailPath, it) compressVideo(videoPath, thumbnailPath, it)
} else { } else {
@@ -433,6 +411,22 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
override fun onTakeVideoCancel(camera: Int) { override fun onTakeVideoCancel(camera: Int) {
Log.d(TAG, "onTakeVideoCancel -----camera = $camera") Log.d(TAG, "onTakeVideoCancel -----camera = $camera")
val entity = CustomStatusHandler.pollVideoStatus()
//失败了,传空地址,发起请求
videoAndThumbMap["video"] = ""
videoAndThumbMap["thumb"] = ""
CosStatusController().sendInformationDirectly(
INFO_TYPE_VIDEO,
videoAndThumbMap,
mType,
entity,
mainInfoId,
mLongitude,
mLatitude,
mSpeed
)
} }
//获取图片 //获取图片

View File

@@ -85,23 +85,6 @@ class CosStatusController : CosStatusCallback {
Log.d(TAG, "uploadCosFailed = $localPath") Log.d(TAG, "uploadCosFailed = $localPath")
trackUploadCos(2) trackUploadCos(2)
//语音播报 1上报路况2交通检查3封路 默认 mType 应该为null //语音播报 1上报路况2交通检查3封路 默认 mType 应该为null
if (CarCorderController.mType.equals(TANLU_ROAD_CONGESTION) || CarCorderController.mType.equals(
TANLU_TRAFFIC_CHECK
) || CarCorderController.mType.equals(TANLU_ROAD_CLOSURE)
|| CarCorderController.mType.equals(TANLU_ROAD_CURRENT) || CarCorderController.mType.equals(
TANLU_ROAD_PONDING
) || CarCorderController.mType.equals(TANLU_ROAD_ICING)
|| CarCorderController.mType.equals(TANLU_ROAD_HEAVY_FOG) || CarCorderController.mType.equals(
TANLU_ROAD_ACCIDENT
) || CarCorderController.mType.equals(TANLU_ROAD_WORK)
) {
// VoiceController.speakVoice("cos上报失败")
Log.d(TAG, "uploadCosFailed mType = $mType")
// if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
// sendGetInfoFailedReceiver("100")
// }
}
if (!isRetry) { if (!isRetry) {
isRetry = true isRetry = true
// taskAsync(30_000) { //去掉重试 // taskAsync(30_000) { //去掉重试
@@ -153,7 +136,7 @@ class CosStatusController : CosStatusCallback {
trackUploadCos(5) trackUploadCos(5)
} }
} else { } else {
//上传图片成功, 如果是上报路况,直接上传TODO //上传图片成功, 如果是上报路况,直接上传
Log.d(TAG, "uploadCosCompleted 分享成功 ---- mType = $mType") Log.d(TAG, "uploadCosCompleted 分享成功 ---- mType = $mType")
sendInformationDirectly( sendInformationDirectly(
INFO_TYPE_IMG, INFO_TYPE_IMG,
@@ -195,7 +178,7 @@ class CosStatusController : CosStatusCallback {
latitude: Double, latitude: Double,
speed: Float speed: Float
) { ) {
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId") Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId --- isCustom = ${entity?.isCustom}")
//开始上传 //开始上传
entity?.isCustom?.let { entity?.isCustom?.let {
mainServiceHttpModel.sendInformationMessage( mainServiceHttpModel.sendInformationMessage(
@@ -213,7 +196,7 @@ class CosStatusController : CosStatusCallback {
// CosCallbackMapController.mainService?.let { // CosCallbackMapController.mainService?.let {
// CosCallbackMapController.mainService?.sendCustomResult(success) // CosCallbackMapController.mainService?.sendCustomResult(success)
// } // }
Log.d(TAG, "type = $type ----success = $success") Log.d(TAG, "type = $type ----success = $success ----fromType = $mFromType ----poiType = $poiType")
if (success) { if (success) {
//分享成功并打点如果是上报拥堵需要takeVideo //分享成功并打点如果是上报拥堵需要takeVideo
if (type == INFO_TYPE_VIDEO) { if (type == INFO_TYPE_VIDEO) {

View File

@@ -128,8 +128,8 @@ class MainServiceController {
//上传情报数据 //上传情报数据
fun sendInformationMessage( fun sendInformationMessage(
type: Int,
fromType: String, fromType: String,
type: Int,
url: Map<String, String>, url: Map<String, String>,
isCustom: Boolean = false, isCustom: Boolean = false,
trafficInfoType:String = "", trafficInfoType:String = "",
@@ -145,7 +145,6 @@ class MainServiceController {
mFromType = fromType mFromType = fromType
mPoiType = poiType mPoiType = poiType
//删除测试数据
var locationInfo = LocationUtil.getInstance().getLocationInfo() var locationInfo = LocationUtil.getInstance().getLocationInfo()
if (locationInfo.address.isNullOrEmpty()) { if (locationInfo.address.isNullOrEmpty()) {
Log.d(TAG, " sendInformationMessage locationInfo.address = $locationInfo.address") Log.d(TAG, " sendInformationMessage locationInfo.address = $locationInfo.address")
@@ -153,7 +152,7 @@ class MainServiceController {
geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType,mainInfoId,speed, longitude,latitude) geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType,mainInfoId,speed, longitude,latitude)
} else { } else {
postInformationMessage( postInformationMessage(
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType,mainInfoId,longitude,latitude, speed), getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType,mainInfoId,longitude,latitude, speed, mFromType),
customSend customSend
) )
} }
@@ -179,7 +178,7 @@ class MainServiceController {
.geoCodeLocation(locationInfo.toLatLngPoint(), { .geoCodeLocation(locationInfo.toLatLngPoint(), {
Log.d(TAG, "geoLocation -------start -->") Log.d(TAG, "geoLocation -------start -->")
postInformationMessage( postInformationMessage(
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude, speed), getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude, speed, mFromType),
customSend customSend
) )
}, { }, {
@@ -192,10 +191,9 @@ class MainServiceController {
//如果两次都失败,直接上报服务端 //如果两次都失败,直接上报服务端
Log.d(TAG, "geoLocation ---- postInformationMessage ---false-->") Log.d(TAG, "geoLocation ---- postInformationMessage ---false-->")
postInformationMessage( postInformationMessage(
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude,speed), getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude,speed, mFromType),
customSend customSend
) )
false false
} }
}) })
@@ -214,31 +212,26 @@ class MainServiceController {
onSuccess { onSuccess {
if (it.result != null) { if (it.result != null) {
Log.i(TAG, "upload success id = " + it.result.id) Log.i(TAG, "upload success id = " + it.result.id)
Log.i(TAG, "upload success mFromType = $mFromType")
if (mFromType == "6") { if (mFromType == "6") {
sendUgcStatusReceiver(it.result.id, mPoiType, mFromType) sendUgcStatusReceiver(it.result.id, mPoiType, mFromType)
} }
} }
trackUploadServer(1) trackUploadServer(1)
// CosStatusController().videoAndThumbMap.clear()
customSend?.invoke(true) customSend?.invoke(true)
} }
onError { onError {
Log.i(TAG, "$it upload message ${it.message}") Log.i(TAG, "$it upload message ${it.message}")
trackUploadServer(2) trackUploadServer(2)
Log.i(TAG, "upload onError mFromType = $mFromType")
if (mFromType == "6") { if (mFromType == "6") {
sendUgcStatusReceiver(0, mPoiType, mFromType) sendUgcStatusReceiver(0, mPoiType, mFromType)
} }
// CosStatusController().videoAndThumbMap.clear()
customSend?.invoke(false) customSend?.invoke(false)
} }
} }
} }
private fun sendUgcStatusReceiver(id: Long, type: String?, fromType: String?) { private fun sendUgcStatusReceiver(id: Long, type: String?, fromType: String?) {
Log.d(TAG, "sendUgcStatusReceiver ----> id = $id ---type = $type --fromType = $fromType ") Log.d(TAG, "sendUgcStatusReceiver id = $id ---type = $type --fromType = $fromType ")
var intent = Intent() var intent = Intent()
intent.action = "com.v2x.ugc.upload.status" intent.action = "com.v2x.ugc.upload.status"
intent.putExtra("id", id) intent.putExtra("id", id)

View File

@@ -1,5 +1,6 @@
package com.zhidao.roadcondition.util package com.zhidao.roadcondition.util
import android.util.Log
import com.google.gson.JsonArray import com.google.gson.JsonArray
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.mogo.commons.AbsMogoApplication import com.mogo.commons.AbsMogoApplication
@@ -33,7 +34,8 @@ fun getInformationBody(
mainInfoId: Long, mainInfoId: Long,
longitude: Double, longitude: Double,
latitude: Double, latitude: Double,
speed: Float speed: Float,
fromType: String
): InformationBody { ): InformationBody {
var jsonArray = JsonArray() var jsonArray = JsonArray()
var type: Int var type: Int
@@ -50,6 +52,7 @@ fun getInformationBody(
INFO_TYPE_IMG INFO_TYPE_IMG
} }
var infoType = if (isCustom) 1 else 0 var infoType = if (isCustom) 1 else 0
Log.d("MainServiceController", "isCustom = $isCustom ---- infoType = $infoType")
return InformationBody( return InformationBody(
jsonArray.toString(), jsonArray.toString(),
locationInfo.address, locationInfo.address,
@@ -72,7 +75,8 @@ fun getInformationBody(
locationInfo.direction, locationInfo.direction,
poiType, poiType,
mainInfoId, mainInfoId,
speed speed,
fromType
) )
} }

View File

@@ -5,10 +5,10 @@ import com.mogo.commons.debug.DebugConfig
class HttpConstant { class HttpConstant {
companion object { companion object {
const val HOST_DEV = "http://dzt-test.zhidaohulian.com" const val HOST_DEV = "http://dzt-test.zhidaozhixing.com"
const val HOST_TEST = "http://dzt-test.zhidaohulian.com" const val HOST_TEST = "http://dzt-test.zhidaozhixing.com"
const val HOST_DEMO = "http://dzt-show.zhidaohulian.com" const val HOST_DEMO = "http://dzt-show.zhidaozhixing.com"
const val HOST_PRODUCT = "https://dzt.zhidaohulian.com" const val HOST_PRODUCT = "http://dzt.zhidaozhixing.com"
fun getNetHost(): String { fun getNetHost(): String {
return when (DebugConfig.getNetMode()) { return when (DebugConfig.getNetMode()) {

View File

@@ -0,0 +1,58 @@
package com.mogo.module.common.entity;
/**
* 自车模型实体用于从服务端获取不同等级的自车模型信息以及将此信息传递给adas
*
* @author tongchenfei
*/
public class OwnCarModelEntity {
/**
* 图片锁定 1-是 0-否
*/
private int isLock;
private String imageUrl;
private String imageName;
private int imageLevel;
public int getIsLock() {
return isLock;
}
public void setIsLock(int isLock) {
this.isLock = isLock;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getImageName() {
return imageName;
}
public void setImageName(String imageName) {
this.imageName = imageName;
}
public int getImageLevel() {
return imageLevel;
}
public void setImageLevel(int imageLevel) {
this.imageLevel = imageLevel;
}
@Override
public String toString() {
return "OwnCarModelEntity{" +
"isLock=" + isLock +
", imageUrl='" + imageUrl + '\'' +
", imageName='" + imageName + '\'' +
", imageLevel=" + imageLevel +
'}';
}
}

View File

@@ -14,8 +14,16 @@ import java.lang.reflect.Method;
*/ */
public class CarSeries { public class CarSeries {
public static boolean isF8xxSeries(){ private static boolean invokeFlag = false;
return DebugConfig.getProductFlavor().startsWith( "f8" ); private static boolean isF8xxSeries = false;
public static boolean isF8xxSeries() {
if ( invokeFlag ) {
return isF8xxSeries;
}
isF8xxSeries = DebugConfig.getProductFlavor().startsWith( "f8" );
invokeFlag = true;
return isF8xxSeries;
} }
@Deprecated @Deprecated
@@ -46,6 +54,12 @@ public class CarSeries {
@Deprecated @Deprecated
public static int CAR_SERIES = 0; public static int CAR_SERIES = 0;
/**
* Deprecated.
* Use {@link DebugConfig#getProductFlavor()} instead.
*
* @return
*/
@Deprecated @Deprecated
public static int getSeries() { public static int getSeries() {
if ( CAR_SERIES != 0 ) { if ( CAR_SERIES != 0 ) {

View File

@@ -1060,6 +1060,6 @@
<dimen name="v2x_share_btn_width">281px</dimen> <dimen name="v2x_share_btn_width">281px</dimen>
<dimen name="v2x_share_btn_height">90px</dimen> <dimen name="v2x_share_btn_height">90px</dimen>
<dimen name="share_item_address">32px</dimen> <dimen name="share_item_address">32px</dimen>
<dimen name="panel_list_item_title_size">28px</dimen> <dimen name="panel_list_item_title_size">26px</dimen>
</resources> </resources>

View File

@@ -832,70 +832,84 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private void debugTopView() { private void debugTopView() {
findViewById(R.id.btnDebugCtrlNaviView).setOnClickListener(view -> { findViewById(R.id.btnDebugCtrlNaviView).setOnClickListener(view -> {
if (!toggle) { SharedPrefsMgr.getInstance(getContext()).putString("MY_LOCATION_CONFIG", "https" +
TopViewAnimHelper.getInstance().showNaviView(); "://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
} else { "&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
TopViewAnimHelper.getInstance().hideNaviView(); ".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
} MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().setCarCursorOption(null);
toggle = !toggle; // if (!toggle) {
// TopViewAnimHelper.getInstance().showNaviView();
// } else {
// TopViewAnimHelper.getInstance().hideNaviView();
// }
// toggle = !toggle;
}); });
findViewById(R.id.btnDebugCtrlSubView).setOnClickListener(view -> { findViewById(R.id.btnDebugCtrlSubView).setOnClickListener(view -> {
View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null); MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();
TextView tv = v.findViewById(R.id.tvIndex); // View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
tv.setText("sub view height: " + currentHeight + ": " + v); // TextView tv = v.findViewById(R.id.tvIndex);
mApis.getTopViewManager().addSubView(v, new IMogoTopViewStatusListener() { // tv.setText("sub view height: " + currentHeight + ": " + v);
@Override // mApis.getTopViewManager().addSubView(v, new IMogoTopViewStatusListener() {
public void onViewAdded(View view) { // @Override
Logger.d(TAG, "onSubViewAdded: " + view); // public void onViewAdded(View view) {
} // Logger.d(TAG, "onSubViewAdded: " + view);
// }
@Override //
public void onViewRemoved(View view) { // @Override
Logger.d(TAG, "onSubViewRemoved: " + view); // public void onViewRemoved(View view) {
} // Logger.d(TAG, "onSubViewRemoved: " + view);
// }
@Override //
public void beforeViewAddAnim(View view) { // @Override
Logger.d(TAG, "beforeSubViewAddAnim: " + view); // public void beforeViewAddAnim(View view) {
} // Logger.d(TAG, "beforeSubViewAddAnim: " + view);
// }
@Override //
public void beforeViewRemoveAnim(View view) { // @Override
Logger.d(TAG, "beforeSubViewRemoveAnim: " + view); // public void beforeViewRemoveAnim(View view) {
} // Logger.d(TAG, "beforeSubViewRemoveAnim: " + view);
}); // }
// });
}); });
findViewById(R.id.btnDebugCtrlTopView).setOnClickListener(view -> { findViewById(R.id.btnDebugCtrlTopView).setOnClickListener(view -> {
View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null); SharedPrefsMgr.getInstance(getContext()).putString("MY_LOCATION_CONFIG", "https" +
TextView tv = v.findViewById(R.id.tvIndex); "://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705508574" +
Random random = new Random(); "&di=339d3259ad21f5f48c8abcd1bafff324&imgtype=0&src=http%3A%2F%2Fc-ssl" +
currentHeight = heights[random.nextInt(3)]; ".duitang.com%2Fuploads%2Fitem%2F202004%2F23%2F20200423111550_4AJLr.thumb" +
tv.setText(" height: " + currentHeight + ": " + v); ".1000_0.jpeg");
ViewGroup.LayoutParams params = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, currentHeight); // View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
mApis.getTopViewManager().addView(v, params, new IMogoTopViewStatusListener() { // TextView tv = v.findViewById(R.id.tvIndex);
@Override // Random random = new Random();
public void onViewAdded(View view) { // currentHeight = heights[random.nextInt(3)];
Logger.d(TAG, "onViewAdded: " + view); // tv.setText(" height: " + currentHeight + ": " + v);
} // ViewGroup.LayoutParams params =
// new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, currentHeight);
// mApis.getEntranceButtonController().addLeftFeatureView(v);
@Override // mApis.getTopViewManager().addView(v, params, new IMogoTopViewStatusListener() {
public void onViewRemoved(View view) { // @Override
Logger.d(TAG, "onViewRemoved: " + view); // public void onViewAdded(View view) {
} // Logger.d(TAG, "onViewAdded: " + view);
// }
@Override //
public void beforeViewAddAnim(View view) { // @Override
Logger.d(TAG, "beforeViewAddAnim: " + view); // public void onViewRemoved(View view) {
} // Logger.d(TAG, "onViewRemoved: " + view);
// }
@Override //
public void beforeViewRemoveAnim(View view) { // @Override
Logger.d(TAG, "beforeViewRemoveAnim: " + view); // public void beforeViewAddAnim(View view) {
} // Logger.d(TAG, "beforeViewAddAnim: " + view);
}); // }
//
// @Override
// public void beforeViewRemoveAnim(View view) {
// Logger.d(TAG, "beforeViewRemoveAnim: " + view);
// }
// });
}); });
findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v -> { findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v -> {

View File

@@ -9,13 +9,16 @@ import androidx.lifecycle.LifecycleOwner;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.Presenter; import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils; import com.mogo.commons.network.Utils;
import com.mogo.module.common.MogoApisHandler; import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.extensions.R; import com.mogo.module.extensions.R;
import com.mogo.module.extensions.bean.CommonConfig; import com.mogo.module.extensions.bean.CommonConfig;
import com.mogo.module.extensions.bean.CommonConfigResponse; import com.mogo.module.extensions.bean.CommonConfigResponse;
import com.mogo.module.extensions.net.DztHttpConstant;
import com.mogo.module.extensions.net.GetConfigApiServices; import com.mogo.module.extensions.net.GetConfigApiServices;
import com.mogo.module.extensions.net.UserInfoNetApiServices; import com.mogo.module.extensions.net.UserInfoNetApiServices;
import com.mogo.module.extensions.userinfo.CarModelListResponse;
import com.mogo.module.extensions.userinfo.UserInfo; import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.module.extensions.userinfo.UserInfoConstant; import com.mogo.module.extensions.userinfo.UserInfoConstant;
import com.mogo.module.extensions.userinfo.UserInfoResponse; import com.mogo.module.extensions.userinfo.UserInfoResponse;
@@ -23,14 +26,19 @@ import com.mogo.module.extensions.weather.Phenomena;
import com.mogo.module.extensions.weather.WeatherCallback; import com.mogo.module.extensions.weather.WeatherCallback;
import com.mogo.module.extensions.weather.WeatherInfo; import com.mogo.module.extensions.weather.WeatherInfo;
import com.mogo.module.extensions.weather.WeatherModel; import com.mogo.module.extensions.weather.WeatherModel;
import com.mogo.module.share.constant.HttpConstant;
import com.mogo.service.MogoServicePaths; import com.mogo.service.MogoServicePaths;
import com.mogo.service.network.IMogoNetwork; import com.mogo.service.network.IMogoNetwork;
import com.mogo.service.statusmanager.IMogoMsgCenter; import com.mogo.service.statusmanager.IMogoMsgCenter;
import com.mogo.service.statusmanager.IMogoMsgCenterListener; import com.mogo.service.statusmanager.IMogoMsgCenterListener;
import com.mogo.utils.DeviceIdUtils;
import com.mogo.utils.digest.DigestUtils; import com.mogo.utils.digest.DigestUtils;
import com.mogo.utils.logger.Logger; import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.storage.SharedPrefsMgr; import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import io.reactivex.SingleObserver; import io.reactivex.SingleObserver;
@@ -56,73 +64,80 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
private IMogoNetwork mNetWork; private IMogoNetwork mNetWork;
private Context context;
private boolean isResumed = false; private boolean isResumed = false;
public EntrancePresenter(Context context, EntranceView view) { public EntrancePresenter(Context context, EntranceView view) {
super(view); super(view);
mWeatherModel = new WeatherModel( getContext() ); this.context = context;
mWeatherModel = new WeatherModel(getContext());
mNetWork = MogoApisHandler.getInstance().getApis().getNetworkApi(); mNetWork = MogoApisHandler.getInstance().getApis().getNetworkApi();
} }
@Override @Override
public void onCreate(@NonNull LifecycleOwner owner) { public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner); super.onCreate(owner);
mWeatherModel.init( this ); mWeatherModel.init(this);
mWeatherModel.queryWeatherInformation(); mWeatherModel.queryWeatherInformation();
mMsgCenter = ( IMogoMsgCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_MSG_CENTER ).navigation(); mMsgCenter =
mMsgCenter.registerMsgCenterListener( this ); (IMogoMsgCenter) ARouter.getInstance().build(MogoServicePaths.PATH_MSG_CENTER).navigation();
mMsgCenter.registerMsgCenterListener(this);
} }
@Override @Override
public void onWeatherLoaded( WeatherInfo weatherInfo ) { public void onWeatherLoaded(WeatherInfo weatherInfo) {
if ( weatherInfo == null ) { if (weatherInfo == null) {
return; return;
} }
Phenomena phenomena = Phenomena.getById( weatherInfo.getPhenomena() ); Phenomena phenomena = Phenomena.getById(weatherInfo.getPhenomena());
if ( phenomena == null ) { if (phenomena == null) {
return; return;
} }
String temp = getContext().getResources().getString( R.string.module_ext_str_weather_temp_format, weatherInfo.getTemperature() ); String temp =
getContext().getResources().getString(R.string.module_ext_str_weather_temp_format
, weatherInfo.getTemperature());
String desc = phenomena.nameCn; String desc = phenomena.nameCn;
int resId = phenomena.resId; int resId = phenomena.resId;
mView.renderWeatherInfo( temp, desc, resId ); mView.renderWeatherInfo(temp, desc, resId);
} }
@Override @Override
public void onMsgChanged( boolean hasMsg, int amount ) { public void onMsgChanged(boolean hasMsg, int amount) {
if ( mView != null ) { if (mView != null) {
mView.renderMsgInfo( hasMsg, amount ); mView.renderMsgInfo(hasMsg, amount);
} }
} }
@Override @Override
public void onResume( @NonNull LifecycleOwner owner ) { public void onResume(@NonNull LifecycleOwner owner) {
super.onResume( owner ); super.onResume(owner);
isResumed = true; isResumed = true;
if (userInfo != null) { if (userInfo != null) {
mView.renderUserInfo(userInfo); mView.renderUserInfo(userInfo);
} }
if( DebugConfig.isNeedRequestUserInfo()){ if (DebugConfig.isNeedRequestUserInfo()) {
// 相当于每次onResume都会请求一下个人信息目的是能够相对及时的同步手机端的个人信息修改 // 相当于每次onResume都会请求一下个人信息目的是能够相对及时的同步手机端的个人信息修改
requestUserInfo(); requestUserInfo();
} }
requestCarModelList();
getCommonConfig(); getCommonConfig();
} }
@Override @Override
public void onPause( @NonNull LifecycleOwner owner ) { public void onPause(@NonNull LifecycleOwner owner) {
super.onPause( owner ); super.onPause(owner);
isResumed = false; isResumed = false;
} }
@Override @Override
public void onDestroy( @NonNull LifecycleOwner owner ) { public void onDestroy(@NonNull LifecycleOwner owner) {
super.onDestroy( owner ); super.onDestroy(owner);
if ( mWeatherModel != null ) { if (mWeatherModel != null) {
mWeatherModel.destroy(); mWeatherModel.destroy();
} }
if ( mMsgCenter != null ) { if (mMsgCenter != null) {
mMsgCenter.unregisterMsgCenterListener( this ); mMsgCenter.unregisterMsgCenterListener(this);
} }
} }
@@ -134,44 +149,48 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new SingleObserver<CommonConfigResponse>() { .subscribe(new SingleObserver<CommonConfigResponse>() {
@Override @Override
public void onSubscribe(Disposable d) { public void onSubscribe(Disposable d) {
}
@Override
public void onSuccess(CommonConfigResponse config) {
Logger.d(TAG, "getCommonConfig onSuccess -----> ");
if (config != null && config.result != null) {
CommonConfig.Speech speech = config.result.speech;
CommonConfig.ReportStrategy strategy = config.result.reportStrategy;
if (speech != null) {
Logger.d(TAG, "getCommonConfig onSuccess speech.count = " + speech.count);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SERVER_SHOW_DAY_COUNT, speech.count);
} else {
Logger.e(TAG, "getCommonConfig onSuccess speech == null ");
} }
if (strategy != null) { @Override
Logger.d(TAG, "getCommonConfig onSuccess strategy.open = " + strategy.open); public void onSuccess(CommonConfigResponse config) {
SharedPrefsMgr.getInstance(getContext()).putBoolean("KEY_SERVER_REPORTSTRATEGY_SWITCH", strategy.open); Logger.d(TAG, "getCommonConfig onSuccess -----> ");
} else { if (config != null && config.result != null) {
Logger.e(TAG, "getCommonConfig onSuccess strategy == null "); CommonConfig.Speech speech = config.result.speech;
} CommonConfig.ReportStrategy strategy = config.result.reportStrategy;
} else { if (speech != null) {
Logger.e(TAG, "getCommonConfig onSuccess config == null"); Logger.d(TAG,
} "getCommonConfig onSuccess speech.count = " + speech.count);
} SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SERVER_SHOW_DAY_COUNT, speech.count);
} else {
Logger.e(TAG, "getCommonConfig onSuccess speech == null ");
}
@Override if (strategy != null) {
public void onError(Throwable e) { Logger.d(TAG,
e.printStackTrace(); "getCommonConfig onSuccess strategy.open = " + strategy.open);
Logger.e(TAG,"getCommonConfig onError ---> e = " + e); SharedPrefsMgr.getInstance(getContext()).putBoolean(
} "KEY_SERVER_REPORTSTRATEGY_SWITCH", strategy.open);
}); } else {
Logger.e(TAG, "getCommonConfig onSuccess strategy == null ");
}
} else {
Logger.e(TAG, "getCommonConfig onSuccess config == null");
}
}
@Override
public void onError(Throwable e) {
e.printStackTrace();
Logger.e(TAG, "getCommonConfig onError ---> e = " + e);
}
});
} }
private UserInfo userInfo; private UserInfo userInfo;
public void requestUserInfo() { public void requestUserInfo() {
Map<String, String> params = new ArrayMap<>(); Map<String, String> params = new ArrayMap<>();
params.put("sn", Utils.getSn()); params.put("sn", Utils.getSn());
@@ -186,7 +205,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
@Override @Override
public void onSuccess(UserInfoResponse userInfoBaseResponse) { public void onSuccess(UserInfoResponse userInfoBaseResponse) {
userInfo = userInfoBaseResponse.getResult(); userInfo = userInfoBaseResponse.getResult();
if(isResumed) { if (isResumed) {
if (userInfo != null) { if (userInfo != null) {
Logger.d(TAG, "获取个人信息成功: " + userInfo); Logger.d(TAG, "获取个人信息成功: " + userInfo);
mView.renderUserInfo(userInfo); mView.renderUserInfo(userInfo);
@@ -222,4 +241,36 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
} }
} }
private void requestCarModelList() {
Map<String, String> params = new HashMap<>(8);
params.put("sn", Utils.getSn());
mNetWork.create(UserInfoNetApiServices.class, DztHttpConstant.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);
// todo 保存到sp中
SharedPrefsMgr.getInstance(context).putString("CAR_MODEL_LIST",
GsonUtil.jsonFromObject(o.getResult()));
}
@Override
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);
}
});
}
} }

View File

@@ -43,4 +43,14 @@ public class MogoEntranceButtonControllerImpl implements IMogoEntranceButtonCont
public void init( Context context ) { public void init( Context context ) {
} }
@Override
public void addLeftFeatureView(View view) {
EntranceViewHolder.getInstance().addLeftFeatureView(view);
}
@Override
public void removeLeftFeatureView(View view) {
EntranceViewHolder.getInstance().removeLeftFeatureView(view);
}
} }

View File

@@ -34,27 +34,27 @@ public abstract class BaseNaviInfoView {
protected void fillNextCrossDistance( TextView target, TextView unit, int distance ) { protected void fillNextCrossDistance( TextView target, TextView unit, int distance ) {
if ( distance >= 1000 ) { if ( distance >= 1000 ) {
target.setText( String.format( "%.1f", distance / 1000f ) ); target.setText( String.format( "%.1f", distance / 1000f ) );
unit.setText( "km" ); unit.setText( "公里" );
} else { } else {
target.setText( distance + "" ); target.setText( distance + "" );
unit.setText( "m" ); unit.setText( "" );
} }
} }
protected void fillFormatSurplusDistance( int m, StringBuilder builder ) { protected void fillFormatSurplusDistance( int m, StringBuilder builder ) {
if ( m >= 1000 ) { if ( m >= 1000 ) {
builder.append( String.format( "%.1fkm", m / 1000f ) ); builder.append( String.format( "%.1f公里", m / 1000f ) );
} else { } else {
builder.append( m ).append( "m" ); builder.append( m ).append( "" );
} }
} }
protected String getFormatSurplusDistance( int m ) { protected String getFormatSurplusDistance( int m ) {
if ( m >= 1000 ) { if ( m >= 1000 ) {
mFormatSurplusDistanceUnit = "km"; mFormatSurplusDistanceUnit = "公里";
return String.format( "%.1f", m / 1000f ); return String.format( "%.1f", m / 1000f );
} else { } else {
mFormatSurplusDistanceUnit = "m"; mFormatSurplusDistanceUnit = "";
return String.format( "%d", m ); return String.format( "%d", m );
} }
} }

View File

@@ -0,0 +1,28 @@
package com.mogo.module.extensions.net;
import com.mogo.commons.debug.DebugConfig;
/**
* dzt base url
*
* @author tongchenfei
*/
public class DztHttpConstant {
public static final String HOST_DEV = "http://dzt-test.zhidaozhixing.com";
public static final String HOST_TEST = "http://dzt-test.zhidaozhixing.com";
public static final String HOST_DEMO = "http://dzt-show.zhidaozhixing.com";
public static final String HOST_PRODUCT = "http://dzt.zhidaozhixing.com";
public static String getBaseUrl(){
switch ( DebugConfig.getNetMode() ) {
case DebugConfig.NET_MODE_DEV:
return HOST_DEV;
case DebugConfig.NET_MODE_QA:
return HOST_TEST;
case DebugConfig.NET_MODE_DEMO:
return HOST_DEMO;
default:
return HOST_PRODUCT;
}
}
}

View File

@@ -1,9 +1,11 @@
package com.mogo.module.extensions.net; package com.mogo.module.extensions.net;
import com.mogo.module.extensions.userinfo.CarModelListResponse;
import com.mogo.module.extensions.userinfo.UserInfoResponse; import com.mogo.module.extensions.userinfo.UserInfoResponse;
import java.util.Map; import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Single; import io.reactivex.Single;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.QueryMap; import retrofit2.http.QueryMap;
@@ -21,4 +23,7 @@ public interface UserInfoNetApiServices {
*/ */
@GET("carlife/carMachine/getAccountInfo") @GET("carlife/carMachine/getAccountInfo")
Single<UserInfoResponse> requestUserInfo(@QueryMap Map<String, String> params); Single<UserInfoResponse> requestUserInfo(@QueryMap Map<String, String> params);
@GET("yycp-userDataService/app/enthusiasm/getEnthusiasmInfo/v1")
Observable<CarModelListResponse> requestCarModelList(@QueryMap Map<String, String> params);
} }

View File

@@ -0,0 +1,47 @@
package com.mogo.module.extensions.userinfo;
import com.mogo.module.common.entity.OwnCarModelEntity;
import java.util.List;
public class CarModelListInfo {
private String sn;
/**
* 热心指数 eg: 1 1.5 2 2.5
*/
private float enthusiasmIndex;
private List<OwnCarModelEntity> imageData;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public float getEnthusiasmIndex() {
return enthusiasmIndex;
}
public void setEnthusiasmIndex(float enthusiasmIndex) {
this.enthusiasmIndex = enthusiasmIndex;
}
public List<OwnCarModelEntity> getImageData() {
return imageData;
}
public void setImageData(List<OwnCarModelEntity> imageData) {
this.imageData = imageData;
}
@Override
public String toString() {
return "CarModelListInfo{" +
"sn='" + sn + '\'' +
", enthusiasmIndex=" + enthusiasmIndex +
", imageData=" + imageData +
'}';
}
}

View File

@@ -0,0 +1,32 @@
package com.mogo.module.extensions.userinfo;
import com.mogo.commons.data.BaseData;
import com.mogo.module.common.entity.OwnCarModelEntity;
import java.util.List;
/**
* 请求根据热心指数获取自车图标列表的响应类
*
* @author tongchenfei
*/
public class CarModelListResponse extends BaseData {
private CarModelListInfo result;
public CarModelListInfo getResult() {
return result;
}
public void setResult(CarModelListInfo result) {
this.result = result;
}
@Override
public String toString() {
return "CarModelListResponse{" +
"result=" + result +
", code=" + code +
", msg='" + msg + '\'' +
'}';
}
}

View File

@@ -5,6 +5,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.mogo.module.extensions.R;
import com.mogo.module.extensions.bean.BottomLayerViewWrapper; import com.mogo.module.extensions.bean.BottomLayerViewWrapper;
import com.mogo.utils.logger.Logger; import com.mogo.utils.logger.Logger;
@@ -19,6 +20,7 @@ import java.util.List;
public class EntranceViewHolder { public class EntranceViewHolder {
private static final String TAG = "EntranceViewHolder"; private static final String TAG = "EntranceViewHolder";
private List<BottomLayerViewWrapper> preAddView = new ArrayList<>(); private List<BottomLayerViewWrapper> preAddView = new ArrayList<>();
private List<View> leftFeaturePreAddView = new ArrayList<>();
private EntranceViewHolder(){} private EntranceViewHolder(){}
private volatile static EntranceViewHolder instance = null; private volatile static EntranceViewHolder instance = null;
public static EntranceViewHolder getInstance(){ public static EntranceViewHolder getInstance(){
@@ -32,11 +34,13 @@ public class EntranceViewHolder {
return instance; return instance;
} }
private ViewGroup rootViewGroup = null; private ViewGroup rootViewGroup = null;
private ViewGroup featureViewGroup = null;
public void initRootViewGroup(View rootView) { public void initRootViewGroup(View rootView) {
Logger.i(TAG, "initRootViewGroup=="); Logger.i(TAG, "initRootViewGroup==");
if(rootView instanceof ViewGroup) { if(rootView instanceof ViewGroup) {
Logger.d(TAG, "initRootViewGroup 赋值"); Logger.d(TAG, "initRootViewGroup 赋值");
rootViewGroup = (ViewGroup) rootView.getParent(); rootViewGroup = (ViewGroup) rootView.getParent();
featureViewGroup = rootView.findViewById(R.id.module_entrance_id_buttons_container);
if (!preAddView.isEmpty()) { if (!preAddView.isEmpty()) {
Logger.d(TAG, "initRootViewGroup 增加底层view: " + preAddView.size()); Logger.d(TAG, "initRootViewGroup 增加底层view: " + preAddView.size());
Iterator<BottomLayerViewWrapper> iterator = preAddView.iterator(); Iterator<BottomLayerViewWrapper> iterator = preAddView.iterator();
@@ -46,6 +50,12 @@ public class EntranceViewHolder {
iterator.remove(); iterator.remove();
} }
} }
if (!leftFeaturePreAddView.isEmpty()) {
Logger.d(TAG, "initRootViewGroup 增加左下角FeatureView " + leftFeaturePreAddView.size());
for (View view : leftFeaturePreAddView) {
featureViewGroup.addView(view);
}
}
} }
} }
@@ -79,6 +89,16 @@ public class EntranceViewHolder {
return false; return false;
} }
private boolean containFeatureView(View view) {
int count = featureViewGroup.getChildCount();
for (int i = 0; i < count; i++) {
if(featureViewGroup.getChildAt(i).equals(view)){
return true;
}
}
return false;
}
/** /**
* 使用的时候需要预先判断rootViewGroup是否为空本方法默认rootViewGroup不为空 * 使用的时候需要预先判断rootViewGroup是否为空本方法默认rootViewGroup不为空
*/ */
@@ -107,7 +127,36 @@ public class EntranceViewHolder {
} }
} }
public void release(){ public void addLeftFeatureView(View view) {
Logger.d(TAG, "addLeftFeatureView==" + view);
if (featureViewGroup == null) {
// 先缓存起来,等待时机加载
if(!leftFeaturePreAddView.contains(view)) {
leftFeaturePreAddView.add(view);
}
}else{
// 直接加载
if (!containFeatureView(view)) {
featureViewGroup.addView(view);
}
}
}
public void removeLeftFeatureView(View view) {
if (featureViewGroup != null) {
featureViewGroup.removeView(view);
}
Iterator<View> iterator = leftFeaturePreAddView.iterator();
while (iterator.hasNext()) {
View wrapper = iterator.next();
if (wrapper.equals(view)) {
iterator.remove();
}
}
}
public void release(){
rootViewGroup = null; rootViewGroup = null;
} }

View File

@@ -6,7 +6,10 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.logger.Logger; import com.mogo.utils.logger.Logger;
/** /**
* 没有地图场景下topView底层蒙版帮助类因为有两个地方涉及到蒙版的显示隐藏{@link TopViewAnimHelper}和{@link TopViewNoLinkageAnimHelper}
* 为了不冲突,采用显示计数的方式进行兼容
* *
* @author tongchenfei
*/ */
public class NoMapTopViewShaderHelper { public class NoMapTopViewShaderHelper {
private static final String TAG = "NoMapTopViewShaderHelper"; private static final String TAG = "NoMapTopViewShaderHelper";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -6,7 +6,7 @@
> >
<View <View
android:id="@+id/module_map_id_navi_bg" android:id="@+id/module_map_id_navi_bg"
android:layout_width="match_parent" style="@style/NaviViewStyle"
android:layout_height="@dimen/module_ext_navi_info_panel_height" android:layout_height="@dimen/module_ext_navi_info_panel_height"
android:background="@drawable/module_ext_dw_navi_info_panel_bkg" android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
android:focusable="true" android:focusable="true"
@@ -14,9 +14,7 @@
android:layout_marginLeft="@dimen/module_common_shadow_width_pos" android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
android:layout_marginRight="@dimen/module_common_shadow_width_pos" android:layout_marginRight="@dimen/module_common_shadow_width_pos"
android:layout_marginTop="@dimen/module_common_shadow_width_pos" android:layout_marginTop="@dimen/module_common_shadow_width_pos"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintLeft_toLeftOf="@id/module_entrance_id_top_container" app:layout_constraintLeft_toLeftOf="@id/module_entrance_id_top_container"
app:layout_constraintRight_toRightOf="@id/module_entrance_id_top_container"
app:layout_constraintTop_toTopOf="@id/module_entrance_id_top_motion_layout" /> app:layout_constraintTop_toTopOf="@id/module_entrance_id_top_motion_layout" />
<ImageView <ImageView

View File

@@ -28,7 +28,7 @@
<LinearLayout <LinearLayout
android:id="@+id/module_entrance_id_buttons_container" android:id="@+id/module_entrance_id_buttons_container"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/module_common_shadow_width_pos" android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
android:layout_marginBottom="@dimen/module_common_shadow_width_pos" android:layout_marginBottom="@dimen/module_common_shadow_width_pos"
@@ -40,7 +40,8 @@
android:id="@+id/module_entrance_id_button1" android:id="@+id/module_entrance_id_button1"
android:layout_width="@dimen/module_ext_operation_panel_width" android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="@dimen/module_ext_operation_panel_width" android:layout_height="@dimen/module_ext_operation_panel_width"
android:background="@drawable/v2x_cancel_help" android:layout_marginLeft="@dimen/module_entrance_id_button_marginLeft"
android:background="@drawable/module_ext_shadow_bkg"
android:gravity="center" android:gravity="center"
android:padding="0dp" android:padding="0dp"
android:text="前方\n实况" android:text="前方\n实况"
@@ -54,8 +55,9 @@
android:id="@+id/module_entrance_id_button2" android:id="@+id/module_entrance_id_button2"
android:layout_width="@dimen/module_ext_operation_panel_width" android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="@dimen/module_ext_operation_panel_width" android:layout_height="@dimen/module_ext_operation_panel_width"
android:layout_marginLeft="@dimen/module_entrance_id_button_marginLeft"
android:layout_marginTop="@dimen/module_entrance_id_button_marginTop" android:layout_marginTop="@dimen/module_entrance_id_button_marginTop"
android:background="@drawable/v2x_cancel_help" android:background="@drawable/module_ext_shadow_bkg"
android:gravity="center" android:gravity="center"
android:padding="0dp" android:padding="0dp"
android:text="取消\n求助" android:text="取消\n求助"
@@ -85,6 +87,7 @@
android:layout_height="@dimen/module_ext_operation_panel_share_height" android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:layout_marginLeft="@dimen/dp_8" android:layout_marginLeft="@dimen/dp_8"
android:layout_marginTop="@dimen/module_entrance_id_button_marginTop" android:layout_marginTop="@dimen/module_entrance_id_button_marginTop"
android:layout_marginBottom="@dimen/module_common_btn_bottom"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg"> android:background="@drawable/module_ext_dw_upload_road_condition_bkg">
<TextView <TextView
@@ -148,7 +151,6 @@
android:id="@+id/module_ext_id_destination_online_car" android:id="@+id/module_ext_id_destination_online_car"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/module_ext_button_height" android:layout_height="@dimen/module_ext_button_height"
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop" android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
android:background="@drawable/module_ext_dw_navi_info_panel_bkg" android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
android:drawableLeft="@drawable/module_ext_destination_online_car_dw" android:drawableLeft="@drawable/module_ext_destination_online_car_dw"
@@ -168,7 +170,7 @@
<!--关联别的控件的头部容器--> <!--关联别的控件的头部容器-->
<com.mogo.module.extensions.navi.TopView <com.mogo.module.extensions.navi.TopView
android:id="@+id/module_entrance_id_top_container" android:id="@+id/module_entrance_id_top_container"
android:layout_width="match_parent" style="@style/NaviViewStyle"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_common_shadow_width_pos">2px</dimen>
<dimen name="module_common_btn_bottom">0px</dimen>
<dimen name="module_entrance_id_button_marginLeft">-6px</dimen>
</resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NaviViewStyle">
<item name="android:layout_width">@dimen/module_ext_navi_width</item>
</style>
</resources>

View File

@@ -9,4 +9,7 @@
<dimen name="module_ext_destination_online_car_paddingLeft">14px</dimen> <dimen name="module_ext_destination_online_car_paddingLeft">14px</dimen>
<dimen name="module_ext_destination_online_car_paddingRight">14px</dimen> <dimen name="module_ext_destination_online_car_paddingRight">14px</dimen>
<dimen name="module_common_shadow_width_pos">8px</dimen> <dimen name="module_common_shadow_width_pos">8px</dimen>
<dimen name="module_ext_top_view_max_width">1920px</dimen>
<dimen name="module_ext_navi_width">-1</dimen>
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
</resources> </resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NaviViewStyle">
<item name="android:layout_width">match_parent</item>
</style>
</resources>

View File

@@ -154,4 +154,8 @@
<dimen name="module_ext_destination_online_car_drawablePadding">8px</dimen> <dimen name="module_ext_destination_online_car_drawablePadding">8px</dimen>
<dimen name="module_ext_destination_online_car_paddingLeft">21px</dimen> <dimen name="module_ext_destination_online_car_paddingLeft">21px</dimen>
<dimen name="module_ext_destination_online_car_paddingRight">31px</dimen> <dimen name="module_ext_destination_online_car_paddingRight">31px</dimen>
<dimen name="module_ext_top_view_max_width">1920px</dimen>
<dimen name="module_ext_navi_width">-1</dimen>
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
</resources> </resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NaviViewStyle">
<item name="android:layout_width">match_parent</item>
</style>
</resources>

View File

@@ -168,4 +168,10 @@
<dimen name="module_ext_seek_help_notice_text_size">34px</dimen> <dimen name="module_ext_seek_help_notice_text_size">34px</dimen>
<dimen name="module_ext_seek_help_notice_text_margin_start">20px</dimen> <dimen name="module_ext_seek_help_notice_text_margin_start">20px</dimen>
<dimen name="module_ext_seek_help_notice_number_text_size">40px</dimen> <dimen name="module_ext_seek_help_notice_number_text_size">40px</dimen>
<dimen name="module_ext_navi_width">-1</dimen>
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
<dimen name="module_ext_navi_small_corner">20px</dimen>
<dimen name="module_ext_navi_small_margin_bottom">16px</dimen>
<dimen name="module_ext_navi_small_margin_right">20px</dimen>
</resources> </resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NaviViewStyle">
<item name="android:layout_width">match_parent</item>
</style>
</resources>

View File

@@ -55,6 +55,7 @@
<dimen name="module_ext_navi_exit_textSize">16px</dimen> <dimen name="module_ext_navi_exit_textSize">16px</dimen>
<dimen name="v2x_cancel_help_text_size">14px</dimen> <dimen name="v2x_cancel_help_text_size">14px</dimen>
<dimen name="module_entrance_id_button_marginTop">8px</dimen> <dimen name="module_entrance_id_button_marginTop">8px</dimen>
c
<!-- module_ext_layout_extensions.xml--> <!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">82px</dimen> <dimen name="module_ext_height">82px</dimen>
@@ -111,7 +112,7 @@
<dimen name="module_ext_voice_msg_padding_bottom">9px</dimen> <dimen name="module_ext_voice_msg_padding_bottom">9px</dimen>
<dimen name="module_ext_voice_msg_padding_left">18px</dimen> <dimen name="module_ext_voice_msg_padding_left">18px</dimen>
<dimen name="module_ext_voice_msg_padding_right">18px</dimen> <dimen name="module_ext_voice_msg_padding_right">18px</dimen>
<dimen name="module_ext_voice_msg_icon_margin_left">-1px</dimen> <dimen name="module_ext_voice_msg_icon_margin_left">-1</dimen>
<dimen name="module_ext_weather_bkg_corner">30px</dimen> <dimen name="module_ext_weather_bkg_corner">30px</dimen>
<dimen name="module_ext_weather_container_paddingLeft">23px</dimen> <dimen name="module_ext_weather_container_paddingLeft">23px</dimen>
@@ -138,6 +139,7 @@
<dimen name="module_ext_north_goneMarginTop">142px</dimen> <dimen name="module_ext_north_goneMarginTop">142px</dimen>
<dimen name="module_ext_button_width">66px</dimen> <dimen name="module_ext_button_width">66px</dimen>
<dimen name="module_ext_button_height">66px</dimen> <dimen name="module_ext_button_height">66px</dimen>
<dimen name="module_ext_button_height_small">44px</dimen>
<dimen name="module_ext_camera_button_marginTop">10px</dimen> <dimen name="module_ext_camera_button_marginTop">10px</dimen>
<dimen name="module_ext_display_overview_textSize">12px</dimen> <dimen name="module_ext_display_overview_textSize">12px</dimen>
<dimen name="module_ext_display_overview_textSize_large">14px</dimen> <dimen name="module_ext_display_overview_textSize_large">14px</dimen>
@@ -177,4 +179,10 @@
<dimen name="module_ext_navi_small_corner">11px</dimen> <dimen name="module_ext_navi_small_corner">11px</dimen>
<dimen name="module_ext_navi_small_margin_bottom">11px</dimen> <dimen name="module_ext_navi_small_margin_bottom">11px</dimen>
<dimen name="module_ext_navi_small_margin_right">10px</dimen> <dimen name="module_ext_navi_small_margin_right">10px</dimen>
<dimen name="module_ext_navi_width">-1</dimen>
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
<dimen name="module_common_btn_bottom">0px</dimen>
<dimen name="module_entrance_id_button_marginLeft">0px</dimen>
</resources> </resources>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NaviViewStyle">
<item name="android:layout_width">match_parent</item>
</style>
</resources>

View File

@@ -432,7 +432,6 @@ public class EventDispatchCenter implements
@Override @Override
public void onLocationChanged( MogoLocation location ) { public void onLocationChanged( MogoLocation location ) {
final long start = System.currentTimeMillis();
Iterator< IMogoLocationListener > iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners(); Iterator< IMogoLocationListener > iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
if ( iterator == null ) { if ( iterator == null ) {
return; return;
@@ -447,7 +446,6 @@ public class EventDispatchCenter implements
} }
} }
} }
Logger.i( TAG, "onLocationChanged event cost " + ( System.currentTimeMillis() - start ) + "ms" );
} }
@Override @Override

View File

@@ -39,6 +39,8 @@ public class SchemeIntent implements IMogoStatusChangedListener {
public static final String TYPE_SHOW_ONLINE_CAR_PANEL = "showOnlineCarPanel"; public static final String TYPE_SHOW_ONLINE_CAR_PANEL = "showOnlineCarPanel";
public static final String TYPE_SHOW_SHARE_PANEL = "showSharePanel"; public static final String TYPE_SHOW_SHARE_PANEL = "showSharePanel";
public static final String TYPE_SHOW_HISTORY_PANEL = "showHistoryPanel";
public static final String TYPE_SHOW_SURROUNDING_PANEL = "showSurroundingPanel";
private IMogoServiceApis mApis; private IMogoServiceApis mApis;
private Context mContext; private Context mContext;
@@ -49,7 +51,7 @@ public class SchemeIntent implements IMogoStatusChangedListener {
public Intent mIntent; public Intent mIntent;
public long mDelay = 0L; public long mDelay = 0L;
public IntentWrapper( Intent intent, long delay ) { public IntentWrapper(Intent intent, long delay) {
this.mIntent = intent; this.mIntent = intent;
this.mDelay = delay; this.mDelay = delay;
} }
@@ -61,9 +63,9 @@ public class SchemeIntent implements IMogoStatusChangedListener {
} }
public static SchemeIntent getInstance() { public static SchemeIntent getInstance() {
if ( sInstance == null ) { if (sInstance == null) {
synchronized ( SchemeIntent.class ) { synchronized (SchemeIntent.class) {
if ( sInstance == null ) { if (sInstance == null) {
sInstance = new SchemeIntent(); sInstance = new SchemeIntent();
} }
} }
@@ -75,14 +77,14 @@ public class SchemeIntent implements IMogoStatusChangedListener {
sInstance = null; sInstance = null;
} }
public void init( Context context, IMogoServiceApis apis ) { public void init(Context context, IMogoServiceApis apis) {
mContext = context; mContext = context;
mApis = apis; mApis = apis;
mApis.getStatusManagerApi().registerStatusChangedListener( TAG, StatusDescriptor.MAIN_PAGE_RESUME, this ); mApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this);
} }
public void clear() { public void clear() {
mApis.getStatusManagerApi().unregisterStatusChangedListener( TAG, StatusDescriptor.MAIN_PAGE_RESUME, this ); mApis.getStatusManagerApi().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_RESUME, this);
mContext = null; mContext = null;
mApis = null; mApis = null;
@@ -90,38 +92,39 @@ public class SchemeIntent implements IMogoStatusChangedListener {
/** /**
* 处理scheme * 处理scheme
* @param intent 跳转的intent *
* @param intent 跳转的intent
* @param isOnNewIntent 根据这个参数判断是从onCreate过来还是从onNewIntent过来从而可以在{@link #isDelay(Intent, boolean)}里面确定延时逻辑如果是从onNewIntent过来是不需要延时的 * @param isOnNewIntent 根据这个参数判断是从onCreate过来还是从onNewIntent过来从而可以在{@link #isDelay(Intent, boolean)}里面确定延时逻辑如果是从onNewIntent过来是不需要延时的
*/ */
public void handle( Intent intent, boolean isOnNewIntent ) { public void handle(Intent intent, boolean isOnNewIntent) {
if ( intent == null || intent.getData() == null ) { if (intent == null || intent.getData() == null) {
return; return;
} }
Uri target = intent.getData(); Uri target = intent.getData();
String path = target.getPath(); String path = target.getPath();
if ( path == null || path.isEmpty() ) { if (path == null || path.isEmpty()) {
return; return;
} }
if ( !mApis.getStatusManagerApi().isMainPageOnResume() ) { if (!mApis.getStatusManagerApi().isMainPageOnResume()) {
long delay = 0L; long delay = 0L;
if ( isDelay( intent, isOnNewIntent ) ) { if (isDelay(intent, isOnNewIntent)) {
delay = 5_000L; delay = 5_000L;
} }
mNextIntent = new IntentWrapper( intent, delay ); mNextIntent = new IntentWrapper(intent, delay);
mApis.getLauncherApi().backToLauncher( mContext ); mApis.getLauncherApi().backToLauncher(mContext);
return; return;
} }
switch ( path ) { switch (path) {
case "/main/switch2": case "/main/switch2":
handleSwitch2Action( target ); handleSwitch2Action(target);
break; break;
case "/main/share": case "/main/share":
Logger.d( TAG, "收到打开分享框的scheme准备打开分享框" ); Logger.d(TAG, "收到打开分享框的scheme准备打开分享框");
Map< String, Object > properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
properties.put( "from", "1" ); properties.put("from", "1");
mApis.getAnalyticsApi().track( "v2x_share_click", properties ); mApis.getAnalyticsApi().track("v2x_share_click", properties);
mApis.getShareManager().showShareDialog(); mApis.getShareManager().showShareDialog();
break; break;
default: default:
@@ -132,34 +135,38 @@ public class SchemeIntent implements IMogoStatusChangedListener {
mNextIntent = null; mNextIntent = null;
} }
private boolean isDelay(Intent intent, boolean isOnNewIntent ) { private boolean isDelay(Intent intent, boolean isOnNewIntent) {
if ( isOnNewIntent || intent == null || intent.getData() == null ) { if (isOnNewIntent || intent == null || intent.getData() == null) {
return false; return false;
} }
Uri target = intent.getData(); Uri target = intent.getData();
String type = target.getQueryParameter( "type" ); String type = target.getQueryParameter("type");
return TextUtils.equals(TYPE_NAVI, type) || TextUtils.equals(TYPE_SHOW_SHARE_PANEL, type); return TextUtils.equals(TYPE_NAVI, type) || TextUtils.equals(TYPE_SHOW_SHARE_PANEL, type);
} }
private void handleSwitch2Action( Uri target ) { private void handleSwitch2Action(Uri target) {
String type = target.getQueryParameter( "type" ); String type = target.getQueryParameter("type");
if ( TextUtils.isEmpty( type ) ) { if (TextUtils.isEmpty(type)) {
return; return;
} }
switch ( type ) { switch (type) {
case TYPE_NAVI: case TYPE_NAVI:
handleNaviIntent( target ); handleNaviIntent(target);
break; break;
case TYPE_LAUNCH: case TYPE_LAUNCH:
handleLaunchIntent( target ); handleLaunchIntent(target);
break; break;
case TYPE_SEARCH_ROAD_CONDITION: case TYPE_SEARCH_ROAD_CONDITION:
handleSearchRoadCondition( target ); handleSearchRoadCondition(target);
break; break;
case TYPE_SHOW_ONLINE_CAR_PANEL: case TYPE_SHOW_ONLINE_CAR_PANEL:
handleShowOnlineCarPanel( target ); handleShowOnlineCarPanel(target);
case TYPE_SHOW_HISTORY_PANEL:
handleShowSharePanel(0);
case TYPE_SHOW_SURROUNDING_PANEL:
handleShowSharePanel(1);
case TYPE_SHOW_SHARE_PANEL: case TYPE_SHOW_SHARE_PANEL:
handleShowSharePanel(); handleShowSharePanel(2);
break; break;
default: default:
break; break;
@@ -167,71 +174,73 @@ public class SchemeIntent implements IMogoStatusChangedListener {
} }
} }
private void handleSearchRoadCondition( Uri target ) { private void handleSearchRoadCondition(Uri target) {
if ( mApis == null ) { if (mApis == null) {
return; return;
} }
Log.d("TanluManager", "handleSearchRoadCondition intentStr =" + target.getQueryParameter( "intentStr" ) + ">> data = " + target.getQueryParameter( "data" ) Log.d("TanluManager", "handleSearchRoadCondition intentStr =" + target.getQueryParameter("intentStr") + ">> data = " + target.getQueryParameter("data")
+ "-----city = " + target.getQueryParameter( "city" ) + "----keywords = " + target.getQueryParameter( "keywords" )); + "-----city = " + target.getQueryParameter("city") + "----keywords = " + target.getQueryParameter("keywords"));
mApis.getTanluUiApi().searchRoadCondition( target.getQueryParameter( "intentStr" ), mApis.getTanluUiApi().searchRoadCondition(target.getQueryParameter("intentStr"),
target.getQueryParameter( "data" ), target.getQueryParameter( "city" ), target.getQueryParameter("data"), target.getQueryParameter("city"),
target.getQueryParameter( "keywords" ) ); target.getQueryParameter("keywords"));
} }
private void handleNaviIntent( Uri naviUri ) { private void handleNaviIntent(Uri naviUri) {
if ( mApis == null ) { if (mApis == null) {
return; return;
} }
String lon = naviUri.getQueryParameter( "lon" ); String lon = naviUri.getQueryParameter("lon");
String lat = naviUri.getQueryParameter( "lat" ); String lat = naviUri.getQueryParameter("lat");
try { try {
double dlon = Double.valueOf( lon ); double dlon = Double.valueOf(lon);
double dlat = Double.valueOf( lat ); double dlat = Double.valueOf(lat);
if ( mApis.getMapServiceApi().getNavi( mContext ).isNaviing() ) { if (mApis.getMapServiceApi().getNavi(mContext).isNaviing()) {
mApis.getMapServiceApi().getNavi( mContext ).naviTo( new MogoLatLng( dlat, dlon ) ); mApis.getMapServiceApi().getNavi(mContext).naviTo(new MogoLatLng(dlat, dlon));
} else { } else {
mApis.getSearchManagerApi().calculatePath( new MogoLatLng( dlat, dlon ) ); mApis.getSearchManagerApi().calculatePath(new MogoLatLng(dlat, dlon));
} }
} catch ( Exception e ) { } catch (Exception e) {
TipToast.shortTip( "目的地异常,不能导航" ); TipToast.shortTip("目的地异常,不能导航");
Logger.e( TAG, e, "error." ); Logger.e(TAG, e, "error.");
} }
} }
private void handleLaunchIntent( Uri uri ) { private void handleLaunchIntent(Uri uri) {
String type = uri.getQueryParameter( "channelType" ); String type = uri.getQueryParameter("channelType");
Map< String, Object > properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
properties.put( "appname", CommonUtils.getAppName( mContext ) ); properties.put("appname", CommonUtils.getAppName(mContext));
properties.put( "appversion", CommonUtils.getVersionName( mContext ) ); properties.put("appversion", CommonUtils.getVersionName(mContext));
properties.put( "from", type ); properties.put("from", type);
mApis.getAnalyticsApi().track( "appenterfront", properties ); mApis.getAnalyticsApi().track("appenterfront", properties);
} }
private void handleShowOnlineCarPanel( Uri uri ) { private void handleShowOnlineCarPanel(Uri uri) {
mApis.getOnlineCarPanelApi().showPanel(); mApis.getOnlineCarPanelApi().showPanel();
} }
private void handleShowSharePanel() { /*
Logger.d(TAG, "handleShowSharePanel"); * 语音打开事件面板
// todo 跳转到热心指数 * */
mApis.getEventPanelManager().showPanelWithSelectedItem(2); private void handleShowSharePanel(int item) {
Logger.d(TAG, "语音打开事件面板");
mApis.getEventPanelManager().showPanelWithSelectedItem(item);
} }
@Override @Override
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) { public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if ( descriptor == StatusDescriptor.MAIN_PAGE_RESUME ) { if (descriptor == StatusDescriptor.MAIN_PAGE_RESUME) {
if ( mNextIntent == null ) { if (mNextIntent == null) {
return; return;
} }
if ( isTrue ) { if (isTrue) {
// 保证回到桌面后在开始该规划路线。 // 保证回到桌面后在开始该规划路线。
UiThreadHandler.postDelayed( () -> { UiThreadHandler.postDelayed(() -> {
if ( mNextIntent == null ) { if (mNextIntent == null) {
return; return;
} }
handle( mNextIntent.mIntent, false ); handle(mNextIntent.mIntent, false);
}, mNextIntent.mDelay ); }, mNextIntent.mDelay);
} }
} }
} }

View File

@@ -57,10 +57,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
android:paddingLeft="@dimen/module_main_apps_fragment_container_padding" android:paddingLeft="@dimen/module_main_event_panel_fragment_paddingLeft"
android:paddingRight="@dimen/module_main_apps_fragment_container_padding" android:paddingRight="@dimen/module_main_event_panel_fragment_paddingRight"
android:paddingTop="@dimen/module_main_apps_fragment_container_paddingTop" android:paddingTop="@dimen/module_main_event_panel_fragment_paddingTop"
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop" /> android:paddingBottom="@dimen/module_main_event_panel_fragment_paddingBottom" />
<FrameLayout <FrameLayout
android:id="@+id/module_main_id_message_history_fragment_container" android:id="@+id/module_main_id_message_history_fragment_container"

View File

@@ -27,5 +27,8 @@
<dimen name="module_main_entrance_fragment_container_width">658px</dimen> <dimen name="module_main_entrance_fragment_container_width">658px</dimen>
<dimen name="module_event_fragment_container_padding">8px</dimen> <dimen name="module_event_fragment_container_padding">8px</dimen>
<dimen name="module_main_apps_fragment_container_paddingTop">2px</dimen> <dimen name="module_main_apps_fragment_container_paddingTop">2px</dimen>
<dimen name="module_main_apps_fragment_container_paddingBottom">2px</dimen>
<dimen name="module_ext_top_view_max_width">1920px</dimen>
<dimen name="module_main_panel_margin_right">0px</dimen>
</resources> </resources>

View File

@@ -27,5 +27,8 @@
<dimen name="module_main_entrance_fragment_container_width">1263px</dimen> <dimen name="module_main_entrance_fragment_container_width">1263px</dimen>
<dimen name="module_event_fragment_container_padding">20px</dimen> <dimen name="module_event_fragment_container_padding">20px</dimen>
<dimen name="module_main_apps_fragment_container_paddingTop">20px</dimen> <dimen name="module_main_apps_fragment_container_paddingTop">20px</dimen>
<dimen name="module_main_apps_fragment_container_paddingBottom">20px</dimen>
<dimen name="module_ext_top_view_max_width">1920px</dimen>
<dimen name="module_main_panel_margin_right">0px</dimen>
</resources> </resources>

View File

@@ -27,4 +27,9 @@
<dimen name="module_main_entrance_fragment_container_width">1313px</dimen> <dimen name="module_main_entrance_fragment_container_width">1313px</dimen>
<dimen name="module_event_fragment_container_padding">20px</dimen> <dimen name="module_event_fragment_container_padding">20px</dimen>
<dimen name="module_main_apps_fragment_container_paddingTop">20px</dimen> <dimen name="module_main_apps_fragment_container_paddingTop">20px</dimen>
<dimen name="module_main_event_panel_fragment_paddingTop">18px</dimen>
<dimen name="module_main_event_panel_fragment_paddingBottom">18px</dimen>
<dimen name="module_main_event_panel_fragment_paddingLeft">18px</dimen>
<dimen name="module_main_event_panel_fragment_paddingRight">18px</dimen>
</resources> </resources>

Some files were not shown because too many files have changed in this diff Show More