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:
@@ -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