summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/widget
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-05-31 20:59:05 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-01 18:19:51 -0700
commitf85644637b808d6a88886e462c1f8fd5f53a6f2f (patch)
tree6ed1c44ef3a167b27693831b00037db65b8f056c /java/com/android/dialer/widget
parentf0d515573aa65c265ccb104ca982a5ccfbd0fa24 (diff)
Solve BiDi problem when phone number is concatenated with RTL-string
Solves BiDi problem that might cause phone number to be displayed incorrectly in the dialer. Issue might occur when a phone number is concatenated with a custom number label containing an RTL-string. Solved by changing affected labels from TextView to BidiTextView. Removed function spanDisplayNumber in BottomRow which are now obsolete. Updates the DialerBidiFormatter to prevent whitespace to be misplaced within a BidiTextView. BUG=78464687 TEST=Manual Public-Origin-Change-Id: I789a6f76a5ca805c03a437813ce627eef7a0bf2e Signed-off-by: Linyu He <linyuh@google.com> Author: Torbjorn Eklund <torbjorn.eklund@sony.com> Bug: 78464687 Test: Manual PiperOrigin-RevId: 198823629 Change-Id: Id35c3ebf514609b4a1fe10a7ae5a297bde7c7456
Diffstat (limited to 'java/com/android/dialer/widget')
-rw-r--r--java/com/android/dialer/widget/DialerToolbar.java4
-rwxr-xr-x[-rw-r--r--]java/com/android/dialer/widget/res/layout/dialer_toolbar.xml2
2 files changed, 3 insertions, 3 deletions
diff --git a/java/com/android/dialer/widget/DialerToolbar.java b/java/com/android/dialer/widget/DialerToolbar.java
index 02ec8c02c..40dabe8bc 100644
--- a/java/com/android/dialer/widget/DialerToolbar.java
+++ b/java/com/android/dialer/widget/DialerToolbar.java
@@ -29,13 +29,13 @@ import com.android.dialer.theme.base.ThemeComponent;
public class DialerToolbar extends Toolbar {
private final TextView title;
- private final TextView subtitle;
+ private final BidiTextView subtitle;
public DialerToolbar(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
inflate(context, R.layout.dialer_toolbar, this);
title = (TextView) findViewById(R.id.title);
- subtitle = (TextView) findViewById(R.id.subtitle);
+ subtitle = (BidiTextView) findViewById(R.id.subtitle);
setElevation(getResources().getDimensionPixelSize(R.dimen.toolbar_elevation));
setBackgroundColor(ThemeComponent.get(context).theme().getColorPrimary());
diff --git a/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml b/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml
index a75176a22..3b4d1367e 100644..100755
--- a/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml
+++ b/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml
@@ -31,7 +31,7 @@
android:textColor="?android:attr/textColorPrimaryInverse"
style="@style/Dialer.TextAppearance.Header2"/>
- <TextView
+ <com.android.dialer.widget.BidiTextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"