summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-10 16:42:31 -0700
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:21:58 -0700
commite9d85348fd851e7b6e5ed39a70c9a31b606842ee (patch)
tree510074aa13c3e27fcdd166a1cc684afeeff7b4a1
parent36dd21bb015ee4236c41682f274a67b750eb86a6 (diff)
downloadandroid_packages_apps_Trebuchet-e9d85348fd851e7b6e5ed39a70c9a31b606842ee.zip
android_packages_apps_Trebuchet-e9d85348fd851e7b6e5ed39a70c9a31b606842ee.tar.gz
android_packages_apps_Trebuchet-e9d85348fd851e7b6e5ed39a70c9a31b606842ee.tar.bz2
Put apps with uncomputable section names in special bucket
Change-Id: I8ec0a2a9a46c3f45f2c52ac6a4d4d812881c52b7 issue-id: CYNGNOS-2683
-rw-r--r--src/com/android/launcher3/compat/AlphabeticIndexCompat.java34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
index ec1fb66..c6135e1 100644
--- a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
+++ b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
@@ -117,22 +117,28 @@ public class AlphabeticIndexCompat extends BaseAlphabeticIndex {
public String computeSectionName(CharSequence cs) {
String s = Utilities.trim(cs);
String sectionName = getBucketLabel(getBucketIndex(s));
- if (Utilities.trim(sectionName).isEmpty() && s.length() > 0) {
- int c = s.codePointAt(0);
- boolean startsWithDigit = Character.isDigit(c);
- if (startsWithDigit) {
- // Digit section
- return "#";
- } else {
- boolean startsWithLetter = Character.isLetter(c);
- if (startsWithLetter) {
- return mDefaultMiscLabel;
+ if (Utilities.trim(sectionName).isEmpty()) {
+ if (s.length() > 0) {
+ int c = s.codePointAt(0);
+ boolean startsWithDigit = Character.isDigit(c);
+ if (startsWithDigit) {
+ // Digit section
+ return "#";
} else {
- // In languages where these differ, this ensures that we differentiate
- // between the misc section in the native language and a misc section
- // for everything else.
- return MID_DOT;
+ boolean startsWithLetter = Character.isLetter(c);
+ if (startsWithLetter) {
+ return mDefaultMiscLabel;
+ } else {
+ // In languages where these differ, this ensures that we differentiate
+ // between the misc section in the native language and a misc section
+ // for everything else.
+ return MID_DOT;
+ }
}
+ } else {
+ // Somehow this app's name is all white/java space characters.
+ // Put it in the bucket with all the other crazies.
+ return MID_DOT;
}
}
return sectionName;