mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 14:15:14 +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:
@@ -5,12 +5,4 @@ import java.nio.charset.Charset;
|
|||||||
public class StringsHelper {
|
public class StringsHelper {
|
||||||
|
|
||||||
public static final Charset UTF8 = Charset.forName("UTF-8");
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -123,7 +123,7 @@ public class NotificationFilterActivity extends AppCompatActivity {
|
|||||||
apps[i].isEnabled = appDatabase.isEnabled(appInfo.packageName);
|
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);
|
runOnUiThread(this::displayAppList);
|
||||||
}).start();
|
}).start();
|
||||||
|
Reference in New Issue
Block a user