diff options
author | Andrew Lee <anwlee@google.com> | 2014-10-03 15:29:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-03 15:29:15 +0000 |
commit | ec2b8bdde7bc22217d23165117378049ab41247f (patch) | |
tree | 1cc677959c2ac5ce081e52abcf5abbd8e936979c /src | |
parent | 23caeac039d39788a7d152c34524698dac86222c (diff) | |
parent | 99e8adb92ce3dce67a6e3456de37dded27873c5e (diff) |
Merge "Fix RTL issues in Dialer." into lmp-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 32d61a27b..e2ab13025 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -32,6 +32,8 @@ import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.VoicemailContract.Voicemails; import android.telecom.PhoneAccount; import android.telephony.TelephonyManager; +import android.text.BidiFormatter; +import android.text.TextDirectionHeuristics; import android.text.TextUtils; import android.util.Log; import android.view.KeyEvent; @@ -134,6 +136,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe private LinearLayout mVoicemailHeader; private Uri mVoicemailUri; + private BidiFormatter mBidiFormatter = BidiFormatter.getInstance(); /** Whether we should show "edit number before call" in the options menu. */ private boolean mHasEditNumberBeforeCallOption; @@ -425,24 +428,25 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe final CharSequence callLocationOrType = getNumberTypeOrLocation(firstDetails); - final CharSequence displayNumber = - mPhoneNumberHelper.getDisplayNumber( - firstDetails.number, - firstDetails.numberPresentation, - firstDetails.formattedNumber); + final CharSequence displayNumber = mPhoneNumberHelper.getDisplayNumber( + firstDetails.number, + firstDetails.numberPresentation, + firstDetails.formattedNumber); + final String displayNumberStr = mBidiFormatter.unicodeWrap( + displayNumber.toString(), TextDirectionHeuristics.LTR); + if (!TextUtils.isEmpty(firstDetails.name)) { mCallerName.setText(firstDetails.name); - mCallerNumber.setText(callLocationOrType + " " + displayNumber); + mCallerNumber.setText(callLocationOrType + " " + displayNumberStr); } else { - mCallerName.setText(displayNumber); + mCallerName.setText(displayNumberStr); if (!TextUtils.isEmpty(callLocationOrType)) { mCallerNumber.setText(callLocationOrType); mCallerNumber.setVisibility(View.VISIBLE); } else { mCallerNumber.setVisibility(View.GONE); } - } if (!TextUtils.isEmpty(firstDetails.accountLabel)) { |