2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 05:37:43 +00:00

Drop custom string compare

Test Plan: Notification app list is still sorted

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17779
This commit is contained in:
Nicolas Fella 2018-12-24 18:03:26 +01:00
parent e54c0a2ffa
commit 03b5c769bd
2 changed files with 1 additions and 9 deletions

View File

@ -5,12 +5,4 @@ import java.nio.charset.Charset;
public class StringsHelper {
public static final Charset UTF8 = Charset.forName("UTF-8");
public static int compare(String a, String b) {
if (a == b) return 0;
if (a == null) return -1;
if (b == null) return 1;
return a.compareToIgnoreCase(b);
}
}

View File

@ -123,7 +123,7 @@ public class NotificationFilterActivity extends AppCompatActivity {
apps[i].isEnabled = appDatabase.isEnabled(appInfo.packageName);
}
Arrays.sort(apps, (lhs, rhs) -> StringsHelper.compare(lhs.name, rhs.name));
Arrays.sort(apps, (lhs, rhs) -> lhs.name.compareToIgnoreCase(rhs.name));
runOnUiThread(this::displayAppList);
}).start();