For #5371: Updates search engine settings string (#5393)

nightly-build-test
Sawyer Blatz 5 years ago committed by GitHub
parent a68fabd3a7
commit 50cd2920d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -67,7 +67,7 @@ class SearchTest {
}.openSearch { }.openSearch {
scrollToSearchEngineSettings() scrollToSearchEngineSettings()
clickSearchEngineSettings() clickSearchEngineSettings()
verifySearchEngineSettings() verifySearchSettings()
} }
} }

@ -41,7 +41,7 @@ class SearchRobot {
fun verifySearchWithText() = assertSearchWithText() fun verifySearchWithText() = assertSearchWithText()
fun verifyDuckDuckGoResults() = assertDuckDuckGoResults() fun verifyDuckDuckGoResults() = assertDuckDuckGoResults()
fun verifyDuckDuckGoURL() = assertDuckDuckGoURL() fun verifyDuckDuckGoURL() = assertDuckDuckGoURL()
fun verifySearchEngineSettings() = assertSearchEngineSettings() fun verifySearchSettings() = assertSearchSettings()
fun verifySearchBarEmpty() = assertSearchBarEmpty() fun verifySearchBarEmpty() = assertSearchBarEmpty()
fun clickScanButton() { fun clickScanButton() {
@ -161,8 +161,8 @@ private fun assertSearchWithText() =
onView(allOf(withText("SEARCH WITH"))) onView(allOf(withText("SEARCH WITH")))
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) .check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertSearchEngineSettings() = private fun assertSearchSettings() =
onView(allOf(withText("Search engine"))) onView(allOf(withText("Default search engine")))
.check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) .check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertSearchBarEmpty() = browserToolbarEditView().check(matches(withText(""))) private fun assertSearchBarEmpty() = browserToolbarEditView().check(matches(withText("")))

@ -20,7 +20,7 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
(activity as AppCompatActivity).title = getString(R.string.preferences_search_engine) (activity as AppCompatActivity).title = getString(R.string.preferences_search)
(activity as AppCompatActivity).supportActionBar?.show() (activity as AppCompatActivity).supportActionBar?.show()
val searchSuggestionsPreference = val searchSuggestionsPreference =

@ -49,7 +49,7 @@ import org.mozilla.fenix.R.string.pref_key_make_default_browser
import org.mozilla.fenix.R.string.pref_key_privacy_link import org.mozilla.fenix.R.string.pref_key_privacy_link
import org.mozilla.fenix.R.string.pref_key_rate 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_remote_debugging
import org.mozilla.fenix.R.string.pref_key_search_engine_settings import org.mozilla.fenix.R.string.pref_key_search_settings
import org.mozilla.fenix.R.string.pref_key_sign_in 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_site_permissions
import org.mozilla.fenix.R.string.pref_key_theme import org.mozilla.fenix.R.string.pref_key_theme
@ -124,12 +124,6 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver {
findPreference<DefaultBrowserPreference>(getPreferenceKey(R.string.pref_key_make_default_browser)) findPreference<DefaultBrowserPreference>(getPreferenceKey(R.string.pref_key_make_default_browser))
defaultBrowserPreference?.updateSwitch() defaultBrowserPreference?.updateSwitch()
val searchEnginePreference =
findPreference<Preference>(getPreferenceKey(R.string.pref_key_search_engine_settings))
searchEnginePreference?.summary = context?.let {
requireComponents.search.searchEngineManager.getDefaultSearchEngine(it).name
}
val trackingProtectionPreference = val trackingProtectionPreference =
findPreference<Preference>(getPreferenceKey(R.string.pref_key_tracking_protection_settings)) findPreference<Preference>(getPreferenceKey(R.string.pref_key_tracking_protection_settings))
trackingProtectionPreference?.summary = context?.let { trackingProtectionPreference?.summary = context?.let {
@ -158,7 +152,7 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver {
@Suppress("ComplexMethod", "LongMethod") @Suppress("ComplexMethod", "LongMethod")
override fun onPreferenceTreeClick(preference: Preference): Boolean { override fun onPreferenceTreeClick(preference: Preference): Boolean {
when (preference.key) { when (preference.key) {
resources.getString(pref_key_search_engine_settings) -> { resources.getString(pref_key_search_settings) -> {
navigateToSearchEngineSettings() navigateToSearchEngineSettings()
} }
resources.getString(pref_key_tracking_protection_settings) -> { resources.getString(pref_key_tracking_protection_settings) -> {

@ -399,7 +399,7 @@
<fragment <fragment
android:id="@+id/searchEngineFragment" android:id="@+id/searchEngineFragment"
android:name="org.mozilla.fenix.settings.SearchEngineFragment" android:name="org.mozilla.fenix.settings.SearchEngineFragment"
android:label="@string/preferences_search_engine" /> android:label="@string/preferences_search" />
<fragment <fragment
android:id="@+id/turnOnSyncFragment" android:id="@+id/turnOnSyncFragment"

@ -3,7 +3,7 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources> <resources>
<string name="pref_key_make_default_browser" translatable="false">pref_key_make_default_browser</string> <string name="pref_key_make_default_browser" translatable="false">pref_key_make_default_browser</string>
<string name="pref_key_search_engine_settings" translatable="false">pref_key_search_engine_settings</string> <string name="pref_key_search_settings" translatable="false">pref_key_search_settings</string>
<string name="pref_key_search_engine" translatable="false">pref_key_search_engine</string> <string name="pref_key_search_engine" translatable="false">pref_key_search_engine</string>
<string name="pref_key_passwords" translatable="false">pref_key_passwords</string> <string name="pref_key_passwords" translatable="false">pref_key_passwords</string>
<string name="pref_key_credit_cards_addresses" translatable="false">pref_key_credit_cards_addresses</string> <string name="pref_key_credit_cards_addresses" translatable="false">pref_key_credit_cards_addresses</string>

@ -116,7 +116,9 @@
<!-- Preference category for all links about Fenix --> <!-- Preference category for all links about Fenix -->
<string name="preferences_category_about">About</string> <string name="preferences_category_about">About</string>
<!-- Preference for settings related to changing the default search engine --> <!-- Preference for settings related to changing the default search engine -->
<string name="preferences_search_engine">Search engine</string> <string name="preferences_default_search_engine">Default search engine</string>
<!-- Preference for settings related to Search -->
<string name="preferences_search">Search</string>
<!-- Preference linking to help about Fenix --> <!-- Preference linking to help about Fenix -->
<string name="preferences_help">Help</string> <string name="preferences_help">Help</string>
<!-- Preference link to rating Fenix on the Play Store --> <!-- Preference link to rating Fenix on the Play Store -->

@ -33,8 +33,8 @@
app:iconSpaceReserved="false"> app:iconSpaceReserved="false">
<androidx.preference.Preference <androidx.preference.Preference
android:icon="@drawable/ic_search" android:icon="@drawable/ic_search"
android:key="@string/pref_key_search_engine_settings" android:key="@string/pref_key_search_settings"
android:title="@string/preferences_search_engine" /> android:title="@string/preferences_search" />
<androidx.preference.Preference <androidx.preference.Preference
android:icon="@drawable/ic_customize" android:icon="@drawable/ic_customize"

@ -5,25 +5,32 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<org.mozilla.fenix.settings.RadioSearchEngineListPreference /> <PreferenceCategory
<SwitchPreference android:title="@string/preferences_default_search_engine"
android:defaultValue="true" android:selectable="false"
android:key="@string/pref_key_show_search_suggestions" app:iconSpaceReserved="false">
android:title="@string/preferences_show_search_suggestions" <org.mozilla.fenix.settings.RadioSearchEngineListPreference
app:iconSpaceReserved="false" /> android:selectable="false"/>
<SwitchPreference <SwitchPreference
android:defaultValue="true" android:defaultValue="true"
android:key="@string/pref_key_show_clipboard_suggestions" android:key="@string/pref_key_show_search_suggestions"
android:title="@string/preferences_show_clipboard_suggestions" android:title="@string/preferences_show_search_suggestions"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false"
<SwitchPreference app:allowDividerAbove="false"/>
android:defaultValue="true" <SwitchPreference
android:key="@string/pref_key_search_browsing_history" android:defaultValue="true"
android:title='@string/preferences_search_browsing_history' android:key="@string/pref_key_show_clipboard_suggestions"
app:iconSpaceReserved="false" /> android:title="@string/preferences_show_clipboard_suggestions"
<SwitchPreference app:iconSpaceReserved="false" />
android:defaultValue="true" <SwitchPreference
android:key="@string/pref_key_search_bookmarks" android:defaultValue="true"
android:title='@string/preferences_search_bookmarks' android:key="@string/pref_key_search_browsing_history"
app:iconSpaceReserved="false" /> android:title='@string/preferences_search_browsing_history'
app:iconSpaceReserved="false" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/pref_key_search_bookmarks"
android:title='@string/preferences_search_bookmarks'
app:iconSpaceReserved="false" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

Loading…
Cancel
Save