use of android.util.IconDrawableFactory in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ApplicationListPreferenceController method onListOfAppsResult.
@Override
public void onListOfAppsResult(List<UserAppInfo> result) {
final PreferenceScreen screen = mParent.getPreferenceScreen();
if (screen == null) {
return;
}
final IconDrawableFactory iconDrawableFactory = IconDrawableFactory.newInstance(mContext);
final Context prefContext = mParent.getPreferenceManager().getContext();
for (int position = 0; position < result.size(); position++) {
final UserAppInfo item = result.get(position);
final Preference preference = new AppPreference(prefContext);
preference.setTitle(item.appInfo.loadLabel(mPm));
preference.setIcon(iconDrawableFactory.getBadgedIcon(item.appInfo));
preference.setOrder(position);
preference.setSelectable(false);
screen.addPreference(preference);
}
}
use of android.util.IconDrawableFactory in project android_packages_apps_Settings by omnirom.
the class DomainAppPreferenceController method rebuildAppList.
private void rebuildAppList(PreferenceGroup group, ArrayList<AppEntry> apps) {
cacheAllPrefs(group);
final int size = apps.size();
final Context context = group.getContext();
final IconDrawableFactory iconDrawableFactory = IconDrawableFactory.newInstance(context);
for (int i = 0; i < size; i++) {
final AppEntry entry = apps.get(i);
final String key = entry.info.packageName + "|" + entry.info.uid;
DomainAppPreference preference = (DomainAppPreference) getCachedPreference(key);
if (preference == null) {
preference = new DomainAppPreference(context, iconDrawableFactory, entry);
preference.setKey(key);
group.addPreference(preference);
} else {
preference.reuse();
}
preference.setOrder(i);
}
removeCachedPrefs(group);
}
use of android.util.IconDrawableFactory in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DomainAppPreferenceController method rebuildAppList.
private void rebuildAppList(PreferenceGroup group, ArrayList<AppEntry> apps) {
cacheAllPrefs(group);
final int size = apps.size();
final Context context = group.getContext();
final IconDrawableFactory iconDrawableFactory = IconDrawableFactory.newInstance(context);
for (int i = 0; i < size; i++) {
final AppEntry entry = apps.get(i);
final String key = entry.info.packageName + "|" + entry.info.uid;
DomainAppPreference preference = (DomainAppPreference) getCachedPreference(key);
if (preference == null) {
preference = new DomainAppPreference(context, iconDrawableFactory, entry);
preference.setKey(key);
group.addPreference(preference);
} else {
preference.reuse();
}
preference.setOrder(i);
}
removeCachedPrefs(group);
}
use of android.util.IconDrawableFactory in project android_packages_apps_Settings by omnirom.
the class ApplicationListPreferenceController method onListOfAppsResult.
@Override
public void onListOfAppsResult(List<UserAppInfo> result) {
final PreferenceScreen screen = mParent.getPreferenceScreen();
if (screen == null) {
return;
}
final IconDrawableFactory iconDrawableFactory = IconDrawableFactory.newInstance(mContext);
final Context prefContext = mParent.getPreferenceManager().getContext();
for (int position = 0; position < result.size(); position++) {
final UserAppInfo item = result.get(position);
final Preference preference = new AppPreference(prefContext);
preference.setTitle(item.appInfo.loadLabel(mPm));
preference.setIcon(iconDrawableFactory.getBadgedIcon(item.appInfo));
preference.setOrder(position);
preference.setSelectable(false);
screen.addPreference(preference);
}
}
Aggregations