mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Use same limit for recent cats and cat search
This commit is contained in:
parent
84c2054fb0
commit
6e8e804861
1 changed files with 3 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
|
|
||||||
private ContentProviderClient client;
|
private ContentProviderClient client;
|
||||||
|
|
||||||
private final int RECENT_CATS_LIMIT = 20;
|
private final int SEARCH_CATS_LIMIT = 25;
|
||||||
|
|
||||||
public static class CategoryItem implements Parcelable {
|
public static class CategoryItem implements Parcelable {
|
||||||
public String name;
|
public String name;
|
||||||
|
|
@ -139,7 +139,7 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
new String[]{},
|
new String[]{},
|
||||||
Category.Table.COLUMN_LAST_USED + " DESC");
|
Category.Table.COLUMN_LAST_USED + " DESC");
|
||||||
// fixme add a limit on the original query instead of falling out of the loop?
|
// fixme add a limit on the original query instead of falling out of the loop?
|
||||||
while (cursor.moveToNext() && cursor.getPosition() < RECENT_CATS_LIMIT) {
|
while (cursor.moveToNext() && cursor.getPosition() < SEARCH_CATS_LIMIT) {
|
||||||
Category cat = Category.fromCursor(cursor);
|
Category cat = Category.fromCursor(cursor);
|
||||||
items.add(cat.getName());
|
items.add(cat.getName());
|
||||||
}
|
}
|
||||||
|
|
@ -159,7 +159,7 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
result = api.action("query")
|
result = api.action("query")
|
||||||
.param("list", "allcategories")
|
.param("list", "allcategories")
|
||||||
.param("acprefix", filter)
|
.param("acprefix", filter)
|
||||||
.param("aclimit", 25)
|
.param("aclimit", SEARCH_CATS_LIMIT)
|
||||||
.get();
|
.get();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue