Fix '<b>' did not get bold in HearingDevice footer.
Root Cause: Did not use <![CDATA[ ...]]> to represent it contains html tag <b>. Solution: Use <![CDATA[ and Html.fromHtml to add Spanned for the footer string. Bug: 378806589 Test: Enable bold text to test the effect Flag: EXEMPT bugfix Change-Id: I56827dc18e7183c0458c83dac0dbeca7eb8bb16d
This commit is contained in:
@@ -5671,8 +5671,8 @@
|
||||
<!-- Title for accessibility hearing device page footer. [CHAR LIMIT=40] -->
|
||||
<string name="accessibility_hearing_device_about_title">About hearing devices</string>
|
||||
<!-- Description for text in accessibility hearing aids footer. [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=7451899224828040581] -->
|
||||
<string name="accessibility_hearing_device_footer_summary">To find other hearing devices that aren’t supported by ASHA or LE Audio, tap <b>Pair new device</b> > <b>See more devices</b></string>
|
||||
<!-- Description for text in accessibility hearing aids footer. Replace '>' to 'then' for TTS to announce. [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=7451899224828040581] -->
|
||||
<string name="accessibility_hearing_device_footer_summary"><![CDATA[To find other hearing devices that aren’t supported by ASHA or LE Audio, tap <b>Pair new device</b> > <b>See more devices</b>]]></string>
|
||||
<!-- Content description for text in accessibility hearing aids footer to be announce. Replace '>' to 'then' compare to non tts version. [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=7451899224828040581] -->
|
||||
<string name="accessibility_hearing_device_footer_summary_tts">To find other hearing devices that aren’t supported by ASHA or LE Audio, tap <b>Pair new device</b> then <b>See more devices</b></string>
|
||||
<!-- Title for the pair hearing device page. [CHAR LIMIT=25] -->
|
||||
<string name="accessibility_hearing_device_pairing_page_title">Pair hearing device</string>
|
||||
|
@@ -65,7 +65,6 @@
|
||||
|
||||
<com.android.settings.accessibility.AccessibilityFooterPreference
|
||||
android:key="hearing_device_footer"
|
||||
android:title="@string/accessibility_hearing_device_footer_summary"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"
|
||||
settings:controller="com.android.settings.accessibility.HearingDeviceFooterPreferenceController"/>
|
||||
|
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.accessibility;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
@@ -42,6 +43,13 @@ public class HearingDeviceFooterPreferenceController extends
|
||||
|
||||
final AccessibilityFooterPreference footerPreference =
|
||||
screen.findPreference(getPreferenceKey());
|
||||
// We use html tag inside footer string, so it is better to load from html to have better
|
||||
// html tag support.
|
||||
final CharSequence title = Html.fromHtml(
|
||||
mContext.getString(R.string.accessibility_hearing_device_footer_summary),
|
||||
Html.FROM_HTML_MODE_COMPACT, /* imageGetter= */ null, /* tagHandler= */ null);
|
||||
footerPreference.setTitle(title);
|
||||
|
||||
// Need to update contentDescription string to announce "than" rather than ">"
|
||||
final String summaryTts = mContext.getString(
|
||||
R.string.accessibility_hearing_device_footer_summary_tts);
|
||||
|
Reference in New Issue
Block a user