mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
feat(search): remove unneeded allApps parameter in query function
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package app.lawnchair.search.engine
|
||||
|
||||
import android.content.Context
|
||||
import com.android.launcher3.model.AllAppsList
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
/**
|
||||
@@ -22,12 +21,10 @@ interface SearchProvider {
|
||||
*
|
||||
* @param context The application context.
|
||||
* @param query The user's search query.
|
||||
* @param allApps (Optional) The current list of all apps, for providers that require apps.
|
||||
* @return A Flow that emits a list of [SearchResult]s.
|
||||
*/
|
||||
fun search(
|
||||
context: Context,
|
||||
query: String,
|
||||
allApps: AllAppsList? = null,
|
||||
): Flow<List<SearchResult>>
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import app.lawnchair.search.algorithms.data.Calculation
|
||||
import app.lawnchair.search.algorithms.data.calculator.Expressions
|
||||
import app.lawnchair.search.engine.SearchProvider
|
||||
import app.lawnchair.search.engine.SearchResult
|
||||
import com.android.launcher3.model.AllAppsList
|
||||
import java.math.BigDecimal
|
||||
import java.math.MathContext
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -19,7 +18,6 @@ object CalculatorSearchProvider : SearchProvider {
|
||||
override fun search(
|
||||
context: Context,
|
||||
query: String,
|
||||
allApps: AllAppsList?,
|
||||
): Flow<List<SearchResult>> = flow {
|
||||
val legacyPrefs = PreferenceManager.getInstance(context)
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import app.lawnchair.preferences2.PreferenceManager2
|
||||
import app.lawnchair.search.algorithms.data.ContactInfo
|
||||
import app.lawnchair.search.engine.SearchProvider
|
||||
import app.lawnchair.search.engine.SearchResult
|
||||
import com.android.launcher3.model.AllAppsList
|
||||
import com.patrykmichalik.opto.core.firstBlocking
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -25,7 +24,6 @@ object ContactsSearchProvider : SearchProvider {
|
||||
override fun search(
|
||||
context: Context,
|
||||
query: String,
|
||||
allApps: AllAppsList?,
|
||||
): Flow<List<SearchResult>> = flow {
|
||||
val prefs = PreferenceManager.getInstance(context)
|
||||
val prefs2 = PreferenceManager2.getInstance(context)
|
||||
|
||||
@@ -16,7 +16,6 @@ import app.lawnchair.util.isDirectory
|
||||
import app.lawnchair.util.isHidden
|
||||
import app.lawnchair.util.isRegularFile
|
||||
import app.lawnchair.util.mimeType2Extension
|
||||
import com.android.launcher3.model.AllAppsList
|
||||
import com.patrykmichalik.opto.core.firstBlocking
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -30,7 +29,6 @@ object FileSearchProvider : SearchProvider {
|
||||
override fun search(
|
||||
context: Context,
|
||||
query: String,
|
||||
allApps: AllAppsList?,
|
||||
): Flow<List<SearchResult>> = flow {
|
||||
val prefs = PreferenceManager.getInstance(context)
|
||||
val prefs2 = PreferenceManager2.getInstance(context)
|
||||
|
||||
@@ -8,7 +8,6 @@ import app.lawnchair.preferences2.PreferenceManager2
|
||||
import app.lawnchair.search.algorithms.data.SettingInfo
|
||||
import app.lawnchair.search.engine.SearchProvider
|
||||
import app.lawnchair.search.engine.SearchResult
|
||||
import com.android.launcher3.model.AllAppsList
|
||||
import com.patrykmichalik.opto.core.firstBlocking
|
||||
import java.lang.reflect.Modifier
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
@@ -24,7 +23,6 @@ object SettingsSearchProvider : SearchProvider {
|
||||
override fun search(
|
||||
context: Context,
|
||||
query: String,
|
||||
allApps: AllAppsList?,
|
||||
): Flow<List<SearchResult>> = flow {
|
||||
// We get the preference manager instance when needed, using the passed context.
|
||||
val prefs = PreferenceManager.getInstance(context)
|
||||
|
||||
@@ -5,7 +5,6 @@ import app.lawnchair.preferences.PreferenceManager
|
||||
import app.lawnchair.preferences2.PreferenceManager2
|
||||
import app.lawnchair.search.engine.SearchProvider
|
||||
import app.lawnchair.search.engine.SearchResult
|
||||
import com.android.launcher3.model.AllAppsList
|
||||
import com.patrykmichalik.opto.core.firstBlocking
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.emptyFlow
|
||||
@@ -17,7 +16,6 @@ object WebSuggestionProvider : SearchProvider {
|
||||
override fun search(
|
||||
context: Context,
|
||||
query: String,
|
||||
allApps: AllAppsList?,
|
||||
): Flow<List<SearchResult>> {
|
||||
val prefs = PreferenceManager.getInstance(context)
|
||||
val prefs2 = PreferenceManager2.getInstance(context)
|
||||
|
||||
Reference in New Issue
Block a user