Sort images in my contributions as people would expect them to

This commit is contained in:
YuviPanda 2013-02-02 20:01:39 +05:30
parent 006558ccd3
commit 9724bfd8f5
2 changed files with 10 additions and 2 deletions

View file

@ -13,7 +13,7 @@ import org.wikimedia.commons.Media;
public class Contribution extends Media {
// No need to be bitwise - they're mutually exclusive
public static final int STATE_COMPLETED = 0;
public static final int STATE_COMPLETED = -1;
public static final int STATE_QUEUED = 1;
public static final int STATE_IN_PROGRESS = 2;

View file

@ -112,7 +112,15 @@ public class ContributionsActivity extends AuthenticatedActivity implements Load
};
private String CONTRIBUTION_SELECTION = "";
private String CONTRIBUTION_SORT = Contribution.Table.COLUMN_TIMESTAMP + " DESC";
/*
This sorts in the following order:
Currently Uploading
Queued to Upload (Sorted in ascending order of time added - FIFO)
Completed (Sorted in descending order of time added)
This is why Contribution.STATE_COMPLETED is -1.
*/
private String CONTRIBUTION_SORT = Contribution.Table.COLUMN_STATE + " DESC, (" + Contribution.Table.COLUMN_TIMESTAMP + " * " + Contribution.Table.COLUMN_STATE + ")";
private BroadcastReceiver messageReceiver = new BroadcastReceiver() {
@Override