summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/compat/AlphabeticIndexCompat.java')
-rw-r--r--src/com/android/launcher3/compat/AlphabeticIndexCompat.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
index f890706ff..18cdc81f3 100644
--- a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
+++ b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java
@@ -1,6 +1,7 @@
package com.android.launcher3.compat;
import android.content.Context;
+import com.android.launcher3.Utilities;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
@@ -102,10 +103,11 @@ public class AlphabeticIndexCompat extends BaseAlphabeticIndex {
/**
* Computes the section name for an given string {@param s}.
*/
- public String computeSectionName(String s) {
+ public String computeSectionName(CharSequence cs) {
+ String s = Utilities.trim(cs);
String sectionName = getBucketLabel(getBucketIndex(s));
- if (sectionName.trim().isEmpty() && s.length() > 0) {
- boolean startsWithDigit = Character.isDigit(Character.codePointAt(s.trim(), 0));
+ if (Utilities.trim(sectionName).isEmpty() && s.length() > 0) {
+ boolean startsWithDigit = Character.isDigit(s.codePointAt(0));
if (startsWithDigit) {
// Digit section
return "#";