Skip to content

Commit 9640ba2

Browse files
[Fix] Order of platforms
1 parent 50ed8ad commit 9640ba2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ public Channel getChannel() {
262262
}
263263
}
264264

265+
Collections.sort(platformList,comparator);
265266
return null;
266267
}
267268

@@ -300,6 +301,17 @@ private Boolean isPlatform(String path){
300301
}
301302
return false;
302303
}
304+
305+
Comparator<Vector> comparator = new Comparator<Vector>() {
306+
@Override
307+
public int compare(Vector o1, Vector o2) {
308+
String name1 = (String) o1.get(1);
309+
String name2 = (String) o2.get(1);
310+
int version1 = Integer.parseInt(name1.substring(name1.indexOf(" ")+1));
311+
int version2 = Integer.parseInt(name2.substring(name2.indexOf(" ")+1));
312+
return version2 - version1;
313+
}
314+
};
303315
}
304316

305317
class DownloadTask extends SwingWorker<Object, Object> {

0 commit comments

Comments
 (0)