diff options
author | Ihab Awad <ihab@google.com> | 2014-12-15 18:18:05 -0800 |
---|---|---|
committer | Ihab Awad <ihab@google.com> | 2014-12-16 11:46:33 -0800 |
commit | 27e3da1300a212d8d936fc2293a7ac0119eff3a8 (patch) | |
tree | 58805df22933de0da23c3d626a81866591d7124e | |
parent | f5ca18ec40748d4a73fd987ac526a9c40ccb0f77 (diff) |
Add phone number annotations for TalkBack
Bug: 18759212
Change-Id: I2850941e0f007320aa06c34f5c8e550e672e15dd
3 files changed, 12 insertions, 5 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 9d11b4cfc..54766272d 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -48,6 +48,7 @@ import android.widget.ImageView; import android.widget.TextView; import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette; import com.android.contacts.common.widget.FloatingActionButtonController; +import com.android.incallui.service.PhoneNumberService; import com.android.phone.common.animation.AnimUtils; import java.util.List; @@ -373,7 +374,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr if (TextUtils.isEmpty(name)) { mPrimaryName.setText(null); } else { - mPrimaryName.setText(name); + mPrimaryName.setText(nameIsNumber + ? PhoneNumberUtils.ttsSpanAsPhoneNumber(name) + : name); // Set direction of the name field int nameDirection = View.TEXT_DIRECTION_INHERIT; @@ -398,7 +401,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mPhoneNumber.setText(null); mPhoneNumber.setVisibility(View.GONE); } else { - mPhoneNumber.setText(number); + mPhoneNumber.setText(PhoneNumberUtils.ttsSpanAsPhoneNumber(number)); mPhoneNumber.setVisibility(View.VISIBLE); mPhoneNumber.setTextDirection(View.TEXT_DIRECTION_LTR); } @@ -455,7 +458,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mSecondaryCallConferenceCallIcon.setVisibility(isConference ? View.VISIBLE : View.GONE); - mSecondaryCallName.setText(name); + mSecondaryCallName.setText(nameIsNumber + ? PhoneNumberUtils.ttsSpanAsPhoneNumber(name) + : name); if (hasProvider) { mSecondaryCallProviderLabel.setText(providerLabel); } diff --git a/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java b/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java index 0d5977210..7825dc1ad 100644 --- a/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java +++ b/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java @@ -18,6 +18,7 @@ package com.android.incallui; import android.content.Context; import android.net.Uri; +import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -417,7 +418,7 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { numberTypeTextView.setVisibility(View.GONE); } else { numberTextView.setVisibility(View.VISIBLE); - numberTextView.setText(callerNumber); + numberTextView.setText(PhoneNumberUtils.ttsSpanAsPhoneNumber(callerNumber)); numberTypeTextView.setVisibility(View.VISIBLE); numberTypeTextView.setText(callerNumberType); } diff --git a/InCallUI/src/com/android/incallui/DialpadFragment.java b/InCallUI/src/com/android/incallui/DialpadFragment.java index 63f6379fc..da3f0cb74 100644 --- a/InCallUI/src/com/android/incallui/DialpadFragment.java +++ b/InCallUI/src/com/android/incallui/DialpadFragment.java @@ -20,6 +20,7 @@ import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Looper; +import android.telephony.PhoneNumberUtils; import android.text.Editable; import android.text.method.DialerKeyListener; import android.util.AttributeSet; @@ -513,7 +514,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese * @param text Text to set Dialpad EditText to. */ public void setDtmfText(String text) { - mDtmfDialerField.setText(text); + mDtmfDialerField.setText(PhoneNumberUtils.ttsSpanAsPhoneNumber(text)); } @Override |