use of org.fdroid.fdroid.views.updates.items.UpdateableApp in project fdroidclient by f-droid.
the class UpdatesAdapter method onCanUpdateLoadFinished.
private void onCanUpdateLoadFinished(Cursor cursor) {
updateableApps.clear();
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
updateableApps.add(new UpdateableApp(activity, new App(cursor)));
cursor.moveToNext();
}
}
use of org.fdroid.fdroid.views.updates.items.UpdateableApp in project fdroidclient by f-droid.
the class UpdatesAdapter method populateItems.
/**
* Completely rebuilds the underlying data structure used by this adapter. Note however, that
* this does not notify the recycler view of any changes. Thus, it is up to other methods which
* initiate a call to this method to make sure they appropriately notify the recyler view.
*/
private void populateItems() {
items.clear();
Set<String> toShowStatusPackageNames = new HashSet<>(appsToShowStatus.size());
for (AppStatus app : appsToShowStatus) {
toShowStatusPackageNames.add(app.status.app.packageName);
items.add(app);
}
if (updateableApps != null) {
// Only count/show apps which are not shown above in the "Apps to show status" list.
List<UpdateableApp> updateableAppsToShow = new ArrayList<>(updateableApps.size());
for (UpdateableApp app : updateableApps) {
if (!toShowStatusPackageNames.contains(app.app.packageName)) {
updateableAppsToShow.add(app);
}
}
if (updateableAppsToShow.size() > 0) {
items.add(new UpdateableAppsHeader(activity, this, updateableAppsToShow));
if (showAllUpdateableApps) {
items.addAll(updateableAppsToShow);
}
}
}
items.addAll(knownVulnApps);
}
Aggregations