diff options
author | Andrew Sapperstein <asapperstein@google.com> | 2013-07-01 13:17:18 -0700 |
---|---|---|
committer | Andrew Sapperstein <asapperstein@google.com> | 2013-07-01 13:17:18 -0700 |
commit | 8173cf41d2acf48c7b45ae3e7868fc391aae0359 (patch) | |
tree | 6c1edc3b6cbfda521eeb40b9c354afe572ee7afd | |
parent | 744c43e317053f1f6329e93b38121fd46bcdb2b9 (diff) | |
download | android_packages_apps_UnifiedEmail-8173cf41d2acf48c7b45ae3e7868fc391aae0359.tar.gz android_packages_apps_UnifiedEmail-8173cf41d2acf48c7b45ae3e7868fc391aae0359.tar.bz2 android_packages_apps_UnifiedEmail-8173cf41d2acf48c7b45ae3e7868fc391aae0359.zip |
More bidi notification fixes.
Change-Id: Id0934adf6a41025ad54131de874fc344e5689086
-rw-r--r-- | src/com/android/mail/browse/SendersView.java | 5 | ||||
-rw-r--r-- | src/com/android/mail/utils/NotificationUtils.java | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/mail/browse/SendersView.java b/src/com/android/mail/browse/SendersView.java index 1778ff25e..f69a20c47 100644 --- a/src/com/android/mail/browse/SendersView.java +++ b/src/com/android/mail/browse/SendersView.java @@ -23,6 +23,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.graphics.Typeface; +import android.support.v4.text.BidiFormatter; import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableStringBuilder; @@ -74,6 +75,7 @@ public class SendersView { private static BroadcastReceiver sConfigurationChangedReceiver; private static TextAppearanceSpan sMessageInfoReadStyleSpan; private static TextAppearanceSpan sMessageInfoUnreadStyleSpan; + private static BidiFormatter sBidiFormatter; // We only want to have at most 2 Priority to length maps. This will handle the case where // there is a widget installed on the launcher while the user is scrolling in the app @@ -128,6 +130,7 @@ public class SendersView { sReadStyleSpan = new TextAppearanceSpan(context, R.style.SendersReadTextAppearance); sMessageCountSpacerString = res.getString(R.string.message_count_spacer); sSendingString = res.getString(R.string.sending); + sBidiFormatter = BidiFormatter.getInstance(); } } @@ -303,7 +306,7 @@ public class SendersView { style = !currentMessage.read ? getWrappedStyleSpan(unreadStyleSpan) : getWrappedStyleSpan(readStyleSpan); if (priority <= maxPriorityToInclude) { - spannableDisplay = new SpannableString(nameString); + spannableDisplay = new SpannableString(sBidiFormatter.unicodeWrap(nameString)); // Don't duplicate senders; leave the first instance, unless the // current instance is also unread. int oldPos = displayHash.containsKey(currentMessage.sender) ? displayHash diff --git a/src/com/android/mail/utils/NotificationUtils.java b/src/com/android/mail/utils/NotificationUtils.java index 8b8b0d1f1..6091ecd05 100644 --- a/src/com/android/mail/utils/NotificationUtils.java +++ b/src/com/android/mail/utils/NotificationUtils.java @@ -46,7 +46,6 @@ import com.android.mail.MailIntentService; import com.android.mail.R; import com.android.mail.browse.MessageCursor; import com.android.mail.browse.SendersView; -import com.android.mail.photomanager.ContactPhotoManager; import com.android.mail.photomanager.LetterTileProvider; import com.android.mail.preferences.AccountPreferences; import com.android.mail.preferences.FolderPreferences; @@ -800,7 +799,7 @@ public class NotificationUtils { "configureLatestEventInfoFromConversation"); from = ""; } - sendersBuilder = new SpannableStringBuilder(from); + sendersBuilder = new SpannableStringBuilder(sBidiFormatter.unicodeWrap(from)); } final CharSequence digestLine = getSingleMessageInboxLine(context, sendersBuilder.toString(), @@ -883,6 +882,7 @@ public class NotificationUtils { // For a single new conversation, the ticker is based on the sender's name. notificationTicker = sendersBuilder.toString(); } else { + from = sBidiFormatter.unicodeWrap(from); // The title of a single message the sender. notification.setContentTitle(from); // For a single new conversation, the ticker is based on the sender's name. @@ -1086,8 +1086,9 @@ public class NotificationUtils { final TextAppearanceSpan notificationSecondarySpan = new TextAppearanceSpan(context, R.style.NotificationSecondaryText); + // senders is already individually unicode wrapped so it does not need to be done here final String instantiatedString = String.format(formatString, - sBidiFormatter.unicodeWrap(senders), + senders, sBidiFormatter.unicodeWrap(subjectSnippet)); final SpannableString spannableString = new SpannableString(instantiatedString); |