|
|
@ -8,6 +8,7 @@ import android.os.Bundle
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import androidx.preference.Preference
|
|
|
|
import androidx.preference.Preference
|
|
|
|
|
|
|
|
import androidx.preference.CheckBoxPreference
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
import androidx.preference.SwitchPreference
|
|
|
|
import androidx.preference.SwitchPreference
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.R
|
|
|
@ -31,6 +32,12 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
|
|
|
|
isChecked = context.settings().shouldShowSearchSuggestions
|
|
|
|
isChecked = context.settings().shouldShowSearchSuggestions
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val searchSuggestionsInPrivatePreference =
|
|
|
|
|
|
|
|
findPreference<CheckBoxPreference>(getPreferenceKey(R.string.pref_key_show_search_suggestions_in_private))
|
|
|
|
|
|
|
|
?.apply {
|
|
|
|
|
|
|
|
isChecked = context.settings().shouldShowSearchSuggestionsInPrivate
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
val showSearchShortcuts =
|
|
|
|
val showSearchShortcuts =
|
|
|
|
findPreference<SwitchPreference>(getPreferenceKey(R.string.pref_key_show_search_shortcuts))?.apply {
|
|
|
|
findPreference<SwitchPreference>(getPreferenceKey(R.string.pref_key_show_search_shortcuts))?.apply {
|
|
|
|
isChecked = context.settings().shouldShowSearchShortcuts
|
|
|
|
isChecked = context.settings().shouldShowSearchShortcuts
|
|
|
@ -60,6 +67,15 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
|
|
|
|
showHistorySuggestions?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
showHistorySuggestions?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
showBookmarkSuggestions?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
showBookmarkSuggestions?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
showClipboardSuggestions?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
showClipboardSuggestions?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
|
|
|
|
searchSuggestionsInPrivatePreference?.onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchSuggestionsPreference?.setOnPreferenceClickListener {
|
|
|
|
|
|
|
|
if (!searchSuggestionsPreference.isChecked) {
|
|
|
|
|
|
|
|
searchSuggestionsInPrivatePreference?.isChecked = false
|
|
|
|
|
|
|
|
searchSuggestionsInPrivatePreference?.callChangeListener(false)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override fun onPreferenceTreeClick(preference: Preference): Boolean {
|
|
|
|
override fun onPreferenceTreeClick(preference: Preference): Boolean {
|
|
|
|