1
0
Fork 0

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

master
Sawyer Blatz 2019-09-18 11:26:44 -07:00 committed by GitHub
parent a68fabd3a7
commit 50cd2920d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 42 additions and 39 deletions

View File

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

View File

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

View File

@ -20,7 +20,7 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
override fun 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()
val searchSuggestionsPreference =

View File

@ -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_rate
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_site_permissions
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))
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 =
findPreference<Preference>(getPreferenceKey(R.string.pref_key_tracking_protection_settings))
trackingProtectionPreference?.summary = context?.let {
@ -158,7 +152,7 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver {
@Suppress("ComplexMethod", "LongMethod")
override fun onPreferenceTreeClick(preference: Preference): Boolean {
when (preference.key) {
resources.getString(pref_key_search_engine_settings) -> {
resources.getString(pref_key_search_settings) -> {
navigateToSearchEngineSettings()
}
resources.getString(pref_key_tracking_protection_settings) -> {

View File

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

View File

@ -3,7 +3,7 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<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_passwords" translatable="false">pref_key_passwords</string>
<string name="pref_key_credit_cards_addresses" translatable="false">pref_key_credit_cards_addresses</string>

View File

@ -116,7 +116,9 @@
<!-- Preference category for all links about Fenix -->
<string name="preferences_category_about">About</string>
<!-- 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 -->
<string name="preferences_help">Help</string>
<!-- Preference link to rating Fenix on the Play Store -->

View File

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

View File

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