use of com.android.launcher3.compat.AlphabeticIndexCompat in project android_packages_apps_Launcher3 by crdroidandroid.
the class AllAppsList method clear.
public void clear() {
data.clear();
mDataChanged = false;
// Reset the index as locales might have changed
mIndex = new AlphabeticIndexCompat(LocaleList.getDefault());
}
use of com.android.launcher3.compat.AlphabeticIndexCompat in project android_packages_apps_Launcher3 by crdroidandroid.
the class WidgetsModel method getWidgetsListForPicker.
/**
* Returns a list of {@link WidgetsListBaseEntry}. All {@link WidgetItem} in a single row
* are sorted (based on label and user), but the overall list of
* {@link WidgetsListBaseEntry}s is not sorted. This list is sorted at the UI when using
* {@link WidgetsDiffReporter}
*
* @see com.android.launcher3.widget.picker.WidgetsListAdapter#setWidgets(List)
*/
public synchronized ArrayList<WidgetsListBaseEntry> getWidgetsListForPicker(Context context) {
ArrayList<WidgetsListBaseEntry> result = new ArrayList<>();
AlphabeticIndexCompat indexer = new AlphabeticIndexCompat(context);
for (Map.Entry<PackageItemInfo, List<WidgetItem>> entry : mWidgetsList.entrySet()) {
PackageItemInfo pkgItem = entry.getKey();
List<WidgetItem> widgetItems = entry.getValue();
String sectionName = (pkgItem.title == null) ? "" : indexer.computeSectionName(pkgItem.title);
result.add(new WidgetsListHeaderEntry(pkgItem, sectionName, widgetItems));
result.add(new WidgetsListContentEntry(pkgItem, sectionName, widgetItems));
}
return result;
}
Aggregations