File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
app/src/main/java/fr/free/nrw/commons/contributions Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1+ package fr .free .nrw .commons .contributions ;
2+
3+ import java .util .Comparator ;
4+
5+ public class ContributionComparator implements Comparator <Contribution > {
6+
7+ @ Override
8+ public int compare (Contribution c1 , Contribution c2 ) {
9+ return c1 .dateUploaded .compareTo (c2 .dateUploaded );
10+ }
11+ }
Original file line number Diff line number Diff line change 2121import com .google .android .material .floatingactionbutton .FloatingActionButton ;
2222
2323import java .util .ArrayList ;
24+ import java .util .Collections ;
2425import java .util .List ;
2526
2627import javax .inject .Inject ;
@@ -185,6 +186,8 @@ public void showNoContributionsUI(boolean shouldShow) {
185186 }
186187
187188 public void setContributions (List <Contribution > contributionList ) {
189+ Collections .sort (contributionList , new ContributionComparator ());
190+ Collections .reverse (contributionList );
188191 this .contributions .clear ();
189192 this .contributions .addAll (contributionList );
190193 adapter .setContributions (contributions );
You can’t perform that action at this time.
0 commit comments