From 3b52e43f9b64d40e14743241f70ecc68e0cd0d96 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 23 Oct 2017 14:40:35 +0300 Subject: [PATCH] Fix sorting --- OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index 59f3a88b08..deca6824c4 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -856,7 +856,13 @@ public class GpxUiHelper { if (res != 0) { return res; } - return -i1.getFileName().toLowerCase().compareTo(i2.getFileName().toLowerCase()); + String name1 = i1.getFileName(); + String name2 = i2.getFileName(); + if (name1.length() > 0 && name2.length() > 0 + && Character.isDigit(name1.charAt(0)) && Character.isDigit(name2.charAt(0))) { + return -name1.compareToIgnoreCase(name2); + } + return name1.compareToIgnoreCase(name2); } }); return list;