summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-10-22 08:16:17 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-22 08:17:59 -0700
commitcc0106cd99831ce7d3715e3c85e5b3e6c5c6ca78 (patch)
tree684e363135fb7b35578c832a53f3490711bd315a /packages
parent3c84c9bc7a3ecded5d268f6ec75d8578fd78617a (diff)
parentb9d36649ca458cb5326a144fd88e26b92efba728 (diff)
downloadframeworks_base-cc0106cd99831ce7d3715e3c85e5b3e6c5c6ca78.zip
frameworks_base-cc0106cd99831ce7d3715e3c85e5b3e6c5c6ca78.tar.gz
frameworks_base-cc0106cd99831ce7d3715e3c85e5b3e6c5c6ca78.tar.bz2
Merge "Properly show emoji in the notification ticker." into jb-mr1-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/Ticker.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/Ticker.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/Ticker.java
index 67846a3..ecc70d6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/Ticker.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/Ticker.java
@@ -53,6 +53,16 @@ public abstract class Ticker {
private TextSwitcher mTextSwitcher;
private float mIconScale;
+ public static boolean isGraphicOrEmoji(char c) {
+ int gc = Character.getType(c);
+ return gc != Character.CONTROL
+ && gc != Character.FORMAT
+ && gc != Character.UNASSIGNED
+ && gc != Character.LINE_SEPARATOR
+ && gc != Character.PARAGRAPH_SEPARATOR
+ && gc != Character.SPACE_SEPARATOR;
+ }
+
private final class Segment {
StatusBarNotification notification;
Drawable icon;
@@ -68,7 +78,7 @@ public abstract class Ticker {
}
CharSequence rtrim(CharSequence substr, int start, int end) {
- while (end > start && !TextUtils.isGraphic(substr.charAt(end-1))) {
+ while (end > start && !isGraphicOrEmoji(substr.charAt(end-1))) {
end--;
}
if (end > start) {
@@ -101,7 +111,7 @@ public abstract class Ticker {
this.first = false;
int index = this.next;
final int len = this.text.length();
- while (index < len && !TextUtils.isGraphic(this.text.charAt(index))) {
+ while (index < len && !isGraphicOrEmoji(this.text.charAt(index))) {
index++;
}
if (index >= len) {
@@ -136,7 +146,7 @@ public abstract class Ticker {
this.text = text;
int index = 0;
final int len = text.length();
- while (index < len && !TextUtils.isGraphic(text.charAt(index))) {
+ while (index < len && !isGraphicOrEmoji(text.charAt(index))) {
index++;
}
this.current = index;
@@ -194,7 +204,8 @@ public abstract class Ticker {
final Drawable icon = StatusBarIconView.getIcon(mContext,
new StatusBarIcon(n.pkg, n.user, n.notification.icon, n.notification.iconLevel, 0,
n.notification.tickerText));
- final Segment newSegment = new Segment(n, icon, n.notification.tickerText);
+ final CharSequence text = n.notification.tickerText;
+ final Segment newSegment = new Segment(n, icon, text);
// If there's already a notification schedule for this package and id, remove it.
for (int i=0; i<mSegments.size(); i++) {