summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-10 23:42:31 (GMT)
committerArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-10 23:48:54 (GMT)
commitaac0d8f5db77d5ab81e7073bb37ea554f21ab408 (patch)
tree486c2c3cee0ab8ff2042df0f209740ea5596983c
parent70e60db0360adb5dcd4250c804572c41fa669e9c (diff)
downloadandroid_packages_apps_Trebuchet-aac0d8f5db77d5ab81e7073bb37ea554f21ab408.zip
android_packages_apps_Trebuchet-aac0d8f5db77d5ab81e7073bb37ea554f21ab408.tar.gz
android_packages_apps_Trebuchet-aac0d8f5db77d5ab81e7073bb37ea554f21ab408.tar.bz2
Put apps with uncomputable section names in special bucket
Change-Id: I8ec0a2a9a46c3f45f2c52ac6a4d4d812881c52b7 issue-id: CYNGNOS-2683 (cherry picked from commit 1b2acd74d2cc2e3c7d0face409c6075c16e76755)
-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;