diff options
author | Artem Shvadskiy <ashvadskiy@cyngn.com> | 2016-05-10 16:42:31 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-10 16:48:33 -0700 |
commit | 1b2acd74d2cc2e3c7d0face409c6075c16e76755 (patch) | |
tree | 03dc5de3b3e7a1aeb6a392d262f69fd1cb688de9 /src | |
parent | 499902463bb16aad036a57b9e02b34cb74548acf (diff) | |
download | android_packages_apps_Trebuchet-1b2acd74d2cc2e3c7d0face409c6075c16e76755.tar.gz android_packages_apps_Trebuchet-1b2acd74d2cc2e3c7d0face409c6075c16e76755.tar.bz2 android_packages_apps_Trebuchet-1b2acd74d2cc2e3c7d0face409c6075c16e76755.zip |
Put apps with uncomputable section names in special bucket
Change-Id: I8ec0a2a9a46c3f45f2c52ac6a4d4d812881c52b7
issue-id: CYNGNOS-2683
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/compat/AlphabeticIndexCompat.java | 34 |
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 ec1fb669f..c6135e19b 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; |