Tweak Pixel Search QSB UI (#3457)

* `PixelSearch.kt` - use google logo

* `LawnQsbLayout.kt` -  Add Pixel Search to providers with mic/lens support

Pixel Search app technically needs Google to do the tasks, so this is added.

* `LawnQsbLayout.kt` - import PixelSearch

why did i forgor

* Update PixelSearch.kt

* reorganize providers in QsbSearchProvider.kt

* PixelSearch.kt: use voice command intent

* Update PixelSearch.kt
This commit is contained in:
SuperDragonXD authored and GitHub committed 2023-05-09 19:18:49 +08:00
1 parent 516fd4f50e
commit b8e491eecd
3 files changed
+18 -9

No files matched your search

@@ -23,6 +23,7 @@ import app.lawnchair.preferences2.subscribeBlocking
import app.lawnchair.qsb.providers.AppSearch
import app.lawnchair.qsb.providers.Google
import app.lawnchair.qsb.providers.GoogleGo
import app.lawnchair.qsb.providers.PixelSearch
import app.lawnchair.qsb.providers.QsbSearchProvider
import app.lawnchair.util.pendingIntent
import app.lawnchair.util.recursiveChildren
@@ -67,8 +68,8 @@ class LawnQsbLayout(context: Context, attrs: AttributeSet?) : FrameLayout(contex
clipIconRipples()
val searchProvider = getSearchProvider(context, preferenceManager2)
val isGoogle = searchProvider == Google || searchProvider == GoogleGo
val supportsLens = searchProvider == Google
val isGoogle = searchProvider == Google || searchProvider == GoogleGo || searchProvider == PixelSearch
val supportsLens = searchProvider == Google || searchProvider == PixelSearch
preferenceManager2.themedHotseatQsb.subscribeBlocking(scope = viewAttachedScope) { themed ->
setUpBackground(themed)
@@ -1,14 +1,22 @@
package app.lawnchair.qsb.providers
import android.content.Intent
import app.lawnchair.qsb.ThemingMethod
import com.android.launcher3.R
object PixelSearch : QsbSearchProvider(
id = "pixel_search",
name = R.string.search_provider_pixel_search,
icon = R.drawable.ic_qsb_search,
themingMethod = ThemingMethod.TINT,
// Use same style as Google Search
icon = R.drawable.ic_super_g_color,
themingMethod = ThemingMethod.THEME_BY_LAYER_ID,
packageName = "rk.android.app.pixelsearch",
website = "https://play.google.com/store/apps/details?id=rk.android.app.pixelsearch",
type = QsbSearchProviderType.APP,
)
supportVoiceIntent = true,
) {
override fun handleCreateVoiceIntent(): Intent =
Intent(Intent.ACTION_VOICE_COMMAND)
}
@@ -119,14 +119,14 @@ sealed class QsbSearchProvider(
AppSearch,
Google,
GoogleGo,
PixelSearch,
Sesame,
Wikipedia,
GitHub,
DuckDuckGo,
Presearch,
Wikipedia,
Bing,
Sesame,
Brave,
GitHub,
PixelSearch,
)
/**