Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java
This commit is contained in:
@@ -70,7 +70,7 @@ MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
|
||||
# 在线车辆F
|
||||
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
|
||||
# v2x
|
||||
MOGO_MODULE_V2X_VERSION=1.1.4
|
||||
MOGO_MODULE_V2X_VERSION=1.1.10-SNAPSHOT
|
||||
# 媒体卡片
|
||||
MOGO_MODULE_MEDIA_VERSION=1.0.4.11
|
||||
# 推送
|
||||
|
||||
@@ -40,9 +40,6 @@ public class AppFilterImpl implements AppFilter {
|
||||
if ( isFilterPackages( packageInfo ) ) {
|
||||
return true;
|
||||
}
|
||||
if ( !AppEnumHelper.isCustomizedApp( packageInfo.packageName ) ) {
|
||||
return true;
|
||||
}
|
||||
if ( noLaunchIntent( packageInfo ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,11 @@ public class AppsAdapter extends BaseAdapter {
|
||||
}
|
||||
AppInfo appInfo = getItem( position );
|
||||
if ( appInfo.getIconResId() <= 0 ) {
|
||||
holder.mIcon.setImageResource( R.drawable.module_apps_ic_default_icon );
|
||||
if ( appInfo.getIcon() != null ) {
|
||||
holder.mIcon.setImageDrawable( appInfo.getIcon() );
|
||||
} else {
|
||||
holder.mIcon.setImageResource( R.drawable.module_apps_ic_default_icon );
|
||||
}
|
||||
} else {
|
||||
holder.mIcon.setImageResource( appInfo.getIconResId() );
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.mogo.module.apps.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
@@ -78,9 +80,12 @@ public class AppsModel {
|
||||
String packageName = packageInfo.packageName;
|
||||
String versionName = packageInfo.versionName;
|
||||
int versionCode = packageInfo.versionCode;
|
||||
// 不加载默认图标,避免不必要的开销,因为现在应用列表图标都是定制的啊~~~~
|
||||
// Drawable appIcon = packageInfo.applicationInfo.loadIcon( packageManager );
|
||||
AppInfo appInfo = new AppInfo( appName, packageName, versionName, versionCode, null, AppEnumHelper.getCustomizedAppIconResId( packageName ) );
|
||||
int iconResId = AppEnumHelper.getCustomizedAppIconResId( packageName );
|
||||
Drawable appIcon = null;
|
||||
if ( iconResId == 0 ) {
|
||||
appIcon = packageInfo.applicationInfo.loadIcon( packageManager );
|
||||
}
|
||||
AppInfo appInfo = new AppInfo( appName, packageName, versionName, versionCode, appIcon, iconResId );
|
||||
mPagedApps.get( page ).add( appInfo );
|
||||
}
|
||||
if ( callback != null ) {
|
||||
|
||||
@@ -5,6 +5,17 @@
|
||||
<string name="module_apps_str_guide_warning">为了您的安全,导航中不可播放视频</string>
|
||||
<string-array name="module_apps_array_filter_packages">
|
||||
<item>com.mogo.launcher</item>
|
||||
<item>com.mogo.launcher.app</item>
|
||||
<item>com.zhidao.launcher</item>
|
||||
<item>com.nwd.android.toolsmanager</item>
|
||||
<item>com.nwd.filemanager</item>
|
||||
<item>com.zhidao.autopilot</item>
|
||||
<item>com.android.browser</item>
|
||||
<item>com.android.providers.downloads.ui</item>
|
||||
<item>com.zhidao.guide.lock</item>
|
||||
<item>com.android.settings</item>
|
||||
<item>com.android.calculator2</item>
|
||||
<item>com.nwd.guidebookskin</item>
|
||||
<item>com.iflytek.inputmethod.pad</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@@ -26,8 +26,10 @@ public class MapCenterPointStrategy {
|
||||
// 普通场景,使用高德内部值
|
||||
{
|
||||
Map< Integer, MapCenterPoint > common = new HashMap<>();
|
||||
common.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
common.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
common.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
common.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
common.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.666666666D ) );
|
||||
sStrategies.put( Scene.COMMON, common );
|
||||
}
|
||||
|
||||
@@ -35,6 +37,8 @@ public class MapCenterPointStrategy {
|
||||
// 选点场景,定位中心点
|
||||
Map< Integer, MapCenterPoint > choosePoint = new HashMap<>();
|
||||
choosePoint.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
choosePoint.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
choosePoint.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
choosePoint.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.5D, 0.5D ) );
|
||||
sStrategies.put( Scene.CHOOSE_POINT, choosePoint );
|
||||
}
|
||||
@@ -42,7 +46,9 @@ public class MapCenterPointStrategy {
|
||||
{
|
||||
// 导航场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > navi = new HashMap<>();
|
||||
navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
||||
navi.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.573333333333D ) );
|
||||
navi.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
||||
navi.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.573333333333D ) );
|
||||
navi.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.575D ) );
|
||||
sStrategies.put( Scene.NAVI, navi );
|
||||
}
|
||||
@@ -50,23 +56,29 @@ public class MapCenterPointStrategy {
|
||||
{
|
||||
// 导航场景 vs 道路事件展示场景,定位视图右下角偏下
|
||||
Map< Integer, MapCenterPoint > naviWithRoadEvent = new HashMap<>();
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.68333333333D ) );
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.68333333333D ) );
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.68333333333D ) );
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.68333333333D ) );
|
||||
naviWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
|
||||
sStrategies.put( Scene.NAVI_WITH_ROAD_EVENT, naviWithRoadEvent );
|
||||
}
|
||||
|
||||
{
|
||||
// 巡航场景,定位视图右下角偏下
|
||||
// 巡航场景
|
||||
Map< Integer, MapCenterPoint > aimless = new HashMap<>();
|
||||
aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.5D ) );
|
||||
aimless.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.5D ) );
|
||||
aimless.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.5D ) );
|
||||
aimless.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.5D ) );
|
||||
aimless.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.5D ) );
|
||||
sStrategies.put( Scene.AIMLESS, aimless );
|
||||
}
|
||||
|
||||
{
|
||||
// 巡航场景 vs 道路事件展示场景,定位视图右下角偏下
|
||||
// 巡航场景 vs 道路事件展示场景
|
||||
Map< Integer, MapCenterPoint > aimlessWithRoadEvent = new HashMap<>();
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.734375D, 0.585 ) );
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.585 ) );
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.734375D, 0.585 ) );
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.734375D, 0.585 ) );
|
||||
aimlessWithRoadEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.705208333D, 0.599074074D ) );
|
||||
sStrategies.put( Scene.AIMLESS_WITH_ROAD_EVENT, aimlessWithRoadEvent );
|
||||
}
|
||||
@@ -75,6 +87,8 @@ public class MapCenterPointStrategy {
|
||||
// 规划路线,定位视图右边
|
||||
Map< Integer, MapCenterPoint > calculatePath = new HashMap<>();
|
||||
calculatePath.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
calculatePath.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
calculatePath.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.733398D, 0.610833D ) );
|
||||
calculatePath.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.703125D, 0.6083333D ) );
|
||||
sStrategies.put( Scene.CALCULATE_PATH, calculatePath );
|
||||
}
|
||||
@@ -83,6 +97,8 @@ public class MapCenterPointStrategy {
|
||||
// 分类搜索,定位视图右边
|
||||
Map< Integer, MapCenterPoint > categorySearch = new HashMap<>();
|
||||
categorySearch.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.733398D, 0.5D ) );
|
||||
categorySearch.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.733398D, 0.5D ) );
|
||||
categorySearch.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.733398D, 0.5D ) );
|
||||
categorySearch.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.733594D, 0.5D ) );
|
||||
sStrategies.put( Scene.CATEGORY_SEARCH, categorySearch );
|
||||
}
|
||||
@@ -90,7 +106,9 @@ public class MapCenterPointStrategy {
|
||||
{
|
||||
// V2X,场景视图右边
|
||||
Map< Integer, MapCenterPoint > categoryV2XEvent = new HashMap<>();
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_D80X, new MapCenterPoint( 0.669444444444444, 0.7D ) );
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_E84X, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_E84XCD, new MapCenterPoint( 0.677734375D, 0.7D ) );
|
||||
categoryV2XEvent.put( CarSeries.CAR_SERIES_F80X, new MapCenterPoint( 0.6963541D, 0.65D ) );
|
||||
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ public class WebSocketManager {
|
||||
super.onOpen( handshakedata );
|
||||
UiThreadHandler.post( () -> {
|
||||
TipToast.shortTip( "模拟GPS开启成功" );
|
||||
mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ).stop();
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -78,6 +79,7 @@ public class WebSocketManager {
|
||||
super.onClose( code, reason, remote );
|
||||
UiThreadHandler.post( () -> {
|
||||
TipToast.shortTip( "模拟GPS关闭成功" );
|
||||
mServiceApis.getMapServiceApi().getSingletonLocationClient( AbsMogoApplication.getApp() ).start();
|
||||
} );
|
||||
shutdownServiceQuietly();
|
||||
}
|
||||
@@ -110,6 +112,7 @@ public class WebSocketManager {
|
||||
location.setSpeed( realTimeLocationVo.getVehicleSpeed() );
|
||||
location.setAccuracy( 1 );
|
||||
location.setTime( realTimeLocationVo.getLocationTime() );
|
||||
|
||||
if ( listeners != null ) {
|
||||
while ( listeners.hasNext() ) {
|
||||
listeners.next().onLocationChanged( location );
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.module.main.EventDispatchCenter;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.roadcondition.service.MainService;
|
||||
|
||||
@@ -43,9 +44,12 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
initAndStartLocation();
|
||||
initGpsSimulatorListener();
|
||||
loadBaseModules();
|
||||
startTanluService();
|
||||
initADAS();
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
loadBaseModules();
|
||||
startTanluService();
|
||||
initADAS();
|
||||
}, 2_000L
|
||||
);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -164,8 +164,8 @@ public class VoiceConstants {
|
||||
|
||||
static {
|
||||
// 免唤醒
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
|
||||
// sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS );
|
||||
// sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_2D_UN_WAKEUP, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_3D_UN_WAKEUP, VoiceConstants.CMD_MAP_3D_TRIGGER_WORDS );
|
||||
//sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
|
||||
|
||||
@@ -194,11 +194,11 @@ public class MarkerServiceHandler {
|
||||
* 绘制Marker
|
||||
* 建议使用
|
||||
*
|
||||
* @see MapMarkerManager#drawMapMarker(MarkerShowEntity)
|
||||
* @see MapMarkerManager#drawMapMarker(MarkerShowEntity, int)
|
||||
*/
|
||||
@Deprecated
|
||||
public static IMogoMarker drawMapMarker( MarkerShowEntity markerShowEntity ) {
|
||||
return getMapMarkerManager().drawMapMarker( markerShowEntity );
|
||||
return getMapMarkerManager().drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -577,11 +577,6 @@ public class MogoServices implements IMogoMapListener,
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location latLng ) {
|
||||
if ( mStatusManager.isV2XShow() ) {
|
||||
return;
|
||||
}
|
||||
@@ -590,12 +585,12 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( latLng == null ) {
|
||||
if ( location == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 自动刷新触发
|
||||
final MogoLatLng point = new MogoLatLng( latLng.getLatitude(), latLng.getLongitude() );
|
||||
final MogoLatLng point = new MogoLatLng( location.getLatitude(), location.getLongitude() );
|
||||
if ( mLastAutoRefreshLocation == null ) {
|
||||
mLastAutoRefreshLocation = point;
|
||||
mLoopRequest = true;
|
||||
@@ -613,6 +608,10 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged2( Location latLng ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged( MogoLatLng latLng ) {
|
||||
|
||||
|
||||
@@ -113,6 +113,9 @@ public class ServiceConst {
|
||||
*/
|
||||
public static final int MSG_LOCK_CAR = 0x202;
|
||||
|
||||
public static final int MARKER_Z_INDEX_HIGH = 100;
|
||||
public static final int MARKER_Z_INDEX_LOW = 2;
|
||||
|
||||
|
||||
/**
|
||||
* 切换卡片内容-上一个
|
||||
|
||||
@@ -320,7 +320,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
String sn = getCarSnFromEntity( markerOnlineCar );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
mogoMarker = drawMapMarker( markerShowEntity );
|
||||
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_LOW );
|
||||
}
|
||||
startSmooth( mogoMarker, markerOnlineCar, markerLocation );
|
||||
}
|
||||
@@ -360,7 +360,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
Logger.d( TAG, "draw road condition, sn = %s", sn );
|
||||
drawMapMarker( markerShowEntity );
|
||||
drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
String sn = getCarSnFromEntity( markerShareMusic );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
drawMapMarker( markerShowEntity );
|
||||
drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -425,7 +425,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
String sn = getCarSnFromEntity( noveltyInfo );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
drawMapMarker( markerShowEntity );
|
||||
drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -634,20 +634,20 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
* @param markerShowEntity marker 绘制数据实体
|
||||
* @return 绘制的Marker
|
||||
*/
|
||||
public synchronized IMogoMarker drawMapMarker( MarkerShowEntity markerShowEntity ) {
|
||||
public synchronized IMogoMarker drawMapMarker( MarkerShowEntity markerShowEntity, int zIndex ) {
|
||||
try {
|
||||
return drawMapMarkerImpl( markerShowEntity );
|
||||
return drawMapMarkerImpl( markerShowEntity, zIndex );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity ) {
|
||||
private IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, int zIndex ) {
|
||||
if ( markerShowEntity == null || markerShowEntity.getMarkerLocation() == null ) {
|
||||
return null;
|
||||
}
|
||||
MogoMarkerOptions options = new MogoMarkerOptions().owner( markerShowEntity.getMarkerType() ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() );
|
||||
MogoMarkerOptions options = new MogoMarkerOptions().owner( markerShowEntity.getMarkerType() ).zIndex( zIndex ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() );
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView( mContext, markerShowEntity, options );
|
||||
if ( markerView instanceof OnlineCarMarkerView ) {
|
||||
try {
|
||||
@@ -691,7 +691,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
public void getOnlineCarDataByAutoRefreshStrategy( MogoLatLng latlng ) {
|
||||
UiThreadHandler.removeCallbacks( runnable );
|
||||
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
|
||||
getOnlineCarDataImpl( latlng, false, false, 50, 2_000, false );
|
||||
}
|
||||
|
||||
@@ -708,15 +707,14 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
int limit,
|
||||
int radius ) {
|
||||
UiThreadHandler.removeCallbacks( runnable );
|
||||
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
|
||||
getOnlineCarDataImpl( latLng, onlyFocus, onlySameCity, limit, radius, true );
|
||||
}
|
||||
|
||||
private Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Logger.d( TAG, "内部 - 自动刷新在线车辆" );
|
||||
getOnlineCarDataImpl( mCarLatLng, false, false, 50, 2_000, false );
|
||||
UiThreadHandler.postDelayed( this, SMOOTH_DURATION * 1000 );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -742,15 +740,24 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
int radius,
|
||||
boolean fitBounds ) {
|
||||
|
||||
if ( mCarLatLng == null ) {
|
||||
mCarLatLng = latLng;
|
||||
}
|
||||
|
||||
Logger.d( TAG, "内部 - 请求执行" );
|
||||
|
||||
if ( latLng == null ) {
|
||||
Logger.d( TAG, "内部 - 定位为空" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ignoreOnlineCarRequest() ) {
|
||||
Logger.d( TAG, "内部 - 忽略请求" );
|
||||
removeCarMarkers();
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d( TAG, "内部 - 请求开始" );
|
||||
mRefreshModel.queryOnLineCarWithRoute( latLng, onlyFocus, onlySameCity, radius, limit, new RefreshCallback() {
|
||||
@Override
|
||||
public void onSuccess( Object o ) {
|
||||
@@ -764,8 +771,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
int size = onlineCarList == null ? 0 : onlineCarList.size();
|
||||
trackData( size );
|
||||
final int size = onlineCarList == null ? 0 : onlineCarList.size();
|
||||
|
||||
if ( mMarkerDisplayBounds == null ) {
|
||||
mMarkerDisplayBounds = new Rect(
|
||||
@@ -776,8 +782,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
);
|
||||
}
|
||||
|
||||
Logger.d( TAG, "内部 - 请求完毕" );
|
||||
runOnTargetThread( () -> {
|
||||
Logger.d( TAG, "内部 - 请求完毕开始处理" );
|
||||
trackData( size );
|
||||
drawOnlineCarMarkers( onlineCarList, Integer.MAX_VALUE, fitBounds, fitBounds, mMarkerDisplayBounds, latLng );
|
||||
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoMarkerService;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -27,7 +28,7 @@ public class MogoMarkerServiceImpl implements IMogoMarkerService {
|
||||
@Override
|
||||
public IMogoMarker drawMarker( Object object ) {
|
||||
if ( object instanceof MarkerShowEntity ) {
|
||||
return MarkerServiceHandler.getMapMarkerManager().drawMapMarker( ( ( MarkerShowEntity ) object ) );
|
||||
return MarkerServiceHandler.getMapMarkerManager().drawMapMarker( ( ( MarkerShowEntity ) object ), ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
Logger.w( TAG, "object must instance of [com.mogo.module.common.entity.MarkerShowEntity]" );
|
||||
return null;
|
||||
|
||||
@@ -10,7 +10,9 @@ public enum StatusDescriptor {
|
||||
|
||||
/**
|
||||
* adas UI
|
||||
* Deprecated, use {@link #V2X_UI} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
ADAS_UI,
|
||||
|
||||
/**
|
||||
@@ -20,10 +22,7 @@ public enum StatusDescriptor {
|
||||
|
||||
/**
|
||||
* v2x UI
|
||||
* <p>
|
||||
* Deprecated, use {@link #ADAS_UI} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
V2X_UI,
|
||||
|
||||
/**
|
||||
|
||||
@@ -133,7 +133,7 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
|
||||
@Override
|
||||
public void setV2XUIShow( String tag, boolean show ) {
|
||||
Logger.e( TAG, "do not implement" );
|
||||
doSetStatus( tag, StatusDescriptor.V2X_UI, show );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,10 +200,11 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
}
|
||||
|
||||
private void invokeStatusChangedListener( StatusDescriptor descriptor, boolean status ) {
|
||||
if ( mListeners.containsKey( descriptor ) ) {
|
||||
Iterator< IMogoStatusChangedListener > iterator = mListeners.get( descriptor ).iterator();
|
||||
while ( iterator.hasNext() ) {
|
||||
IMogoStatusChangedListener listener = iterator.next();
|
||||
List< IMogoStatusChangedListener > listenerList = mListeners.get( descriptor );
|
||||
if ( listenerList != null && listenerList.size() > 0 ) {
|
||||
IMogoStatusChangedListener[] listeners = new IMogoStatusChangedListener[listenerList.size()];
|
||||
listenerList.toArray( listeners );
|
||||
for ( IMogoStatusChangedListener listener : listeners ) {
|
||||
if ( listener != null ) {
|
||||
listener.onStatusChanged( descriptor, status );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user