From 3ab1b3b3d91e964b486e851401cccb4f473effd8 Mon Sep 17 00:00:00 2001 From: Arturo Mejia Date: Thu, 28 Mar 2019 11:53:50 -0400 Subject: [PATCH] Closes #1229: Excluding site permission strings from L10n. --- .../fenix/settings/RadioButtonPreference.kt | 9 +++- .../values/permissions_settings_strings.xml | 50 +++++++++++++++++++ app/src/main/res/values/strings.xml | 49 ------------------ 3 files changed, 57 insertions(+), 51 deletions(-) create mode 100644 app/src/main/res/values/permissions_settings_strings.xml diff --git a/app/src/main/java/org/mozilla/fenix/settings/RadioButtonPreference.kt b/app/src/main/java/org/mozilla/fenix/settings/RadioButtonPreference.kt index 21141a0ab..3ec9400c8 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/RadioButtonPreference.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/RadioButtonPreference.kt @@ -11,6 +11,7 @@ import android.content.Context import android.text.TextUtils import android.util.AttributeSet import android.widget.RadioButton +import androidx.core.text.HtmlCompat import androidx.preference.Preference import org.mozilla.fenix.R @@ -18,7 +19,7 @@ class RadioButtonPreference : Preference { private val radioGroups = mutableListOf() private lateinit var summaryView: TextView private lateinit var radioButton: RadioButton - + var shouldSummaryBeParsedAsHtmlContent: Boolean = true private var clickListener: (() -> Unit)? = null init { @@ -86,7 +87,11 @@ class RadioButtonPreference : Preference { private fun bindSummaryView(holder: PreferenceViewHolder) { summaryView = holder.findViewById(R.id.widget_summary) as TextView if (!TextUtils.isEmpty(summary)) { - summaryView.text = summary + if (shouldSummaryBeParsedAsHtmlContent) { + summaryView.text = HtmlCompat.fromHtml(summary.toString(), HtmlCompat.FROM_HTML_MODE_COMPACT) + } else { + summaryView.text = summary + } summaryView.visibility = View.VISIBLE } else { summaryView.visibility = View.GONE diff --git a/app/src/main/res/values/permissions_settings_strings.xml b/app/src/main/res/values/permissions_settings_strings.xml new file mode 100644 index 000000000..053ba3ab9 --- /dev/null +++ b/app/src/main/res/values/permissions_settings_strings.xml @@ -0,0 +1,50 @@ + + + + + + Optimize + + Lower image quality, throttle streaming bandwidth, and platform-level optimizations + + Exceptions + + Use recommended settings + + Blocked + +
Ads, autoplay sound and video (block playing media with sound), cookies (block third-party trackers cookies), trackers (allow some trackers), pop-up, website redirects.

Ask to allow + +
Camera, location, microphone and notification.

Allowed + +
DRM audio and video, JavaScript, cache and site data, images.]]>
+ + Use custom settings + + Phone Feature + + Camera + + Microphone + + Location + + Notification + + Ask to allow + + Block + + Blocked by Android + +
1. Go to Android Settings

2. Tap Permissions

3. Toggle %1$s to ON + ]]>
+ + Recommended + + Go to Settings +
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d84d40d8e..6ac6f40c4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -134,55 +134,6 @@ Account settings - - - Optimize - - Lower image quality, throttle streaming bandwidth, and platform-level - optimizations - - - Exceptions - - Use recommended settings - - - Blocked - - \n Ads, autoplay sound and video (block playing media with sound), cookies (block third-party trackers cookies), - trackers (allow some trackers), pop-up, website redirects. \n\n - Ask to allow - - \n Camera, location, microphone and notification. \n\n - Allowed - - \n DRM audio and video, JavaScript, cache and site data, images. - - - Use custom settings - - Phone Feature - - Camera - - Microphone - - Location - - Notification - - Ask to allow - - Block - - Blocked by Android - - To allow it: <br/><br/> 1. Go to Android Settings <br/><br/>2. Tap <b>Permissions</b> <br/><br/> 3. Toggle <b>%1$s</b> to ON - - Recommended - - Go to Settings - Sync now