Merge branch 'issue-938--feature-graphic-priority' into 'master'

Order apps in main screen by date, new, then presence of feature graphic

Closes #938

See merge request !555
This commit is contained in:
Hans-Christoph Steiner 2017-07-04 20:48:02 +00:00
commit b9277f52e7
2 changed files with 3 additions and 2 deletions

View File

@ -739,8 +739,9 @@ public class AppProvider extends FDroidProvider {
case RECENTLY_UPDATED:
String table = getTableName();
String isNew = table + "." + Cols.LAST_UPDATED + " <= " + table + "." + Cols.ADDED + " DESC";
String hasFeatureGraphic = table + "." + Cols.FEATURE_GRAPHIC + " IS NULL ASC ";
String lastUpdated = table + "." + Cols.LAST_UPDATED + " DESC";
sortOrder = lastUpdated + ", " + isNew;
sortOrder = lastUpdated + ", " + isNew + ", " + hasFeatureGraphic;
// There seems no reason to limit the number of apps on the front page, but it helps
// if it loads quickly, as it is the default view shown every time F-Droid is opened.

View File

@ -133,7 +133,7 @@ public class AppCardController extends RecyclerView.ViewHolder
// feature image to be loaded).
if (!TextUtils.isEmpty(app.featureGraphic)) {
featuredImage.loadImageAndDisplay(ImageLoader.getInstance(),
displayImageOptions, app.featureGraphic);
displayImageOptions, app.getFeatureGraphicUrl(activity));
}
}
}