mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Show used cats in MRU order
This commit is contained in:
parent
d974630704
commit
29ebce5ab0
2 changed files with 6 additions and 1 deletions
|
|
@ -137,7 +137,7 @@ public class CategorizationFragment extends SherlockFragment{
|
|||
Category.Table.ALL_FIELDS,
|
||||
null,
|
||||
new String[]{},
|
||||
null);
|
||||
Category.Table.COLUMN_LAST_USED + " DESC");
|
||||
while (cursor.moveToNext()) {
|
||||
Category cat = Category.fromCursor(cursor);
|
||||
items.add(cat.getName());
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ public class Category {
|
|||
lastUsed = (Date)lastUsed_.clone();
|
||||
}
|
||||
|
||||
public void touch() {
|
||||
lastUsed = new Date();
|
||||
}
|
||||
|
||||
public int getTimesUsed() {
|
||||
return timesUsed;
|
||||
}
|
||||
|
|
@ -57,6 +61,7 @@ public class Category {
|
|||
|
||||
public void incTimesUsed() {
|
||||
timesUsed++;
|
||||
touch();
|
||||
}
|
||||
|
||||
// Database/content-provider stuff
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue