opt
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -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>
|
||||
|
||||
@@ -112,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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
|
||||
@@ -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 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -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