diff options
Diffstat (limited to 'java/com')
3 files changed, 20 insertions, 7 deletions
diff --git a/java/com/android/dialer/voicemail/settings/VoicemailSettingsFragment.java b/java/com/android/dialer/voicemail/settings/VoicemailSettingsFragment.java index 2e76b70fe..007ab202d 100644 --- a/java/com/android/dialer/voicemail/settings/VoicemailSettingsFragment.java +++ b/java/com/android/dialer/voicemail/settings/VoicemailSettingsFragment.java @@ -75,7 +75,7 @@ public class VoicemailSettingsFragment extends PreferenceFragment // Settings that are supported by dialer only if the carrier configurations are valid. private SwitchPreference visualVoicemailPreference; private SwitchPreference voicemailAutoArchivePreference; - private SwitchPreference transcribeVoicemailPreference; + private SwitchPreferenceWithClickableSummary transcribeVoicemailPreference; // Voicemail transcription analysis toggle private SwitchPreferenceWithClickableSummary donateTranscribedVoicemailPreference; private Preference voicemailChangePinPreference; @@ -148,12 +148,24 @@ public class VoicemailSettingsFragment extends PreferenceFragment transcribeVoicemailPreference.setOnPreferenceChangeListener(this); transcribeVoicemailPreference.setChecked( voicemailClient.isVoicemailTranscriptionEnabled(getContext(), phoneAccountHandle)); - transcribeVoicemailPreference.setSummary( - R.string.voicemail_transcription_preference_summary_info); + transcribeVoicemailPreference.setSummary(getVoicemailTranscriptionInformationalText()); transcribeVoicemailPreference.setEnabled(true); getPreferenceScreen().addPreference(transcribeVoicemailPreference); } + /** + * Builds a spannable string containing the voicemail transcription informational text containing + * the appropriate "Learn More" urls. + * + * @return The voicemail transcription information text. + */ + private CharSequence getVoicemailTranscriptionInformationalText() { + return new ContentWithLearnMoreSpanner(getContext()) + .create( + getContext().getString(R.string.voicemail_transcription_preference_summary_info), + getContext().getString(R.string.transcription_learn_more_url)); + } + private void updateTranscriptionDonationPreference() { if (!VoicemailComponent.get(getContext()) .getVoicemailClient() @@ -231,7 +243,7 @@ public class VoicemailSettingsFragment extends PreferenceFragment voicemailAutoArchivePreference.setOrder(VMSettingOrdering.VOICEMAIL_AUTO_ARCHIVE); transcribeVoicemailPreference = - (SwitchPreference) + (SwitchPreferenceWithClickableSummary) findPreference(getString(R.string.voicemail_visual_voicemail_transcription_key)); transcribeVoicemailPreference.setOrder(VMSettingOrdering.VOICEMAIL_TRANSCRIPTION); diff --git a/java/com/android/dialer/voicemail/settings/res/values/strings.xml b/java/com/android/dialer/voicemail/settings/res/values/strings.xml index 7df8a0192..ad245ee47 100644 --- a/java/com/android/dialer/voicemail/settings/res/values/strings.xml +++ b/java/com/android/dialer/voicemail/settings/res/values/strings.xml @@ -119,7 +119,7 @@ <string name="voicemail_activating_summary_info">Activating voicemail</string> <!-- Summary information for visual voicemail transcription setting [CHAR LIMIT=NONE] --> - <string name="voicemail_transcription_preference_summary_info">Get transcripts of your voicemail using Google\'s transcription service.</string> + <string name="voicemail_transcription_preference_summary_info">Get transcripts of your voicemail using Google\'s transcription service. <xliff:g example="Learn more">%1$s</xliff:g></string> <!-- Summary information for visual voicemail donation setting [CHAR LIMIT=NONE] --> <string name="voicemail_donate_preference_summary_info">Let Google review your voicemail messages to improve transcription accuracy. Your voicemail messages are stored anonymously. <xliff:g example="Learn more">%1$s</xliff:g></string> diff --git a/java/com/android/dialer/voicemail/settings/res/xml/voicemail_settings.xml b/java/com/android/dialer/voicemail/settings/res/xml/voicemail_settings.xml index e5af813b6..fc839ee3e 100644 --- a/java/com/android/dialer/voicemail/settings/res/xml/voicemail_settings.xml +++ b/java/com/android/dialer/voicemail/settings/res/xml/voicemail_settings.xml @@ -31,10 +31,11 @@ android:key="@string/voicemail_visual_voicemail_archive_key" android:title="@string/voicemail_visual_voicemail_auto_archive_switch_title"/>" - <SwitchPreference + <com.android.dialer.common.preference.SwitchPreferenceWithClickableSummary android:dependency="@string/voicemail_visual_voicemail_key" android:key="@string/voicemail_visual_voicemail_transcription_key" - android:title="@string/voicemail_visual_voicemail_transcription_switch_title"/>" + android:title="@string/voicemail_visual_voicemail_transcription_switch_title" + app:urlToOpen="@string/transcription_learn_more_url"/> <com.android.dialer.common.preference.SwitchPreferenceWithClickableSummary android:dependency="@string/voicemail_visual_voicemail_transcription_key" |