This commit is contained in:
wangcongtao
2020-06-11 20:26:02 +08:00
parent cba69352ca
commit 5298cbef6d
10 changed files with 54 additions and 26 deletions

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" 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

@@ -40,9 +40,6 @@ public class AppFilterImpl implements AppFilter {
if ( isFilterPackages( packageInfo ) ) { if ( isFilterPackages( packageInfo ) ) {
return true; return true;
} }
if ( !AppEnumHelper.isCustomizedApp( packageInfo.packageName ) ) {
return true;
}
if ( noLaunchIntent( packageInfo ) ) { if ( noLaunchIntent( packageInfo ) ) {
return true; return true;
} }

View File

@@ -57,7 +57,11 @@ public class AppsAdapter extends BaseAdapter {
} }
AppInfo appInfo = getItem( position ); AppInfo appInfo = getItem( position );
if ( appInfo.getIconResId() <= 0 ) { 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 { } else {
holder.mIcon.setImageResource( appInfo.getIconResId() ); holder.mIcon.setImageResource( appInfo.getIconResId() );
} }

View File

@@ -1,8 +1,10 @@
package com.mogo.module.apps.model; package com.mogo.module.apps.model;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
@@ -78,9 +80,12 @@ public class AppsModel {
String packageName = packageInfo.packageName; String packageName = packageInfo.packageName;
String versionName = packageInfo.versionName; String versionName = packageInfo.versionName;
int versionCode = packageInfo.versionCode; int versionCode = packageInfo.versionCode;
// 不加载默认图标,避免不必要的开销,因为现在应用列表图标都是定制的啊~~~~ int iconResId = AppEnumHelper.getCustomizedAppIconResId( packageName );
// Drawable appIcon = packageInfo.applicationInfo.loadIcon( packageManager ); Drawable appIcon = null;
AppInfo appInfo = new AppInfo( appName, packageName, versionName, versionCode, null, AppEnumHelper.getCustomizedAppIconResId( packageName ) ); if ( iconResId == 0 ) {
appIcon = packageInfo.applicationInfo.loadIcon( packageManager );
}
AppInfo appInfo = new AppInfo( appName, packageName, versionName, versionCode, appIcon, iconResId );
mPagedApps.get( page ).add( appInfo ); mPagedApps.get( page ).add( appInfo );
} }
if ( callback != null ) { if ( callback != null ) {

View File

@@ -5,6 +5,17 @@
<string name="module_apps_str_guide_warning">为了您的安全,导航中不可播放视频</string> <string name="module_apps_str_guide_warning">为了您的安全,导航中不可播放视频</string>
<string-array name="module_apps_array_filter_packages"> <string-array name="module_apps_array_filter_packages">
<item>com.mogo.launcher</item> <item>com.mogo.launcher</item>
<item>com.mogo.launcher.app</item>
<item>com.zhidao.launcher</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> </string-array>
</resources> </resources>

View File

@@ -112,6 +112,7 @@ public class WebSocketManager {
location.setSpeed( realTimeLocationVo.getVehicleSpeed() ); location.setSpeed( realTimeLocationVo.getVehicleSpeed() );
location.setAccuracy( 1 ); location.setAccuracy( 1 );
location.setTime( realTimeLocationVo.getLocationTime() ); location.setTime( realTimeLocationVo.getLocationTime() );
if ( listeners != null ) { if ( listeners != null ) {
while ( listeners.hasNext() ) { while ( listeners.hasNext() ) {
listeners.next().onLocationChanged( location ); listeners.next().onLocationChanged( location );

View File

@@ -164,8 +164,8 @@ public class VoiceConstants {
static { static {
// 免唤醒 // 免唤醒
//sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_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_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_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_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 ); //sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );

View File

@@ -577,11 +577,6 @@ public class MogoServices implements IMogoMapListener,
@Override @Override
public void onLocationChanged( MogoLocation location ) { public void onLocationChanged( MogoLocation location ) {
}
@Override
public void onCarLocationChanged2( Location latLng ) {
if ( mStatusManager.isV2XShow() ) { if ( mStatusManager.isV2XShow() ) {
return; return;
} }
@@ -590,12 +585,12 @@ public class MogoServices implements IMogoMapListener,
return; return;
} }
if ( latLng == null ) { if ( location == null ) {
return; return;
} }
// 自动刷新触发 // 自动刷新触发
final MogoLatLng point = new MogoLatLng( latLng.getLatitude(), latLng.getLongitude() ); final MogoLatLng point = new MogoLatLng( location.getLatitude(), location.getLongitude() );
if ( mLastAutoRefreshLocation == null ) { if ( mLastAutoRefreshLocation == null ) {
mLastAutoRefreshLocation = point; mLastAutoRefreshLocation = point;
mLoopRequest = true; mLoopRequest = true;
@@ -613,6 +608,10 @@ public class MogoServices implements IMogoMapListener,
} }
} }
@Override
public void onCarLocationChanged2( Location latLng ) {
}
@Override @Override
public void onCarLocationChanged( MogoLatLng latLng ) { public void onCarLocationChanged( MogoLatLng latLng ) {

View File

@@ -691,7 +691,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
public void getOnlineCarDataByAutoRefreshStrategy( MogoLatLng latlng ) { public void getOnlineCarDataByAutoRefreshStrategy( MogoLatLng latlng ) {
UiThreadHandler.removeCallbacks( runnable ); UiThreadHandler.removeCallbacks( runnable );
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
getOnlineCarDataImpl( latlng, false, false, 50, 2_000, false ); getOnlineCarDataImpl( latlng, false, false, 50, 2_000, false );
} }
@@ -708,15 +707,14 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
int limit, int limit,
int radius ) { int radius ) {
UiThreadHandler.removeCallbacks( runnable ); UiThreadHandler.removeCallbacks( runnable );
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
getOnlineCarDataImpl( latLng, onlyFocus, onlySameCity, limit, radius, true ); getOnlineCarDataImpl( latLng, onlyFocus, onlySameCity, limit, radius, true );
} }
private Runnable runnable = new Runnable() { private Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
Logger.d( TAG, "内部 - 自动刷新在线车辆" );
getOnlineCarDataImpl( mCarLatLng, false, false, 50, 2_000, false ); 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, int radius,
boolean fitBounds ) { boolean fitBounds ) {
if ( mCarLatLng == null ) {
mCarLatLng = latLng;
}
Logger.d( TAG, "内部 - 请求执行" );
if ( latLng == null ) { if ( latLng == null ) {
Logger.d( TAG, "内部 - 定位为空" );
return; return;
} }
if ( ignoreOnlineCarRequest() ) { if ( ignoreOnlineCarRequest() ) {
Logger.d( TAG, "内部 - 忽略请求" );
removeCarMarkers(); removeCarMarkers();
return; return;
} }
Logger.d( TAG, "内部 - 请求开始" );
mRefreshModel.queryOnLineCarWithRoute( latLng, onlyFocus, onlySameCity, radius, limit, new RefreshCallback() { mRefreshModel.queryOnLineCarWithRoute( latLng, onlyFocus, onlySameCity, radius, limit, new RefreshCallback() {
@Override @Override
public void onSuccess( Object o ) { public void onSuccess( Object o ) {
@@ -764,8 +771,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) { if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
return; return;
} }
int size = onlineCarList == null ? 0 : onlineCarList.size(); final int size = onlineCarList == null ? 0 : onlineCarList.size();
trackData( size );
if ( mMarkerDisplayBounds == null ) { if ( mMarkerDisplayBounds == null ) {
mMarkerDisplayBounds = new Rect( mMarkerDisplayBounds = new Rect(
@@ -776,8 +782,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
); );
} }
Logger.d( TAG, "内部 - 请求完毕" );
runOnTargetThread( () -> { runOnTargetThread( () -> {
Logger.d( TAG, "内部 - 请求完毕开始处理" );
trackData( size );
drawOnlineCarMarkers( onlineCarList, Integer.MAX_VALUE, fitBounds, fitBounds, mMarkerDisplayBounds, latLng ); drawOnlineCarMarkers( onlineCarList, Integer.MAX_VALUE, fitBounds, fitBounds, mMarkerDisplayBounds, latLng );
UiThreadHandler.postDelayed( runnable, SMOOTH_DURATION * 1000 );
} ); } );
} }

View File

@@ -200,10 +200,11 @@ public class MogoStatusManager implements IMogoStatusManager {
} }
private void invokeStatusChangedListener( StatusDescriptor descriptor, boolean status ) { private void invokeStatusChangedListener( StatusDescriptor descriptor, boolean status ) {
if ( mListeners.containsKey( descriptor ) ) { List< IMogoStatusChangedListener > listenerList = mListeners.get( descriptor );
Iterator< IMogoStatusChangedListener > iterator = mListeners.get( descriptor ).iterator(); if ( listenerList != null && listenerList.size() > 0 ) {
while ( iterator.hasNext() ) { IMogoStatusChangedListener[] listeners = new IMogoStatusChangedListener[listenerList.size()];
IMogoStatusChangedListener listener = iterator.next(); listenerList.toArray( listeners );
for ( IMogoStatusChangedListener listener : listeners ) {
if ( listener != null ) { if ( listener != null ) {
listener.onStatusChanged( descriptor, status ); listener.onStatusChanged( descriptor, status );
} }