Add content description to escalation card title.
Bug: 30079904 In strings like "We're here for you 24/7", to avoid talkback read 24/7 as 24/7ths, we need to provide a custom content description. Change-Id: If51586d97a376e7a859658d7a6dc48108094ddc2
This commit is contained in:
@@ -7540,6 +7540,11 @@
|
|||||||
<!-- Title text for connecting to 24/7 available customer support [CHAR LIMIT=80]-->
|
<!-- Title text for connecting to 24/7 available customer support [CHAR LIMIT=80]-->
|
||||||
<string name="support_escalation_24_7_title">We\'re here for you 24/7</string>
|
<string name="support_escalation_24_7_title">We\'re here for you 24/7</string>
|
||||||
|
|
||||||
|
<!-- Content description for connecting customer support. The "24 7" part indicates
|
||||||
|
support is available 24 hours a day, 7 days a week. It's used by screenreaders so it
|
||||||
|
cannot contain any symbol other that space. [CHAR LIMIT=80]-->
|
||||||
|
<string name="support_escalation_24_7_content_description">We\'re here for you 24 7</string>
|
||||||
|
|
||||||
<!-- Summary text for connecting to customer support [CHAR LIMIT=NONE]-->
|
<!-- Summary text for connecting to customer support [CHAR LIMIT=NONE]-->
|
||||||
<string name="support_escalation_summary">Our support team is here to help address any issues</string>
|
<string name="support_escalation_summary">Our support team is here to help address any issues</string>
|
||||||
|
|
||||||
|
@@ -219,6 +219,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
|| mSupportFeatureProvider.isAlwaysOperating(CHAT, null /* countryCode */)) {
|
|| mSupportFeatureProvider.isAlwaysOperating(CHAT, null /* countryCode */)) {
|
||||||
// Support is available.
|
// Support is available.
|
||||||
builder.setTileTitle(R.string.support_escalation_24_7_title)
|
builder.setTileTitle(R.string.support_escalation_24_7_title)
|
||||||
|
.setTileTitleDescription(R.string.support_escalation_24_7_content_description)
|
||||||
.setTileSummary(mActivity.getString(R.string.support_escalation_24_7_summary));
|
.setTileSummary(mActivity.getString(R.string.support_escalation_24_7_summary));
|
||||||
} else if (mSupportFeatureProvider.isOperatingNow(PHONE)
|
} else if (mSupportFeatureProvider.isOperatingNow(PHONE)
|
||||||
|| mSupportFeatureProvider.isOperatingNow(CHAT)) {
|
|| mSupportFeatureProvider.isOperatingNow(CHAT)) {
|
||||||
@@ -264,6 +265,9 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
.setTileTitle(isPhoneSupportAlwaysOperating
|
.setTileTitle(isPhoneSupportAlwaysOperating
|
||||||
? R.string.support_escalation_24_7_title
|
? R.string.support_escalation_24_7_title
|
||||||
: R.string.support_escalation_title)
|
: R.string.support_escalation_title)
|
||||||
|
.setTileTitleDescription(isPhoneSupportAlwaysOperating
|
||||||
|
? R.string.support_escalation_24_7_content_description
|
||||||
|
: R.string.support_escalation_title)
|
||||||
.setTileSummary(operatingHours)
|
.setTileSummary(operatingHours)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
@@ -295,6 +299,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
|
|
||||||
private void bindEscalationOptions(ViewHolder holder, EscalationData data) {
|
private void bindEscalationOptions(ViewHolder holder, EscalationData data) {
|
||||||
holder.tileTitleView.setText(data.tileTitle);
|
holder.tileTitleView.setText(data.tileTitle);
|
||||||
|
holder.tileTitleView.setContentDescription(data.tileTitleDescription);
|
||||||
holder.tileSummaryView.setText(data.tileSummary);
|
holder.tileSummaryView.setText(data.tileSummary);
|
||||||
if (data.text1 == 0) {
|
if (data.text1 == 0) {
|
||||||
holder.text1View.setVisibility(View.GONE);
|
holder.text1View.setVisibility(View.GONE);
|
||||||
@@ -327,6 +332,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
private void bindOfflineEscalationOptions(ViewHolder holder, OfflineEscalationData data) {
|
private void bindOfflineEscalationOptions(ViewHolder holder, OfflineEscalationData data) {
|
||||||
// Bind Title
|
// Bind Title
|
||||||
holder.tileTitleView.setText(data.tileTitle);
|
holder.tileTitleView.setText(data.tileTitle);
|
||||||
|
holder.tileTitleView.setContentDescription(data.tileTitleDescription);
|
||||||
holder.tileSummaryView.setText(data.tileSummary);
|
holder.tileSummaryView.setText(data.tileSummary);
|
||||||
// Bind spinner
|
// Bind spinner
|
||||||
final Spinner spinner = (Spinner) holder.itemView.findViewById(R.id.spinner);
|
final Spinner spinner = (Spinner) holder.itemView.findViewById(R.id.spinner);
|
||||||
@@ -361,6 +367,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
|
|
||||||
private void bindSignInPromoTile(ViewHolder holder, EscalationData data) {
|
private void bindSignInPromoTile(ViewHolder holder, EscalationData data) {
|
||||||
holder.tileTitleView.setText(data.tileTitle);
|
holder.tileTitleView.setText(data.tileTitle);
|
||||||
|
holder.tileTitleView.setContentDescription(data.tileTitleDescription);
|
||||||
holder.tileSummaryView.setText(data.tileSummary);
|
holder.tileSummaryView.setText(data.tileSummary);
|
||||||
holder.text1View.setText(data.text1);
|
holder.text1View.setText(data.text1);
|
||||||
holder.text2View.setText(data.text2);
|
holder.text2View.setText(data.text2);
|
||||||
@@ -374,6 +381,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
}
|
}
|
||||||
if (holder.tileTitleView != null) {
|
if (holder.tileTitleView != null) {
|
||||||
holder.tileTitleView.setText(data.tileTitle);
|
holder.tileTitleView.setText(data.tileTitle);
|
||||||
|
holder.tileTitleView.setContentDescription(data.tileTitleDescription);
|
||||||
}
|
}
|
||||||
if (holder.tileSummaryView != null) {
|
if (holder.tileSummaryView != null) {
|
||||||
holder.tileSummaryView.setText(data.tileSummary);
|
holder.tileSummaryView.setText(data.tileSummary);
|
||||||
@@ -511,6 +519,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
final int icon;
|
final int icon;
|
||||||
@StringRes
|
@StringRes
|
||||||
final int tileTitle;
|
final int tileTitle;
|
||||||
|
final CharSequence tileTitleDescription;
|
||||||
final CharSequence tileSummary;
|
final CharSequence tileSummary;
|
||||||
|
|
||||||
|
|
||||||
@@ -518,6 +527,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
this.type = builder.mType;
|
this.type = builder.mType;
|
||||||
this.icon = builder.mIcon;
|
this.icon = builder.mIcon;
|
||||||
this.tileTitle = builder.mTileTitle;
|
this.tileTitle = builder.mTileTitle;
|
||||||
|
this.tileTitleDescription = builder.mTileTitleDescription;
|
||||||
this.tileSummary = builder.mTileSummary;
|
this.tileSummary = builder.mTileSummary;
|
||||||
this.intent = builder.mIntent;
|
this.intent = builder.mIntent;
|
||||||
this.metricsEvent = builder.mMetricsEvent;
|
this.metricsEvent = builder.mMetricsEvent;
|
||||||
@@ -532,6 +542,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
private int mIcon;
|
private int mIcon;
|
||||||
@StringRes
|
@StringRes
|
||||||
private int mTileTitle;
|
private int mTileTitle;
|
||||||
|
private CharSequence mTileTitleDescription;
|
||||||
private CharSequence mTileSummary;
|
private CharSequence mTileSummary;
|
||||||
private Intent mIntent;
|
private Intent mIntent;
|
||||||
private int mMetricsEvent = -1;
|
private int mMetricsEvent = -1;
|
||||||
@@ -551,6 +562,11 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Builder setTileTitleDescription(@StringRes int titleDescription) {
|
||||||
|
mTileTitleDescription = mContext.getString(titleDescription);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
Builder setTileSummary(@StringRes int summary) {
|
Builder setTileSummary(@StringRes int summary) {
|
||||||
mTileSummary = mContext.getString(summary);
|
mTileSummary = mContext.getString(summary);
|
||||||
return this;
|
return this;
|
||||||
|
Reference in New Issue
Block a user