Unverified Commit 268e56f4 authored by Matthew Finkel's avatar Matthew Finkel
Browse files

fixup! Bug 40026: Integrate Security Level settings

Bug 40053: Provide feedback in onboarding Security Level card
parent 460d5891
......@@ -69,9 +69,20 @@ class TorOnboardingSecurityLevelViewHolder(
safestSecurityLevel.onClickListener {
updateSecurityLevel(SecurityLevel.SAFEST)
}
updateSecurityLevel(securityLevel)
}
private fun updateSecurityLevel(newLevel: SecurityLevel) {
val resources = itemView.context.resources
val securityLevel = when (newLevel) {
SecurityLevel.STANDARD -> resources.getString(R.string.tor_security_level_standard_option)
SecurityLevel.SAFER -> resources.getString(R.string.tor_security_level_safer_option)
SecurityLevel.SAFEST -> resources.getString(R.string.tor_security_level_safest_option)
}
itemView.current_level.text = resources.getString(
R.string.tor_onboarding_chosen_security_level_label, securityLevel
)
itemView.context.components.let {
it.core.engine.settings.torSecurityLevel = newLevel.intRepresentation
}
......
......@@ -32,9 +32,18 @@
android:textAppearance="@style/Body14TextStyle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text"
app:layout_constraintTop_toBottomOf="@id/current_level"
tools:text="@string/tor_onboarding_security_level_description" />
<TextView
android:id="@+id/current_level"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text"
tools:text="@string/tor_onboarding_chosen_security_level_label" />
<org.mozilla.fenix.onboarding.OnboardingRadioButton
android:id="@+id/security_level_standard_option"
......
......@@ -20,6 +20,7 @@
<string name="tor_onboarding_security_level">Set your Security Level</string>
<string name="tor_onboarding_security_level_description">Disable certain web features that can be used to attack you, and harm your security, anonymity, and privacy.</string>
<string name="tor_onboarding_chosen_security_level_label">Current Security Level: %s</string>
<string name="tor_onboarding_security_settings_button">Open Security Settings</string>
<string name="tor_onboarding_donate_header">Donate and keep Tor safe</string>
<string name="tor_onboarding_donate_description">Tor is free to use because of donations from people like you.</string>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment