Remove advance preferences
This commit is contained in:
@@ -43,7 +43,6 @@ import com.aurora.store.MainActivity
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.util.Log
|
||||
import com.aurora.store.util.Preferences
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_ADVANCED_USE_WEB_API
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
val Context.inflater: LayoutInflater
|
||||
@@ -176,7 +175,3 @@ fun Context.accentColor(): Int {
|
||||
}
|
||||
return ContextCompat.getColor(this, color)
|
||||
}
|
||||
|
||||
fun Context.shouldUseWebAPI(): Boolean {
|
||||
return Preferences.getBoolean(this, PREFERENCE_ADVANCED_USE_WEB_API)
|
||||
}
|
||||
|
||||
@@ -58,9 +58,6 @@ object Preferences {
|
||||
const val PREFERENCE_UPDATES_EXTENDED = "PREFERENCE_UPDATES_EXTENDED"
|
||||
const val PREFERENCE_UPDATES_CHECK = "PREFERENCE_UPDATES_CHECK"
|
||||
|
||||
const val PREFERENCE_ADVANCED_SEARCH_IN_CTT = "PREFERENCE_ADVANCED_SEARCH_IN_CTT"
|
||||
const val PREFERENCE_ADVANCED_USE_WEB_API = "PREFERENCE_ADVANCED_USE_WEB_API"
|
||||
|
||||
const val PREFERENCE_UNIQUE_GROUP_IDS = "PREFERENCE_UNIQUE_GROUP_IDS"
|
||||
|
||||
private var prefs: SharedPreferences? = null
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.aurora.store.view.ui.preferences
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.aurora.store.R
|
||||
|
||||
class AdvancedPreference : PreferenceFragmentCompat() {
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.preferences_advanced, rootKey)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
view.findViewById<Toolbar>(R.id.toolbar)?.apply {
|
||||
title = getString(R.string.title_advanced)
|
||||
setNavigationOnClickListener { findNavController().navigateUp() }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,10 +56,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
||||
findNavController().navigate(R.id.updatesPreference)
|
||||
true
|
||||
}
|
||||
findPreference<Preference>("pref_advanced")?.setOnPreferenceClickListener {
|
||||
findNavController().navigate(R.id.advancedPreference)
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
||||
@@ -141,17 +141,9 @@ class SearchSuggestionFragment : Fragment(R.layout.fragment_search_suggestion) {
|
||||
}
|
||||
|
||||
private fun search(query: String) {
|
||||
if (Preferences.getBoolean(
|
||||
requireContext(),
|
||||
Preferences.PREFERENCE_ADVANCED_SEARCH_IN_CTT
|
||||
)
|
||||
) {
|
||||
requireContext().browse("${Constants.PLAY_QUERY_URL}$query", true)
|
||||
} else {
|
||||
findNavController().navigate(
|
||||
SearchSuggestionFragmentDirections
|
||||
.actionSearchSuggestionFragmentToSearchResultsFragment(query)
|
||||
)
|
||||
}
|
||||
findNavController().navigate(
|
||||
SearchSuggestionFragmentDirections
|
||||
.actionSearchSuggestionFragmentToSearchResultsFragment(query)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user