For #15372 Optimize the order and messages of onboarding cards

upstream-sync
Arturo Mejia 3 years ago
parent 246c192de3
commit 869c99afaa

@ -35,6 +35,7 @@ import org.mozilla.fenix.ui.robots.enhancedTrackingProtection
import org.mozilla.fenix.ui.robots.homeScreen import org.mozilla.fenix.ui.robots.homeScreen
import org.mozilla.fenix.ui.robots.navigationToolbar import org.mozilla.fenix.ui.robots.navigationToolbar
import org.mozilla.fenix.ui.robots.tabDrawer import org.mozilla.fenix.ui.robots.tabDrawer
import org.mozilla.fenix.ui.util.STRING_ONBOARDING_TRACKING_PROTECTION_HEADER
/** /**
* Test Suite that contains tests defined as part of the Smoke and Sanity check defined in Test rail. * Test Suite that contains tests defined as part of the Smoke and Sanity check defined in Test rail.
@ -125,13 +126,9 @@ class SmokeTest {
verifyStartSyncHeader() verifyStartSyncHeader()
verifyAccountsSignInButton() verifyAccountsSignInButton()
// Intro to other sections // Always-on privacy
verifyGetToKnowHeader() scrollToElementByText(STRING_ONBOARDING_TRACKING_PROTECTION_HEADER)
// Automatic privacy
scrollToElementByText("Automatic privacy")
verifyAutomaticPrivacyHeader() verifyAutomaticPrivacyHeader()
verifyTrackingProtectionToggle()
verifyAutomaticPrivacyText() verifyAutomaticPrivacyText()
// Choose your theme // Choose your theme
@ -142,11 +139,7 @@ class SmokeTest {
verifyLightThemeDescription() verifyLightThemeDescription()
verifyLightThemeToggle() verifyLightThemeToggle()
// Browse privately // Pick your toolbar placement
verifyBrowsePrivatelyHeader()
verifyBrowsePrivatelyText()
// Take a position
verifyTakePositionHeader() verifyTakePositionHeader()
verifyTakePositionElements() verifyTakePositionElements()
@ -161,6 +154,7 @@ class SmokeTest {
} }
@Test @Test
@Ignore("https://github.com/mozilla-mobile/fenix/issues/18603")
// Verifies the functionality of the onboarding Start Browsing button // Verifies the functionality of the onboarding Start Browsing button
fun startBrowsingButtonTest() { fun startBrowsingButtonTest() {
homeScreen { homeScreen {

@ -54,6 +54,9 @@ import org.mozilla.fenix.helpers.click
import org.mozilla.fenix.helpers.ext.waitNotNull import org.mozilla.fenix.helpers.ext.waitNotNull
import org.mozilla.fenix.helpers.matchers.hasItem import org.mozilla.fenix.helpers.matchers.hasItem
import org.mozilla.fenix.helpers.withBitmapDrawable import org.mozilla.fenix.helpers.withBitmapDrawable
import org.mozilla.fenix.ui.util.STRING_ONBOARDING_ACCOUNT_SIGN_IN_HEADER
import org.mozilla.fenix.ui.util.STRING_ONBOARDING_TOOLBAR_PLACEMENT_HEADER
import org.mozilla.fenix.ui.util.STRING_ONBOARDING_TRACKING_PROTECTION_HEADER
/** /**
* Implementation of Robot Pattern for the home screen menu. * Implementation of Robot Pattern for the home screen menu.
@ -85,7 +88,6 @@ class HomeScreenRobot {
fun verifyStartSyncHeader() = assertStartSyncHeader() fun verifyStartSyncHeader() = assertStartSyncHeader()
fun verifyAccountsSignInButton() = assertAccountsSignInButton() fun verifyAccountsSignInButton() = assertAccountsSignInButton()
fun verifyGetToKnowHeader() = assertGetToKnowHeader()
fun verifyChooseThemeHeader() = assertChooseThemeHeader() fun verifyChooseThemeHeader() = assertChooseThemeHeader()
fun verifyChooseThemeText() = assertChooseThemeText() fun verifyChooseThemeText() = assertChooseThemeText()
fun verifyLightThemeToggle() = assertLightThemeToggle() fun verifyLightThemeToggle() = assertLightThemeToggle()
@ -95,18 +97,13 @@ class HomeScreenRobot {
fun verifyAutomaticThemeToggle() = assertAutomaticThemeToggle() fun verifyAutomaticThemeToggle() = assertAutomaticThemeToggle()
fun verifyAutomaticThemeDescription() = assertAutomaticThemeDescription() fun verifyAutomaticThemeDescription() = assertAutomaticThemeDescription()
fun verifyAutomaticPrivacyHeader() = assertAutomaticPrivacyHeader() fun verifyAutomaticPrivacyHeader() = assertAutomaticPrivacyHeader()
fun verifyTrackingProtectionToggle() = assertTrackingProtectionToggle() fun verifyAutomaticPrivacyText() = assertAlwaysPrivacyText()
fun verifyAutomaticPrivacyText() = assertAutomaticPrivacyText()
// Browse privately // Pick your toolbar placement
fun verifyBrowsePrivatelyHeader() = assertBrowsePrivatelyHeader() fun verifyTakePositionHeader() = assertTakePlacementHeader()
fun verifyBrowsePrivatelyText() = assertBrowsePrivatelyText()
// Take a position
fun verifyTakePositionHeader() = assertTakePositionheader()
fun verifyTakePositionElements() { fun verifyTakePositionElements() {
assertTakePositionBottomRadioButton() assertTakePlacementBottomRadioButton()
assertTakePositionTopRadioButton() assertTakePacementTopRadioButton()
} }
// Your privacy // Your privacy
@ -549,18 +546,15 @@ private fun assertWelcomeHeader() =
onView(allOf(withText("Welcome to ${appContext.appName}!"))) onView(allOf(withText("Welcome to ${appContext.appName}!")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertStartSyncHeader() = private fun assertStartSyncHeader() {
onView(allOf(withText("Start syncing bookmarks, passwords, and more with your Firefox account."))) scrollToElementByText(STRING_ONBOARDING_ACCOUNT_SIGN_IN_HEADER)
onView(allOf(withText(R.string.onboarding_account_sign_in_header_1)))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
}
private fun assertAccountsSignInButton() = private fun assertAccountsSignInButton() =
onView(ViewMatchers.withResourceName("fxa_sign_in_button")) onView(ViewMatchers.withResourceName("fxa_sign_in_button"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertGetToKnowHeader() =
onView(allOf(withText("Get to know ${appContext.appName}")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun assertChooseThemeHeader() { private fun assertChooseThemeHeader() {
scrollToElementByText("Choose your theme") scrollToElementByText("Choose your theme")
onView(withText("Choose your theme")) onView(withText("Choose your theme"))
@ -568,7 +562,7 @@ private fun assertChooseThemeHeader() {
} }
private fun assertChooseThemeText() { private fun assertChooseThemeText() {
scrollToElementByText("Choose your theme") scrollToElementByText("Choose your theme")
onView(allOf(withText("Save some battery and your eyesight by enabling dark mode."))) onView(allOf(withText("Save some battery and your eyesight with dark mode.")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
@ -608,40 +602,23 @@ private fun assertAutomaticThemeDescription() {
} }
private fun assertAutomaticPrivacyHeader() { private fun assertAutomaticPrivacyHeader() {
scrollToElementByText("Automatic privacy") scrollToElementByText(STRING_ONBOARDING_TRACKING_PROTECTION_HEADER)
onView(allOf(withText("Automatic privacy"))) onView(allOf(withText(STRING_ONBOARDING_TRACKING_PROTECTION_HEADER)))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertTrackingProtectionToggle() { private fun assertAlwaysPrivacyText() {
scrollToElementByText("Automatic privacy") scrollToElementByText(STRING_ONBOARDING_TRACKING_PROTECTION_HEADER)
onView(withId(R.id.tracking_protection_toggle))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
}
private fun assertAutomaticPrivacyText() {
scrollToElementByText("Automatic privacy")
onView( onView(
allOf( allOf(
withText( withText(
"Privacy and security settings block trackers, malware, and companies that follow you." R.string.onboarding_tracking_protection_description_3
) )
) )
) )
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertBrowsePrivatelyHeader() {
scrollToElementByText("Browse privately")
onView(allOf(withText("Browse privately")))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
}
private fun assertBrowsePrivatelyText() {
scrollToElementByText("Browse privately")
onView(allOf(withText(containsString("Update your private browsing settings."))))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
}
private fun assertYourPrivacyHeader() { private fun assertYourPrivacyHeader() {
scrollToElementByText("Your privacy") scrollToElementByText("Your privacy")
onView(allOf(withText("Your privacy"))) onView(allOf(withText("Your privacy")))
@ -672,21 +649,21 @@ private fun assertStartBrowsingButton() {
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
// Take a position // Pick your toolbar placement
private fun assertTakePositionheader() { private fun assertTakePlacementHeader() {
scrollToElementByText("Take a position") scrollToElementByText(STRING_ONBOARDING_TOOLBAR_PLACEMENT_HEADER)
onView(allOf(withText("Take a position"))) onView(allOf(withText(STRING_ONBOARDING_TOOLBAR_PLACEMENT_HEADER)))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertTakePositionTopRadioButton() { private fun assertTakePacementTopRadioButton() {
scrollToElementByText("Take a position") scrollToElementByText(STRING_ONBOARDING_TOOLBAR_PLACEMENT_HEADER)
onView(ViewMatchers.withResourceName("toolbar_top_radio_button")) onView(ViewMatchers.withResourceName("toolbar_top_radio_button"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }
private fun assertTakePositionBottomRadioButton() { private fun assertTakePlacementBottomRadioButton() {
scrollToElementByText("Take a position") scrollToElementByText(STRING_ONBOARDING_TOOLBAR_PLACEMENT_HEADER)
onView(ViewMatchers.withResourceName("toolbar_bottom_radio_button")) onView(ViewMatchers.withResourceName("toolbar_bottom_radio_button"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
} }

@ -143,16 +143,13 @@ private fun assertEnhancedTrackingProtectionOptions() {
onView(withText("Standard (default)")) onView(withText("Standard (default)"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
val stdText = "Blocks fewer trackers. Pages will load normally." onView(withText(org.mozilla.fenix.R.string.preference_enhanced_tracking_protection_standard_description_4))
onView(withText(stdText))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
onView(withText("Strict")) onView(withText("Strict"))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
val strictText = onView(withText(org.mozilla.fenix.R.string.preference_enhanced_tracking_protection_strict_description_3))
"Blocks more trackers, ads, and popups. Pages load faster, but some functionality might not work."
onView(withText(strictText))
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
onView(withText("Custom")) onView(withText("Custom"))
@ -168,16 +165,13 @@ private fun assertEnhancedTrackingProtectionOptionsGrayedOut() {
onView(withText("Standard (default)")) onView(withText("Standard (default)"))
.check(matches(not(isEnabled(true)))) .check(matches(not(isEnabled(true))))
val stdText = "Blocks fewer trackers. Pages will load normally." onView(withText(org.mozilla.fenix.R.string.preference_enhanced_tracking_protection_standard_description_4))
onView(withText(stdText))
.check(matches(not(isEnabled(true)))) .check(matches(not(isEnabled(true))))
onView(withText("Strict")) onView(withText("Strict"))
.check(matches(not(isEnabled(true)))) .check(matches(not(isEnabled(true))))
val strictText = onView(withText(org.mozilla.fenix.R.string.preference_enhanced_tracking_protection_strict_description_3))
"Blocks more trackers, ads, and popups. Pages load faster, but some functionality might not work."
onView(withText(strictText))
.check(matches(not(isEnabled(true)))) .check(matches(not(isEnabled(true))))
onView(withText("Custom")) onView(withText("Custom"))

@ -0,0 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.ui.util
const val STRING_ONBOARDING_ACCOUNT_SIGN_IN_HEADER = "Sync Firefox between devices"
const val STRING_ONBOARDING_TRACKING_PROTECTION_HEADER = "Always-on privacy"
const val STRING_ONBOARDING_TOOLBAR_PLACEMENT_HEADER = "Pick your toolbar placement"

@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.extensions.LayoutContainer import kotlinx.android.extensions.LayoutContainer
import mozilla.components.feature.tab.collections.TabCollection import mozilla.components.feature.tab.collections.TabCollection
import mozilla.components.feature.top.sites.TopSite import mozilla.components.feature.top.sites.TopSite
import org.mozilla.fenix.R
import org.mozilla.fenix.components.tips.Tip import org.mozilla.fenix.components.tips.Tip
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
import org.mozilla.fenix.home.HomeFragmentState import org.mozilla.fenix.home.HomeFragmentState
@ -71,6 +70,13 @@ private fun privateModeAdapterItems() = listOf(AdapterItem.PrivateBrowsingDescri
private fun onboardingAdapterItems(onboardingState: OnboardingState): List<AdapterItem> { private fun onboardingAdapterItems(onboardingState: OnboardingState): List<AdapterItem> {
val items: MutableList<AdapterItem> = mutableListOf(AdapterItem.OnboardingHeader) val items: MutableList<AdapterItem> = mutableListOf(AdapterItem.OnboardingHeader)
items.addAll(
listOf(
AdapterItem.OnboardingThemePicker,
AdapterItem.OnboardingToolbarPositionPicker,
AdapterItem.OnboardingTrackingProtection
)
)
// Customize FxA items based on where we are with the account state: // Customize FxA items based on where we are with the account state:
items.addAll( items.addAll(
when (onboardingState) { when (onboardingState) {
@ -90,14 +96,6 @@ private fun onboardingAdapterItems(onboardingState: OnboardingState): List<Adapt
items.addAll( items.addAll(
listOf( listOf(
AdapterItem.OnboardingSectionHeader {
val appName = it.getString(R.string.app_name)
it.getString(R.string.onboarding_feature_section_header, appName)
},
AdapterItem.OnboardingTrackingProtection,
AdapterItem.OnboardingThemePicker,
AdapterItem.OnboardingPrivateBrowsing,
AdapterItem.OnboardingToolbarPositionPicker,
AdapterItem.OnboardingPrivacyNotice, AdapterItem.OnboardingPrivacyNotice,
AdapterItem.OnboardingFinish AdapterItem.OnboardingFinish
) )

@ -10,35 +10,25 @@ import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.onboarding_manual_signin.view.* import kotlinx.android.synthetic.main.onboarding_manual_signin.view.*
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.addUnderline
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
import org.mozilla.fenix.home.HomeFragmentDirections import org.mozilla.fenix.home.HomeFragmentDirections
import org.mozilla.fenix.onboarding.OnboardingController
import org.mozilla.fenix.onboarding.OnboardingInteractor
class OnboardingManualSignInViewHolder(view: View) : RecyclerView.ViewHolder(view) { class OnboardingManualSignInViewHolder(view: View) : RecyclerView.ViewHolder(view) {
private val headerText = view.header_text private val headerText = view.header_text
init { init {
val interactor = OnboardingInteractor(OnboardingController(itemView.context))
view.fxa_sign_in_button.setOnClickListener { view.fxa_sign_in_button.setOnClickListener {
it.context.components.analytics.metrics.track(Event.OnboardingManualSignIn) it.context.components.analytics.metrics.track(Event.OnboardingManualSignIn)
val directions = HomeFragmentDirections.actionGlobalTurnOnSync() val directions = HomeFragmentDirections.actionGlobalTurnOnSync()
Navigation.findNavController(view).navigate(directions) Navigation.findNavController(view).navigate(directions)
} }
view.learn_more.addUnderline()
view.learn_more.setOnClickListener {
interactor.onLearnMoreClicked()
}
} }
fun bind() { fun bind() {
val context = itemView.context val context = itemView.context
headerText.text = context.getString(R.string.onboarding_account_sign_in_header) headerText.text = context.getString(R.string.onboarding_account_sign_in_header_1)
} }
companion object { companion object {

@ -5,7 +5,6 @@
package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding package org.mozilla.fenix.home.sessioncontrol.viewholders.onboarding
import android.view.View import android.view.View
import androidx.appcompat.widget.SwitchCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.* import kotlinx.android.synthetic.main.onboarding_tracking_protection.view.*
import org.mozilla.fenix.R import org.mozilla.fenix.R
@ -20,29 +19,20 @@ class OnboardingTrackingProtectionViewHolder(view: View) : RecyclerView.ViewHold
private var standardTrackingProtection: OnboardingRadioButton private var standardTrackingProtection: OnboardingRadioButton
private var strictTrackingProtection: OnboardingRadioButton private var strictTrackingProtection: OnboardingRadioButton
private var trackingProtectionToggle: SwitchCompat
init { init {
view.header_text.setOnboardingIcon(R.drawable.ic_onboarding_tracking_protection) view.header_text.setOnboardingIcon(R.drawable.ic_onboarding_tracking_protection)
trackingProtectionToggle = view.tracking_protection_toggle
standardTrackingProtection = view.tracking_protection_standard_option standardTrackingProtection = view.tracking_protection_standard_option
strictTrackingProtection = view.tracking_protection_strict_default strictTrackingProtection = view.tracking_protection_strict_default
view.description_text.text = view.context.getString( view.description_text.text = view.context.getString(
R.string.onboarding_tracking_protection_description_2 R.string.onboarding_tracking_protection_description_3
) )
trackingProtectionToggle.apply { val isTrackingProtectionEnabled = view.context.settings().shouldUseTrackingProtection
isChecked = view.context.settings().shouldUseTrackingProtection setupRadioGroup(isTrackingProtectionEnabled)
setOnCheckedChangeListener { _, isChecked -> updateRadioGroupState(isTrackingProtectionEnabled)
updateTrackingProtectionSetting(isChecked)
updateRadioGroupState(isChecked)
}
}
setupRadioGroup(trackingProtectionToggle.isChecked)
updateRadioGroupState(trackingProtectionToggle.isChecked)
} }
private fun setupRadioGroup(isChecked: Boolean) { private fun setupRadioGroup(isChecked: Boolean) {
@ -74,15 +64,6 @@ class OnboardingTrackingProtectionViewHolder(view: View) : RecyclerView.ViewHold
strictTrackingProtection.isEnabled = isChecked strictTrackingProtection.isEnabled = isChecked
} }
private fun updateTrackingProtectionSetting(enabled: Boolean) {
itemView.context.settings().shouldUseTrackingProtection = enabled
with(itemView.context.components) {
val policy = core.trackingProtectionPolicyFactory.createTrackingProtectionPolicy()
useCases.settingsUseCases.updateTrackingProtection.invoke(policy)
useCases.sessionUseCases.reload.invoke()
}
}
private fun updateTrackingProtectionPolicy() { private fun updateTrackingProtectionPolicy() {
itemView.context?.components?.let { itemView.context?.components?.let {
val policy = it.core.trackingProtectionPolicyFactory val policy = it.core.trackingProtectionPolicyFactory

@ -1,22 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.onboarding
import android.content.Context
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.settings.SupportUtils
class OnboardingController(
private val context: Context
) {
fun handleLearnMoreClicked() {
(context as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = SupportUtils.getFirefoxAccountSumoUrl(),
newTab = true,
from = BrowserDirection.FromHome
)
}
}

@ -1,14 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.onboarding
class OnboardingInteractor(private val onboardingController: OnboardingController) {
/**
* Called when the user clicks the learn more link
* @param url the url the suggestion was providing
*/
fun onLearnMoreClicked() = onboardingController.handleLearnMoreClicked()
}

@ -8,9 +8,9 @@
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path
android:fillColor="@android:color/white" android:fillColor="?accent"
android:pathData="M17.6655,14.2092C16.1843,12.4998 14.1333,14.8 11.9997,14.8C9.8675,14.8 7.8151,12.4998 6.3339,14.2092C5.9139,14.6936 5.8803,15.3992 6.2401,15.9284C7.4959,17.7764 9.5959,19 11.9997,19C14.4035,19 16.5035,17.7764 17.7593,15.9284C18.1205,15.3992 18.0855,14.6936 17.6655,14.2092M16.25,9.25C16.25,6.9026 14.3474,5 12,5C9.6526,5 7.75,6.9026 7.75,9.25C7.75,11.5974 9.6526,13.5 12,13.5C14.3474,13.5 16.25,11.5974 16.25,9.25Z" /> android:pathData="M17.6655,14.2092C16.1843,12.4998 14.1333,14.8 11.9997,14.8C9.8675,14.8 7.8151,12.4998 6.3339,14.2092C5.9139,14.6936 5.8803,15.3992 6.2401,15.9284C7.4959,17.7764 9.5959,19 11.9997,19C14.4035,19 16.5035,17.7764 17.7593,15.9284C18.1205,15.3992 18.0855,14.6936 17.6655,14.2092M16.25,9.25C16.25,6.9026 14.3474,5 12,5C9.6526,5 7.75,6.9026 7.75,9.25C7.75,11.5974 9.6526,13.5 12,13.5C14.3474,13.5 16.25,11.5974 16.25,9.25Z" />
<path <path
android:fillColor="@android:color/white" android:fillColor="?accent"
android:pathData="M12,22C6.4772,22 2,17.5228 2,12C2,6.4772 6.4772,2 12,2C17.5228,2 22,6.4772 22,12C21.9939,17.5203 17.5203,21.9939 12,22L12,22ZM12,4C7.5817,4 4,7.5817 4,12C4,16.4183 7.5817,20 12,20C16.4183,20 20,16.4183 20,12C19.995,7.5838 16.4162,4.005 12,4Z" /> android:pathData="M12,22C6.4772,22 2,17.5228 2,12C2,6.4772 6.4772,2 12,2C17.5228,2 22,6.4772 22,12C21.9939,17.5203 17.5203,21.9939 12,22L12,22ZM12,4C7.5817,4 4,7.5817 4,12C4,16.4183 7.5817,20 12,20C16.4183,20 20,16.4183 20,12C19.995,7.5838 16.4162,4.005 12,4Z" />
</vector> </vector>

@ -7,7 +7,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/onboarding_card" android:id="@+id/onboarding_card"
style="@style/OnboardingCardDark" style="@style/OnboardingCardLightWithPadding"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -26,37 +26,31 @@
android:id="@+id/header_text" android:id="@+id/header_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@style/Header16TextStyle" android:textAppearance="@style/HeaderTextStyle"
android:lineSpacingExtra="8sp" android:lineSpacingExtra="8sp"
android:textColor="@color/neutral_text" android:layout_marginTop="10dp"
app:drawableTint="@color/white_color"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/avatar_icon" app:layout_constraintStart_toStartOf="@id/avatar_icon"
android:layout_marginStart="52dp" android:layout_marginStart="52dp"
tools:text="@string/onboarding_account_sign_in_header" tools:text="@string/onboarding_account_sign_in_header_1" />
/>
<org.mozilla.fenix.utils.LinkTextView <TextView
android:id="@+id/learn_more" android:id="@+id/description_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="14dp"
android:text="@string/onboarding_manual_sign_in_learn_more" android:text="@string/onboarding_manual_sign_in_description"
android:textAppearance="@style/Header16TextStyle" android:textAppearance="@style/Body14TextStyle"
android:textColor="@color/neutral_text" app:layout_constraintStart_toStartOf="@id/avatar_icon"
app:layout_constraintStart_toStartOf="@id/header_text" app:layout_constraintTop_toBottomOf="@id/avatar_icon" />
app:layout_constraintTop_toBottomOf="@id/header_text"
tools:textColor="@color/neutral_text" />
<Button <Button
style="@style/NeutralButton"
android:id="@+id/fxa_sign_in_button" android:id="@+id/fxa_sign_in_button"
android:background="@drawable/onboarding_padded_background" style="@style/NeutralOnboardingButton"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="@string/onboarding_firefox_account_sign_in" android:text="@string/onboarding_firefox_account_sign_in_1"
app:layout_constraintTop_toBottomOf="@id/learn_more" app:layout_constraintTop_toBottomOf="@id/description_text"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="parent" app:layout_constraintStart_toEndOf="parent" />
app:backgroundTint="@color/foundation_light_theme" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -29,7 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/onboarding_theme_picker_description1" android:text="@string/onboarding_theme_picker_description_2"
android:textAppearance="@style/Body14TextStyle" android:textAppearance="@style/Body14TextStyle"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text" /> app:layout_constraintTop_toBottomOf="@id/header_text" />

@ -18,7 +18,7 @@
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingBottom="14dp" android:paddingBottom="14dp"
android:text="@string/onboarding_toolbar_position_header" android:text="@string/onboarding_toolbar_placement_header_1"
android:textAppearance="@style/HeaderTextStyle" android:textAppearance="@style/HeaderTextStyle"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -29,52 +29,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/onboarding_toolbar_position_description" android:text="@string/onboarding_toolbar_placement_description_1"
android:textAppearance="@style/Body14TextStyle" android:textAppearance="@style/Body14TextStyle"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text" /> app:layout_constraintTop_toBottomOf="@id/header_text" />
<TextView
android:id="@+id/toolbar_top_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/preference_top_toolbar"
android:textColor="?primaryText"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@+id/toolbar_top_image"
app:layout_constraintStart_toStartOf="@id/toolbar_top_image"
app:layout_constraintTop_toBottomOf="@id/toolbar_top_image"
app:layout_constraintBottom_toBottomOf="parent"/>
<org.mozilla.fenix.onboarding.OnboardingRadioButton
android:id="@+id/toolbar_top_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/preference_top_toolbar"
android:elevation="1dp"
android:theme="@style/Checkable.Colored"
android:translationX="@dimen/onboarding_dual_pane_radio_button_translation_x"
android:translationY="@dimen/onboarding_dual_pane_radio_button_translation_y"
app:layout_constraintStart_toStartOf="@+id/toolbar_top_image"
app:layout_constraintTop_toBottomOf="@+id/description_text"
app:layout_constraintTop_toTopOf="@+id/toolbar_top_image"
app:onboardingKey="@string/pref_key_toolbar_top" />
<ImageView
android:id="@+id/toolbar_top_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:contentDescription="@string/preference_top_toolbar"
android:foreground="@drawable/rounded_ripple"
app:layout_constraintEnd_toStartOf="@+id/toolbar_bottom_image"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description_text"
app:srcCompat="@drawable/onboarding_toolbar_top" />
<org.mozilla.fenix.onboarding.OnboardingRadioButton <org.mozilla.fenix.onboarding.OnboardingRadioButton
android:id="@+id/toolbar_bottom_radio_button" android:id="@+id/toolbar_bottom_radio_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -98,9 +57,9 @@
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:contentDescription="@string/preference_bottom_toolbar" android:contentDescription="@string/preference_bottom_toolbar"
android:foreground="@drawable/rounded_ripple" android:foreground="@drawable/rounded_ripple"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/toolbar_top_image" app:layout_constraintEnd_toStartOf="@+id/toolbar_top_image"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/description_text" app:layout_constraintTop_toBottomOf="@+id/description_text"
app:srcCompat="@drawable/onboarding_toolbar_bottom" /> app:srcCompat="@drawable/onboarding_toolbar_bottom" />
@ -117,5 +76,45 @@
app:layout_constraintTop_toBottomOf="@id/toolbar_bottom_image" app:layout_constraintTop_toBottomOf="@id/toolbar_bottom_image"
app:layout_constraintBottom_toBottomOf="parent"/> app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="@+id/toolbar_top_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/preference_top_toolbar"
android:textColor="?primaryText"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="@+id/toolbar_top_image"
app:layout_constraintStart_toStartOf="@id/toolbar_top_image"
app:layout_constraintTop_toBottomOf="@id/toolbar_top_image"
app:layout_constraintBottom_toBottomOf="parent"/>
<org.mozilla.fenix.onboarding.OnboardingRadioButton
android:id="@+id/toolbar_top_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/preference_top_toolbar"
android:elevation="1dp"
android:theme="@style/Checkable.Colored"
android:translationX="@dimen/onboarding_dual_pane_radio_button_translation_x"
android:translationY="@dimen/onboarding_dual_pane_radio_button_translation_y"
app:layout_constraintStart_toStartOf="@+id/toolbar_top_image"
app:layout_constraintTop_toBottomOf="@+id/description_text"
app:layout_constraintTop_toTopOf="@+id/toolbar_top_image"
app:onboardingKey="@string/pref_key_toolbar_top" />
<ImageView
android:id="@+id/toolbar_top_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:contentDescription="@string/preference_top_toolbar"
android:foreground="@drawable/rounded_ripple"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/toolbar_bottom_image"
app:layout_constraintTop_toBottomOf="@+id/description_text"
app:srcCompat="@drawable/onboarding_toolbar_top" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -18,23 +18,13 @@
android:drawablePadding="12dp" android:drawablePadding="12dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:lines="1" android:lines="1"
android:text="@string/onboarding_tracking_protection_header_2" android:text="@string/onboarding_tracking_protection_header_3"
android:textAppearance="@style/HeaderTextStyle" android:textAppearance="@style/HeaderTextStyle"
app:layout_constraintEnd_toStartOf="@id/tracking_protection_toggle" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:drawableStart="@drawable/ic_onboarding_tracking_protection" /> tools:drawableStart="@drawable/ic_onboarding_tracking_protection" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tracking_protection_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="48dp"
android:minHeight="48dp"
app:layout_constraintBottom_toBottomOf="@id/header_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/header_text" />
<TextView <TextView
android:id="@+id/description_text" android:id="@+id/description_text"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -44,7 +34,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header_text" app:layout_constraintTop_toBottomOf="@id/header_text"
tools:text="@string/onboarding_tracking_protection_description_2" /> tools:text="@string/onboarding_tracking_protection_description_3" />
<org.mozilla.fenix.onboarding.OnboardingRadioButton <org.mozilla.fenix.onboarding.OnboardingRadioButton
@ -64,7 +54,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/description_text" app:layout_constraintTop_toBottomOf="@id/description_text"
app:onboardingKey="@string/pref_key_tracking_protection_standard_option" app:onboardingKey="@string/pref_key_tracking_protection_standard_option"
app:onboardingKeyDescription="@string/onboarding_tracking_protection_standard_button_description_2" app:onboardingKeyDescription="@string/onboarding_tracking_protection_standard_button_description_3"
app:onboardingKeyTitle="@string/onboarding_tracking_protection_standard_button_2" app:onboardingKeyTitle="@string/onboarding_tracking_protection_standard_button_2"
tools:text="Standard" /> tools:text="Standard" />
@ -87,7 +77,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tracking_protection_standard_option" app:layout_constraintTop_toBottomOf="@id/tracking_protection_standard_option"
app:onboardingKey="@string/pref_key_tracking_protection_strict_default" app:onboardingKey="@string/pref_key_tracking_protection_strict_default"
app:onboardingKeyDescription="@string/onboarding_tracking_protection_strict_button_description_2" app:onboardingKeyDescription="@string/onboarding_tracking_protection_strict_button_description_3"
app:onboardingKeyTitle="@string/onboarding_tracking_protection_strict_option" app:onboardingKeyTitle="@string/onboarding_tracking_protection_strict_option"
tools:text="Strict" /> tools:text="Strict" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -1144,9 +1144,6 @@
<string name="onboarding_header">Welcome to %s!</string> <string name="onboarding_header">Welcome to %s!</string>
<!-- text for the Firefox Accounts section header --> <!-- text for the Firefox Accounts section header -->
<string name="onboarding_fxa_section_header">Already have an account?</string> <string name="onboarding_fxa_section_header">Already have an account?</string>
<!-- text for the Firefox Preview feature section header
The first parameter is the name of the app (e.g. Firefox Preview) -->
<string name="onboarding_feature_section_header">Get to know %s</string>
<!-- text for the "What's New" onboarding card header --> <!-- text for the "What's New" onboarding card header -->
<string name="onboarding_whats_new_header1">See whats new</string> <string name="onboarding_whats_new_header1">See whats new</string>
<!-- text for the "what's new" onboarding card description <!-- text for the "what's new" onboarding card description
@ -1155,9 +1152,9 @@
<!-- text for underlined clickable link that is part of "what's new" onboarding card description that links to an FAQ --> <!-- text for underlined clickable link that is part of "what's new" onboarding card description that links to an FAQ -->
<string name="onboarding_whats_new_description_linktext">Get answers here</string> <string name="onboarding_whats_new_description_linktext">Get answers here</string>
<!-- text for the Firefox account onboarding sign in card header --> <!-- text for the Firefox account onboarding sign in card header -->
<string name="onboarding_account_sign_in_header">Start syncing bookmarks, passwords, and more with your Firefox account.</string> <string name="onboarding_account_sign_in_header_1">Sync Firefox between devices</string>
<!-- Text for the button to learn more about signing in to your Firefox account --> <!-- Text for the button to learn more about signing in to your Firefox account -->
<string name="onboarding_manual_sign_in_learn_more">Learn more</string> <string name="onboarding_manual_sign_in_description">Bring bookmarks, history, and passwords to Firefox on this device.</string>
<!-- text for the firefox account onboarding card header when we detect you're already signed in to <!-- text for the firefox account onboarding card header when we detect you're already signed in to
another Firefox browser. (The word `Firefox` should not be translated) another Firefox browser. (The word `Firefox` should not be translated)
The first parameter is the email of the detected user's account --> The first parameter is the email of the detected user's account -->
@ -1166,8 +1163,8 @@
<string name="onboarding_firefox_account_auto_signin_confirm">Yes, sign me in</string> <string name="onboarding_firefox_account_auto_signin_confirm">Yes, sign me in</string>
<!-- text for the automatic sign-in button while signing in is in process --> <!-- text for the automatic sign-in button while signing in is in process -->
<string name="onboarding_firefox_account_signing_in">Signing in&#8230;</string> <string name="onboarding_firefox_account_signing_in">Signing in&#8230;</string>
<!-- text for the button to manually sign into Firefox account. The word "Firefox" should not be translated --> <!-- text for the button to manually sign into Firefox account. -->
<string name="onboarding_firefox_account_sign_in">Sign in to Firefox</string> <string name="onboarding_firefox_account_sign_in_1">Sign up</string>
<!-- text for the button to stay signed out when presented with an option to automatically sign-in. --> <!-- text for the button to stay signed out when presented with an option to automatically sign-in. -->
<string name="onboarding_firefox_account_stay_signed_out">Stay signed out</string> <string name="onboarding_firefox_account_stay_signed_out">Stay signed out</string>
<!-- text to display in the snackbar once account is signed-in --> <!-- text to display in the snackbar once account is signed-in -->
@ -1175,26 +1172,23 @@
<!-- text to display in the snackbar if automatic sign-in fails. user may try again --> <!-- text to display in the snackbar if automatic sign-in fails. user may try again -->
<string name="onboarding_firefox_account_automatic_signin_failed">Failed to sign-in</string> <string name="onboarding_firefox_account_automatic_signin_failed">Failed to sign-in</string>
<!-- text for the tracking protection onboarding card header --> <!-- text for the tracking protection onboarding card header -->
<string name="onboarding_tracking_protection_header_2">Automatic privacy</string> <string name="onboarding_tracking_protection_header_3">Always-on privacy</string>
<!-- text for the tracking protection card description <!-- text for the tracking protection card description. 'Firefox' intentionally hardcoded here -->
The first parameter is the name of the app (e.g. Firefox Preview) --> <string name="onboarding_tracking_protection_description_3">Firefox automatically stops companies from secretly following you around the web.</string>
<string name="onboarding_tracking_protection_description_2">Privacy and security settings block trackers, malware, and companies that follow you.</string>
<!-- text for tracking protection radio button option for standard level of blocking --> <!-- text for tracking protection radio button option for standard level of blocking -->
<string name="onboarding_tracking_protection_standard_button_2">Standard (default)</string> <string name="onboarding_tracking_protection_standard_button_2">Standard (default)</string>
<!-- text for standard blocking option button description --> <!-- text for standard blocking option button description -->
<string name="onboarding_tracking_protection_standard_button_description_2">Blocks fewer trackers. Pages will load normally.</string> <string name="onboarding_tracking_protection_standard_button_description_3">Balanced for privacy and performance. Pages load normally.</string>
<!-- text for tracking protection radio button option for strict level of blocking --> <!-- text for tracking protection radio button option for strict level of blocking -->
<string name="onboarding_tracking_protection_strict_button">Strict (recommended)</string> <string name="onboarding_tracking_protection_strict_button">Strict (recommended)</string>
<!-- text for tracking protection radio button option for strict level of blocking --> <!-- text for tracking protection radio button option for strict level of blocking -->
<string name="onboarding_tracking_protection_strict_option">Strict</string> <string name="onboarding_tracking_protection_strict_option">Strict</string>
<!-- text for strict blocking option button description --> <!-- text for strict blocking option button description -->
<string name="onboarding_tracking_protection_strict_button_description_2">Blocks more trackers, ads, and popups. Pages load faster, but some functionality might not work.</string> <string name="onboarding_tracking_protection_strict_button_description_3">Blocks more trackers so pages load faster, but some on-page functionally may break.</string>
<!-- text for the toolbar position card header <!-- text for the toolbar position card header -->
In English this is an idiom for "choose a side as in an argument or fight" <string name="onboarding_toolbar_placement_header_1">Pick your toolbar placement</string>
but it is ok to make this more literally about "choosing a position in a physical space -->
<string name="onboarding_toolbar_position_header">Take a position</string>
<!-- text for the toolbar position card description --> <!-- text for the toolbar position card description -->
<string name="onboarding_toolbar_position_description">Try one-handed browsing with the bottom toolbar or move it to the top.</string> <string name="onboarding_toolbar_placement_description_1">Put the toolbar within easy reach. Keep it on the bottom, or move it to the top.</string>
<!-- text for the private browsing onboarding card header --> <!-- text for the private browsing onboarding card header -->
<string name="onboarding_private_browsing_header">Browse privately</string> <string name="onboarding_private_browsing_header">Browse privately</string>
<!-- text for the private browsing onboarding card description <!-- text for the private browsing onboarding card description
@ -1207,7 +1201,7 @@
<!-- text for the privacy notice onboarding card header --> <!-- text for the privacy notice onboarding card header -->
<string name="onboarding_privacy_notice_header">Your privacy</string> <string name="onboarding_privacy_notice_header">Your privacy</string>
<!-- text for the privacy notice onboarding card description <!-- text for the privacy notice onboarding card description
The first parameter is the name of the app (e.g. Firefox Preview) --> The first parameter is the name of the app (e.g. Firefox Preview) Substitute %s for long browser name. -->
<string name="onboarding_privacy_notice_description2">Weve designed %s to give you control over what you share online and what you share with us.</string> <string name="onboarding_privacy_notice_description2">Weve designed %s to give you control over what you share online and what you share with us.</string>
<!-- Text for the button to read the privacy notice --> <!-- Text for the button to read the privacy notice -->
<string name="onboarding_privacy_notice_read_button">Read our privacy notice</string> <string name="onboarding_privacy_notice_read_button">Read our privacy notice</string>
@ -1221,7 +1215,7 @@
<!-- text for the theme picker onboarding card header --> <!-- text for the theme picker onboarding card header -->
<string name="onboarding_theme_picker_header">Choose your theme</string> <string name="onboarding_theme_picker_header">Choose your theme</string>
<!-- text for the theme picker onboarding card description --> <!-- text for the theme picker onboarding card description -->
<string name="onboarding_theme_picker_description1">Save some battery and your eyesight by enabling dark mode.</string> <string name="onboarding_theme_picker_description_2">Save some battery and your eyesight with dark mode.</string>
<!-- Automatic theme setting (will follow device setting) --> <!-- Automatic theme setting (will follow device setting) -->
<string name="onboarding_theme_automatic_title">Automatic</string> <string name="onboarding_theme_automatic_title">Automatic</string>
<!-- Summary of automatic theme setting (will follow device setting) --> <!-- Summary of automatic theme setting (will follow device setting) -->
@ -1276,13 +1270,13 @@
<!-- Preference for enhanced tracking protection for the standard protection settings --> <!-- Preference for enhanced tracking protection for the standard protection settings -->
<string name="preference_enhanced_tracking_protection_standard_default_1">Standard (default)</string> <string name="preference_enhanced_tracking_protection_standard_default_1">Standard (default)</string>
<!-- Preference description for enhanced tracking protection for the standard protection settings --> <!-- Preference description for enhanced tracking protection for the standard protection settings -->
<string name="preference_enhanced_tracking_protection_standard_description_3">Blocks fewer trackers. Pages will load normally.</string> <string name="preference_enhanced_tracking_protection_standard_description_4">Balanced for privacy and performance. Pages load normally.</string>
<!-- Accessibility text for the Standard protection information icon --> <!-- Accessibility text for the Standard protection information icon -->
<string name="preference_enhanced_tracking_protection_standard_info_button">Whats blocked by standard tracking protection</string> <string name="preference_enhanced_tracking_protection_standard_info_button">Whats blocked by standard tracking protection</string>
<!-- Preference for enhanced tracking protection for the strict protection settings --> <!-- Preference for enhanced tracking protection for the strict protection settings -->
<string name="preference_enhanced_tracking_protection_strict">Strict</string> <string name="preference_enhanced_tracking_protection_strict">Strict</string>
<!-- Preference description for enhanced tracking protection for the strict protection settings --> <!-- Preference description for enhanced tracking protection for the strict protection settings -->
<string name="preference_enhanced_tracking_protection_strict_description_2">Blocks more trackers, ads, and popups. Pages load faster, but some functionality might not work.</string> <string name="preference_enhanced_tracking_protection_strict_description_3">Blocks more trackers so pages load faster, but some on-page functionally may break.</string>
<!-- Accessibility text for the Strict protection information icon --> <!-- Accessibility text for the Strict protection information icon -->
<string name="preference_enhanced_tracking_protection_strict_info_button">Whats blocked by strict tracking protection</string> <string name="preference_enhanced_tracking_protection_strict_info_button">Whats blocked by strict tracking protection</string>
<!-- Preference for enhanced tracking protection for the custom protection settings --> <!-- Preference for enhanced tracking protection for the custom protection settings -->

@ -18,13 +18,13 @@
android:defaultValue="true" android:defaultValue="true"
android:dependency="@string/pref_key_tracking_protection" android:dependency="@string/pref_key_tracking_protection"
android:key="@string/pref_key_tracking_protection_standard_option" android:key="@string/pref_key_tracking_protection_standard_option"
android:summary="@string/preference_enhanced_tracking_protection_standard_description_3" android:summary="@string/preference_enhanced_tracking_protection_standard_description_4"
android:title="@string/preference_enhanced_tracking_protection_standard_default_1" /> android:title="@string/preference_enhanced_tracking_protection_standard_default_1" />
<org.mozilla.fenix.settings.RadioButtonInfoPreference <org.mozilla.fenix.settings.RadioButtonInfoPreference
android:defaultValue="false" android:defaultValue="false"
android:dependency="@string/pref_key_tracking_protection" android:dependency="@string/pref_key_tracking_protection"
android:key="@string/pref_key_tracking_protection_strict_default" android:key="@string/pref_key_tracking_protection_strict_default"
android:summary="@string/preference_enhanced_tracking_protection_strict_description_2" android:summary="@string/preference_enhanced_tracking_protection_strict_description_3"
android:title="@string/preference_enhanced_tracking_protection_strict" /> android:title="@string/preference_enhanced_tracking_protection_strict" />
<org.mozilla.fenix.settings.RadioButtonInfoPreference <org.mozilla.fenix.settings.RadioButtonInfoPreference
android:defaultValue="false" android:defaultValue="false"

@ -9,9 +9,7 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.Navigation import androidx.navigation.Navigation
import io.mockk.Runs
import io.mockk.every import io.mockk.every
import io.mockk.just
import io.mockk.mockk import io.mockk.mockk
import io.mockk.mockkStatic import io.mockk.mockkStatic
import io.mockk.unmockkStatic import io.mockk.unmockkStatic
@ -23,16 +21,15 @@ import org.junit.Assert.assertEquals
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
import org.mozilla.fenix.home.HomeFragmentDirections import org.mozilla.fenix.home.HomeFragmentDirections
import org.mozilla.fenix.onboarding.OnboardingInteractor
@RunWith(FenixRobolectricTestRunner::class) @RunWith(FenixRobolectricTestRunner::class)
class OnboardingManualSignInViewHolderTest { class OnboardingManualSignInViewHolderTest {
private lateinit var view: View private lateinit var view: View
private lateinit var navController: NavController private lateinit var navController: NavController
private lateinit var interactor: OnboardingInteractor
private lateinit var itemView: ViewGroup private lateinit var itemView: ViewGroup
@Before @Before
@ -40,12 +37,10 @@ class OnboardingManualSignInViewHolderTest {
view = LayoutInflater.from(testContext) view = LayoutInflater.from(testContext)
.inflate(OnboardingManualSignInViewHolder.LAYOUT_ID, null) .inflate(OnboardingManualSignInViewHolder.LAYOUT_ID, null)
navController = mockk(relaxed = true) navController = mockk(relaxed = true)
interactor = mockk(relaxUnitFun = true)
itemView = mockk(relaxed = true) itemView = mockk(relaxed = true)
mockkStatic(Navigation::class) mockkStatic(Navigation::class)
every { itemView.context } returns testContext every { itemView.context } returns testContext
every { interactor.onLearnMoreClicked() } just Runs
every { Navigation.findNavController(view) } returns navController every { Navigation.findNavController(view) } returns navController
} }
@ -57,9 +52,9 @@ class OnboardingManualSignInViewHolderTest {
@Test @Test
fun `bind header text`() { fun `bind header text`() {
OnboardingManualSignInViewHolder(view).bind() OnboardingManualSignInViewHolder(view).bind()
val string = testContext.getString(R.string.onboarding_account_sign_in_header_1)
assertEquals( assertEquals(
"Start syncing bookmarks, passwords, and more with your Firefox account.", string,
view.header_text.text view.header_text.text
) )
} }

@ -32,9 +32,7 @@ class OnboardingTrackingProtectionViewHolderTest {
fun `sets description text`() { fun `sets description text`() {
OnboardingTrackingProtectionViewHolder(view) OnboardingTrackingProtectionViewHolder(view)
assertEquals( val string = testContext.getString(R.string.onboarding_tracking_protection_description_3)
"Privacy and security settings block trackers, malware, and companies that follow you.", assertEquals(string, view.description_text.text)
view.description_text.text
)
} }
} }

Loading…
Cancel
Save