From 6ec76382602e7de67cdf710a022821c6ca525ee4 Mon Sep 17 00:00:00 2001 From: MrSluffy Date: Wed, 15 Jan 2025 15:13:21 +0800 Subject: [PATCH] enh : update constant shift value - fixes missing web search tile --- .../search/LawnchairSearchAdapterProvider.kt | 22 +++++++++---------- .../search/algorithms/data/History.kt | 3 ++- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lawnchair/src/app/lawnchair/search/LawnchairSearchAdapterProvider.kt b/lawnchair/src/app/lawnchair/search/LawnchairSearchAdapterProvider.kt index f17d504ff9..855e9e9874 100644 --- a/lawnchair/src/app/lawnchair/search/LawnchairSearchAdapterProvider.kt +++ b/lawnchair/src/app/lawnchair/search/LawnchairSearchAdapterProvider.kt @@ -97,17 +97,17 @@ class LawnchairSearchAdapterProvider( override fun getDecorator() = decorator companion object { - private const val SEARCH_RESULT_ICON = (1 shl 8) or AllAppsGridAdapter.VIEW_TYPE_ICON - private const val SEARCH_RESULT_ICON_ROW = 1 shl 9 - private const val SEARCH_RESULT_SMALL_ICON_ROW = 1 shl 10 - private const val SEARCH_RESULT_DIVIDER = 1 shl 11 - private const val SEARCH_TEXT_HEADER = 1 shl 12 - private const val SEARCH_PEOPLE_TILE = 1 shl 13 - private const val SEARCH_RESULT_FILE_TILE = 1 shl 14 - private const val SEARCH_RESULT_SUGGESTION_TILE = 1 shl 15 - private const val SEARCH_RESULT_SETTINGS_TILE = 1 shl 16 - private const val SEARCH_RESULT_RECENT_TILE = 1 shl 17 - private const val SEARCH_RESULT_CALCULATOR = 1 shl 18 + private const val SEARCH_RESULT_ICON = (1 shl 10) or AllAppsGridAdapter.VIEW_TYPE_ICON + private const val SEARCH_RESULT_ICON_ROW = 1 shl 11 + private const val SEARCH_RESULT_SMALL_ICON_ROW = 1 shl 12 + private const val SEARCH_RESULT_DIVIDER = 1 shl 13 + private const val SEARCH_TEXT_HEADER = 1 shl 14 + private const val SEARCH_PEOPLE_TILE = 1 shl 15 + private const val SEARCH_RESULT_FILE_TILE = 1 shl 16 + private const val SEARCH_RESULT_SUGGESTION_TILE = 1 shl 17 + private const val SEARCH_RESULT_SETTINGS_TILE = 1 shl 18 + private const val SEARCH_RESULT_RECENT_TILE = 1 shl 19 + private const val SEARCH_RESULT_CALCULATOR = 1 shl 20 val viewTypeMap = mapOf( LayoutType.ICON_SINGLE_VERTICAL_TEXT to SEARCH_RESULT_ICON, diff --git a/lawnchair/src/app/lawnchair/search/algorithms/data/History.kt b/lawnchair/src/app/lawnchair/search/algorithms/data/History.kt index 2608fdae0d..19204f3646 100644 --- a/lawnchair/src/app/lawnchair/search/algorithms/data/History.kt +++ b/lawnchair/src/app/lawnchair/search/algorithms/data/History.kt @@ -5,6 +5,7 @@ import android.content.Context import android.database.Cursor import android.net.Uri import android.util.Log +import androidx.core.net.toUri import app.lawnchair.search.LawnchairRecentSuggestionProvider import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -29,7 +30,7 @@ suspend fun getRecentKeyword(context: Context, query: String, max: Int, callback withContext(Dispatchers.IO) { val contentResolver: ContentResolver = context.contentResolver val uri: Uri = - Uri.parse("content://${LawnchairRecentSuggestionProvider.AUTHORITY}/suggestions") + "content://${LawnchairRecentSuggestionProvider.AUTHORITY}/suggestions".toUri() val cursor: Cursor? = contentResolver.query(uri, null, null, null, null) val recentKeywords = mutableListOf()