opt
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user