Skip to content

Commit

Permalink
Add Firefox and Iceraven supports for QSB (#4793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Unofficial-Life authored Sep 14, 2024
1 parent a5b11e2 commit 3a1e4ec
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lawnchair/res/drawable/ic_firefox.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group>
<path
android:pathData="m98.9 37.7c-2.1-5.1-6.4-10.6-9.8-12.3 2.5 4.6 4.1 9.6 5 14.7v0.1c-5.5-13.7-14.9-19.2-22.5-31.3q-0.6-0.9-1.2-1.8-0.3-0.5-0.5-1-0.5-1-0.7-2 0 0-0.1-0.1 0 0-0.1 0 0 0 0 0 0 0-0.1 0 0 0 0 0c-10.8 6.3-15.3 17.4-16.5 24.5-3.3 0.2-6.6 1-9.7 2.5-0.2 0.1-0.5 0.4-0.6 0.7-0.1 0.3-0.1 0.6 0.1 0.9q0.2 0.5 0.7 0.7c0.3 0.1 0.6 0.1 0.9-0.1 2.7-1.2 5.5-2 8.4-2.2h0.3q0.6 0 1.2 0 3.6-0.1 7 0.9 0.2 0.1 0.4 0.2 0.6 0.1 1.1 0.4 0.4 0.1 0.8 0.3 0.4 0.1 0.7 0.2 0.5 0.2 1 0.5 0.2 0.1 0.4 0.2 0.5 0.3 1 0.5 0.3 0.2 0.6 0.4c3.5 2.2 6.5 5.2 8.5 8.8-3.4-2.4-7.6-3.4-11.7-2.8 17.5 8.7 12.8 38.8-11.5 37.7-2.2-0.1-4.3-0.5-6.4-1.2q-0.7-0.3-1.4-0.6-0.4-0.2-0.8-0.4c-6-3.1-10.9-8.9-11.5-15.9 0 0 2.2-8.4 16.1-8.4 1.5 0 5.8-4.2 5.9-5.4 0-0.4-8.5-3.7-11.8-7-1.8-1.7-2.6-2.6-3.4-3.2q-0.6-0.5-1.2-0.9c-1.2-3.9-1.2-8-0.2-11.9-4.5 2.1-8.5 5.2-11.7 9-2-2.4-1.9-10.5-1.8-12.2q-0.8 0.4-1.6 0.9c-1.7 1.2-3.3 2.6-4.7 4.1q-2.5 2.5-4.6 5.4c-3.1 4.5-5.4 9.5-6.6 14.8q-0.4 2.2-0.7 4.5-0.1 0.5-0.2 1.1-0.2 1.4-0.3 2.8 0 0 0 0.1 0 0.8-0.1 1.6v0.3c0.1 12.2 4.8 24 13 32.9 8.3 9 19.6 14.5 31.7 15.5 12.1 1.1 24.2-2.5 33.8-9.9 9.7-7.5 16.2-18.3 18.4-30.3q0.1-0.9 0.2-1.9c1-8.2-0.1-16.7-3.2-24.4z"
android:fillColor="#ff5a32"/>
</group>
</vector>
12 changes: 12 additions & 0 deletions lawnchair/res/drawable/ic_firefox_tinted.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group>
<path
android:pathData="m98.9 37.7c-2.1-5.1-6.4-10.6-9.8-12.3 2.5 4.6 4.1 9.6 5 14.7v0.1c-5.5-13.7-14.9-19.2-22.5-31.3q-0.6-0.9-1.2-1.8-0.3-0.5-0.5-1-0.5-1-0.7-2 0 0-0.1-0.1 0 0-0.1 0 0 0 0 0 0 0-0.1 0 0 0 0 0c-10.8 6.3-15.3 17.4-16.5 24.5-3.3 0.2-6.6 1-9.7 2.5-0.2 0.1-0.5 0.4-0.6 0.7-0.1 0.3-0.1 0.6 0.1 0.9q0.2 0.5 0.7 0.7c0.3 0.1 0.6 0.1 0.9-0.1 2.7-1.2 5.5-2 8.4-2.2h0.3q0.6 0 1.2 0 3.6-0.1 7 0.9 0.2 0.1 0.4 0.2 0.6 0.1 1.1 0.4 0.4 0.1 0.8 0.3 0.4 0.1 0.7 0.2 0.5 0.2 1 0.5 0.2 0.1 0.4 0.2 0.5 0.3 1 0.5 0.3 0.2 0.6 0.4c3.5 2.2 6.5 5.2 8.5 8.8-3.4-2.4-7.6-3.4-11.7-2.8 17.5 8.7 12.8 38.8-11.5 37.7-2.2-0.1-4.3-0.5-6.4-1.2q-0.7-0.3-1.4-0.6-0.4-0.2-0.8-0.4c-6-3.1-10.9-8.9-11.5-15.9 0 0 2.2-8.4 16.1-8.4 1.5 0 5.8-4.2 5.9-5.4 0-0.4-8.5-3.7-11.8-7-1.8-1.7-2.6-2.6-3.4-3.2q-0.6-0.5-1.2-0.9c-1.2-3.9-1.2-8-0.2-11.9-4.5 2.1-8.5 5.2-11.7 9-2-2.4-1.9-10.5-1.8-12.2q-0.8 0.4-1.6 0.9c-1.7 1.2-3.3 2.6-4.7 4.1q-2.5 2.5-4.6 5.4c-3.1 4.5-5.4 9.5-6.6 14.8q-0.4 2.2-0.7 4.5-0.1 0.5-0.2 1.1-0.2 1.4-0.3 2.8 0 0 0 0.1 0 0.8-0.1 1.6v0.3c0.1 12.2 4.8 24 13 32.9 8.3 9 19.6 14.5 31.7 15.5 12.1 1.1 24.2-2.5 33.8-9.9 9.7-7.5 16.2-18.3 18.4-30.3q0.1-0.9 0.2-1.9c1-8.2-0.1-16.7-3.2-24.4z"
android:fillColor="#000000"/>
</group>
</vector>
14 changes: 14 additions & 0 deletions lawnchair/res/drawable/ic_iceraven.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="m31.6 25.8l2-2.4q0 0 0.1 0l2.1-2.2q0 0 0.1-0.1l2.3-2q0 0 0 0l2.5-1.8q0 0 0-0.1l2.6-1.5q0.1-0.1 0.1-0.1l2.7-1.3q0 0 0.1-0.1l2.8-1q0-0.1 0.1-0.1l2.8-0.8q0.1 0 0.1 0l2.9-0.7q0.1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9 0.6h0.1l-2.9 0.8h0.1l-2.8 1.1h0.1l-2.7 1.3 0.1-0.1-2.6 1.6h0.1l-2.5 1.7h0.1l-2.3 2 0.1-0.1-2.2 2.2 0.1-0.1-1.9 2.4c-0.4 0.5-1.1 0.5-1.6 0.1-0.4-0.4-0.5-1.2-0.1-1.6z"
android:strokeLineJoin="miter"
android:fillColor="#055493"/>
<path
android:pathData="m48.3 7c-6.3 0.1-12.9 2.2-15.9 3.8-12.5 7.1-18 13.2-26.4 22.3l8.8-6.3c-4.1 5.7-7 14-7.4 23.4-0.2 4.4 0.3 12.4 2.8 18.4 3.1 7.4 6.5 11.5 10.2 14.4q0.1 0.1 0.3 0.2l1.9 1.3c8.1 2.8 13.9 3.8 20.7 3.8 2 0 4-0.2 5.7-0.6 5.5-1.3 10.2-4.8 14.8-9.5 2.5-2.8 4.6-6.5 6.3-11.4 2-5.6 2.6-10.2 1.8-15.2-2.9 4-5.5 4.3-5.6 4.3 0 0 5.4-9.4 7.3-17.2-6.7 5.7-12.9 9.2-18.6 10.5-3.6 0.8-6.9 1.3-9.9 1.3q-5.7 0-9.9-2.1c-3.2-6.9-3.9-13-1.9-18.3 0.9-2.4 2.3-4.6 4-6.7l11-16.4zm44.7 24.2c3.2 10.9 4.8 16.5-0.2 28.9-5.8 14.2-15 18-22.7 18.6-5.8 6.4-12.2 12-20 13.8-2.2 0.6-4.4 0.8-6.7 0.8q-2.5 0-5.1-0.3l-7.2-1.1c3.6 3.1 12.4 7.2 17 8.1 3.9 0.7 9.6 0.8 13.1 0.8 19.3 0 33.4-13.6 39.2-32.8 3.7-12 0.8-25.8-1.3-35.5l-0.1 10.8-6-12.1z"
android:strokeLineJoin="miter"
android:fillColor="#055493"/>
</vector>
14 changes: 14 additions & 0 deletions lawnchair/res/drawable/ic_iceraven_tinted.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="108"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8-1.3-35.5l-0.1 10.8-6-12.1z"
android:strokeLineJoin="miter"
android:fillColor="#000000"/>
</vector>
2 changes: 2 additions & 0 deletions lawnchair/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@
<string name="search_provider_youtube" translatable="false">YouTube</string>
<string name="search_provider_pixel_search" translatable="false">Pixel Search</string>
<string name="search_provider_yandex" translatable="false">Yandex</string>
<string name="search_provider_firefox" translatable="false">Firefox</string>
<string name="search_provider_iceraven" translatable="false">Iceraven</string>

<string name="search_provider_sponsored_description">%1$s and Lawnchair have a revenue share agreement.\n\nSearching with %1$s helps support Lawnchair.</string>

Expand Down
25 changes: 25 additions & 0 deletions lawnchair/src/app/lawnchair/qsb/providers/Firefox.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package app.lawnchair.qsb.providers

import android.content.Intent
import app.lawnchair.qsb.ThemingMethod
import com.android.launcher3.R

data object Firefox : QsbSearchProvider(
id = "Firefox",
name = R.string.search_provider_firefox,
icon = R.drawable.ic_firefox,
themedIcon = R.drawable.ic_firefox_tinted,
themingMethod = ThemingMethod.TINT,
packageName = "org.mozilla.firefox",
action = "org.mozilla.fenix.OPEN_TAB",
className = "org.mozilla.fenix.IntentReceiverActivity",
website = "https://play.google.com/store/apps/details?id=org.mozilla.firefox",
type = QsbSearchProviderType.APP,
supportVoiceIntent = false,
) {

override fun handleCreateVoiceIntent(): Intent =
Intent(action)
.addFlags(INTENT_FLAGS)
.setClassName(packageName, "org.chromium.chrome.browser.VoiceSearchActivity")
}
25 changes: 25 additions & 0 deletions lawnchair/src/app/lawnchair/qsb/providers/Iceraven.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package app.lawnchair.qsb.providers

import android.content.Intent
import app.lawnchair.qsb.ThemingMethod
import com.android.launcher3.R

data object Iceraven : QsbSearchProvider(
id = "Iceraven",
name = R.string.search_provider_iceraven,
icon = R.drawable.ic_iceraven,
themedIcon = R.drawable.ic_iceraven_tinted,
themingMethod = ThemingMethod.TINT,
packageName = "io.github.forkmaintainers.iceraven",
action = "org.mozilla.fenix.OPEN_TAB",
className = "org.mozilla.fenix.IntentReceiverActivity",
website = "github.com/fork-maintainers/iceraven-browser/releases/latest",
type = QsbSearchProviderType.APP,
supportVoiceIntent = true,
) {

override fun handleCreateVoiceIntent(): Intent =
Intent(action)
.addFlags(INTENT_FLAGS)
.setClassName(packageName, "org.chromium.chrome.browser.VoiceSearchActivity")
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ sealed class QsbSearchProvider(
Bing,
Brave,
Yandex,
Firefox,
Iceraven,
Startpage,
)

Expand Down

0 comments on commit 3a1e4ec

Please sign in to comment.