From 3b9f84111733a5893d4e12d95809c66736c5353a Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Wed, 5 Apr 2017 12:24:56 +1000 Subject: [PATCH] Try to always show something in "Latest" It seems pointless to only restrict "Latest" to items within the last X days. When you only have the GP repo enabled, or other repos with less apps that are updated less frequently than the main repo, this screen always ends up empty. This change shows the last 200 updated items instead of those updated in the last X days. --- .../java/org/fdroid/fdroid/data/AppProvider.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/data/AppProvider.java b/app/src/main/java/org/fdroid/fdroid/data/AppProvider.java index d79405c79..390b23a54 100644 --- a/app/src/main/java/org/fdroid/fdroid/data/AppProvider.java +++ b/app/src/main/java/org/fdroid/fdroid/data/AppProvider.java @@ -631,12 +631,6 @@ public class AppProvider extends FDroidProvider { return new AppQuerySelection(selection, args); } - private AppQuerySelection queryRecentlyUpdated() { - final String selection = getTableName() + "." + Cols.LAST_UPDATED + " > ? "; - final String[] args = {Utils.formatDate(Preferences.get().calcMaxHistory(), "")}; - return new AppQuerySelection(selection, args); - } - private AppQuerySelection queryCategory(String category) { if (TextUtils.isEmpty(category)) { return new AppQuerySelection(); @@ -741,7 +735,12 @@ public class AppProvider extends FDroidProvider { String lastUpdated = table + "." + Cols.LAST_UPDATED + " DESC"; sortOrder = lastUpdated + ", " + isNew; - selection = selection.add(queryRecentlyUpdated()); + // 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. + // 200 is an arbitrary number which hopefully gives the user enough to scroll through + // if they are bored. + limit = 200; + includeSwap = false; break;