1
0
Fork 0

For #658: Adds your rights page link

master
Sawyer Blatz 2019-05-24 11:19:06 -07:00
parent 09588dfda6
commit 36f4b97712
5 changed files with 26 additions and 8 deletions

View File

@ -37,7 +37,7 @@ import org.mozilla.fenix.R.string.pref_key_help
import org.mozilla.fenix.R.string.pref_key_language
import org.mozilla.fenix.R.string.pref_key_leakcanary
import org.mozilla.fenix.R.string.pref_key_make_default_browser
import org.mozilla.fenix.R.string.pref_key_privacy_policy
import org.mozilla.fenix.R.string.pref_key_privacy_notice
import org.mozilla.fenix.R.string.pref_key_rate
import org.mozilla.fenix.R.string.pref_key_remote_debugging
import org.mozilla.fenix.R.string.pref_key_search_engine_settings
@ -45,6 +45,7 @@ import org.mozilla.fenix.R.string.pref_key_sign_in
import org.mozilla.fenix.R.string.pref_key_site_permissions
import org.mozilla.fenix.R.string.pref_key_theme
import org.mozilla.fenix.R.string.pref_key_tracking_protection_settings
import org.mozilla.fenix.R.string.pref_key_your_rights
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
@ -163,12 +164,21 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
resources.getString(pref_key_theme) -> {
navigateToThemeSettings()
}
resources.getString(pref_key_privacy_policy) -> {
resources.getString(pref_key_privacy_notice) -> {
requireContext().apply {
val intent = SupportUtils.createCustomTabIntent(this, SupportUtils.PRIVACY_NOTICE_URL)
startActivity(intent)
}
}
resources.getString(pref_key_your_rights) -> {
requireContext().apply {
val intent = SupportUtils.createCustomTabIntent(
this,
SupportUtils.getSumoURLForTopic(context!!, SupportUtils.SumoTopic.YOUR_RIGHTS)
)
startActivity(intent)
}
}
}
return super.onPreferenceTreeClick(preference)
}

View File

@ -24,7 +24,8 @@ object SupportUtils {
internal val topicStr: String
) {
HELP("firefox-android-help"),
PRIVATE_BROWSING_MYTHS("common-myths-about-private-browsing")
PRIVATE_BROWSING_MYTHS("common-myths-about-private-browsing"),
YOUR_RIGHTS("your-rights")
}
fun getSumoURLForTopic(context: Context, topic: SumoTopic): String {

View File

@ -17,7 +17,8 @@
<string name="pref_key_rate" translatable="false">pref_key_rate</string>
<string name="pref_key_feedback" translatable="false">pref_key_feedback</string>
<string name="pref_key_about" translatable="false">pref_key_about</string>
<string name="pref_key_privacy_policy" translatable="false">pref_key_privacy_policy</string>
<string name="pref_key_privacy_notice" translatable="false">pref_key_privacy_notice</string>
<string name="pref_key_your_rights" translatable="false">pref_key_your_rights</string>
<string name="pref_key_account" translatable="false">pref_key_account</string>
<string name="pref_key_sign_in" translatable="false">pref_key_sign_in</string>
<string name="pref_key_private_mode" translatable="false">pref_key_private_mode</string>

View File

@ -101,8 +101,10 @@
<!-- Preference linking to about page for Fenix
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
<string name="preferences_about">About %1$s</string>
<!-- Preference linking to the privacy policy -->
<string name="preferences_privacy_policy">Privacy Policy</string>
<!-- Preference linking to the privacy notice -->
<string name="preferences_privacy_notice">Privacy Notice</string>
<!-- Preference linking to the your rights SUMO page -->
<string name="preferences_your_rights">Your Rights</string>
<!-- Preference for settings related to saved passwords -->
<string name="preferences_passwords">Passwords</string>
<!-- Preference for settings related to saved credit cards and addresses -->

View File

@ -98,7 +98,11 @@
android:title="@string/preferences_about" />
<androidx.preference.Preference
android:icon="@drawable/ic_info"
android:key="@string/pref_key_privacy_policy"
android:title="@string/preferences_privacy_policy" />
android:key="@string/pref_key_privacy_notice"
android:title="@string/preferences_privacy_notice" />
<androidx.preference.Preference
android:icon="@drawable/ic_info"
android:key="@string/pref_key_your_rights"
android:title="@string/preferences_your_rights" />
</androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen>