diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt index 1e228bae6..cee3b7874 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/ThreeDotMenuMainRobot.kt @@ -151,7 +151,7 @@ class ThreeDotMenuMainRobot { } fun openWhatsNew(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition { - mDevice.waitNotNull(Until.findObject(By.text("What's New")), waitingTime) + mDevice.waitNotNull(Until.findObject(By.text("What’s New")), waitingTime) whatsNewButton().click() BrowserRobot().interact() @@ -256,7 +256,9 @@ private fun ShareALinkTitle() = private fun assertShareALinkTitle() = ShareALinkTitle() -private fun whatsNewButton() = onView(allOf(withText("What's New"), +private fun whatsNewButton() = onView( + allOf( + withText("What’s New"), withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) private fun assertWhatsNewButton() = whatsNewButton() .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) diff --git a/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt b/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt index d308c1d0b..82bff3ba7 100644 --- a/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt @@ -37,14 +37,14 @@ import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R import org.mozilla.fenix.components.StoreProvider import org.mozilla.fenix.components.metrics.Event +import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.getSpannable import org.mozilla.fenix.ext.hideToolbar import org.mozilla.fenix.ext.requireComponents +import org.mozilla.fenix.ext.settings import org.mozilla.fenix.search.awesomebar.AwesomeBarView import org.mozilla.fenix.search.toolbar.ToolbarView import org.mozilla.fenix.settings.SupportUtils -import org.mozilla.fenix.ext.components -import org.mozilla.fenix.ext.settings @Suppress("TooManyFunctions", "LargeClass") class SearchFragment : Fragment(), UserInteractionHandler { @@ -86,12 +86,13 @@ class SearchFragment : Fragment(), UserInteractionHandler { requireComponents.search.provider.getDefaultEngine(requireContext()) ) - val showSearchSuggestions = if ((activity as HomeActivity).browsingModeManager.mode.isPrivate) { - requireContext().settings().shouldShowSearchSuggestions && - requireContext().settings().shouldShowSearchSuggestionsInPrivate - } else { - requireContext().settings().shouldShowSearchSuggestions - } + val showSearchSuggestions = + if ((activity as HomeActivity).browsingModeManager.mode.isPrivate) { + requireContext().settings().shouldShowSearchSuggestions && + requireContext().settings().shouldShowSearchSuggestionsInPrivate + } else { + requireContext().settings().shouldShowSearchSuggestions + } searchStore = StoreProvider.get(this) { SearchFragmentStore( @@ -199,7 +200,8 @@ class SearchFragment : Fragment(), UserInteractionHandler { (activity as HomeActivity) .openToBrowserAndLoad( searchTermOrURL = SupportUtils.getGenericSumoURLForTopic( - SupportUtils.SumoTopic.SEARCH_SUGGESTION), + SupportUtils.SumoTopic.SEARCH_SUGGESTION + ), newTab = searchStore.state.session == null, from = BrowserDirection.FromSearch ) @@ -216,11 +218,12 @@ class SearchFragment : Fragment(), UserInteractionHandler { context?.settings()?.shouldShowSearchSuggestionsInPrivate = false context?.settings()?.showSearchSuggestionsInPrivateOnboardingFinished = true } + + inflated.text.text = + getString(R.string.search_suggestions_onboarding_text, getString(R.string.app_name)) } - view.search_suggestions_onboarding.setOnInflateListener((stubListener) - - ) + view.search_suggestions_onboarding.setOnInflateListener((stubListener)) view.toolbar_wrapper.clipToOutline = false @@ -263,7 +266,10 @@ class SearchFragment : Fragment(), UserInteractionHandler { toolbarView.view.requestFocus() } - updateClipboardSuggestion(searchStore.state, requireContext().components.clipboardHandler.url) + updateClipboardSuggestion( + searchStore.state, + requireContext().components.clipboardHandler.url + ) permissionDidUpdate = false hideToolbar() @@ -292,7 +298,7 @@ class SearchFragment : Fragment(), UserInteractionHandler { private fun updateClipboardSuggestion(searchState: SearchFragmentState, clipboardUrl: String?) { val visibility = if (searchState.showClipboardSuggestions && searchState.query.isEmpty() && !clipboardUrl.isNullOrEmpty()) - View.VISIBLE else View.GONE + View.VISIBLE else View.GONE fill_link_from_clipboard.visibility = visibility divider_line.visibility = visibility diff --git a/app/src/main/res/layout/search_suggestions_onboarding.xml b/app/src/main/res/layout/search_suggestions_onboarding.xml index f2c7bd819..14f7a6477 100644 --- a/app/src/main/res/layout/search_suggestions_onboarding.xml +++ b/app/src/main/res/layout/search_suggestions_onboarding.xml @@ -1,11 +1,13 @@ - + - + android:paddingBottom="10dp"> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="@string/search_suggestions_onboarding_title" /> + app:layout_constraintStart_toStartOf="@id/title" + app:layout_constraintTop_toBottomOf="@id/title" /> + app:layout_constraintStart_toStartOf="@id/title" + app:layout_constraintTop_toBottomOf="@id/text" /> + app:layout_constraintTop_toBottomOf="@id/text" /> + app:layout_constraintEnd_toStartOf="@id/allow" + app:layout_constraintTop_toTopOf="@id/allow" /> \ 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 783e63304..9ce6eda1f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -67,7 +67,7 @@ Help - What\'s New + What\’s New Settings @@ -120,11 +120,11 @@ Allow - Don\'t allow + Don\’t allow Allow search suggestions in private sessions? - - Firefox Preview will share everything you type in the address bar with your default search engine. + + %s will share everything you type in the address bar with your default search engine. Learn more @@ -884,7 +884,7 @@ Pages will load normally, but block fewer trackers. - What\'s blocked by standard tracking protection + What\’s blocked by standard tracking protection Strict @@ -896,7 +896,7 @@ Stronger protection, but may cause some sites or content to break. - What\'s blocked by strict tracking protection + What\’s blocked by strict tracking protection Blocked @@ -934,7 +934,7 @@ Open source libraries we use - What\'s new in %s + What\’s new in %s %s | OSS Libraries @@ -1016,7 +1016,7 @@ Save - Don\'t save + Don\’t save Password copied to clipboard