Skip to content

Commit

Permalink
Merge pull request #321 from spocky/projectivy-launcher-support
Browse files Browse the repository at this point in the history
  • Loading branch information
jahirfiquitiva authored Jan 5, 2025
2 parents 1d5e9ad + b5606ea commit 0db928f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
<action android:name="net.oneplus.launcher.icons.ACTION_PICK_ICON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Projectivy Launcher -->
<intent-filter>
<action android:name="com.spocky.projengmenu.icons.ACTION_PICK_ICON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Smart Launcher -->
<intent-filter>
<action android:name="ginlemon.smartlauncher.THEMES" />
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/supported_launchers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<item>oneplus</item>
<item>pixel</item>
<item>posidon</item>
<item>projectivy</item>
<item>smart</item>
<item>smartpro</item>
<item>solo</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ enum class Launcher(
false
),
POSIDON("posidon", "Posidon Launcher", arrayOf("posidon.launcher"), R.drawable.ic_posidon),
PROJECTIVY("projectivy", "Projectivy Launcher", arrayOf("com.spocky.projengmenu"), R.drawable.ic_projectivy),
SMART("smart", "Smart Launcher", arrayOf("ginlemon.flowerfree"), R.drawable.ic_smart),
SMART_PRO(
"smartpro",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dev.jahir.blueprint.extensions

// Intent related stuff
const val REQUEST_CODE = "request_code"
const val PROJECTIVY_ACTION = "com.spocky.projengmenu.icons.ACTION_PICK_ICON"
const val ADW_ACTION = "org.adw.launcher.icons.ACTION_PICK_ICON"
const val TURBO_ACTION = "com.phonemetra.turbo.launcher.icons.ACTION_PICK_ICON"
const val NOVA_ACTION = "com.novalauncher.THEME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fun Context.executeLauncherIntent(launcher: Launcher?) {
Launcher.NOVA -> executeNovaLauncherIntent()
Launcher.ONEPLUS -> executeOnePlusLauncherIntent()
Launcher.POSIDON -> executePosidonLauncherIntent()
Launcher.PROJECTIVY -> executeProjectivyLauncherIntent()
Launcher.SMART -> executeSmartLauncherIntent()
Launcher.SMART_PRO -> executeSmartLauncherProIntent()
Launcher.SOLO -> executeSoloLauncherIntent()
Expand Down Expand Up @@ -289,6 +290,16 @@ private fun Context.executePosidonLauncherIntent() {
}
}

private fun Context.executeProjectivyLauncherIntent() {
attemptApply(Launcher.PROJECTIVY) {
Intent("com.spocky.projengmenu.APPLY_ICONPACK").apply {
`package` = "com.spocky.projengmenu"
putExtra("com.spocky.projengmenu.extra.ICONPACK_PACKAGENAME", packageName)
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
}
}

private fun Context.executeSmartLauncherIntent() {
attemptApply(Launcher.SMART) {
Intent("ginlemon.smartlauncher.setGSLTHEME").apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import dev.jahir.blueprint.extensions.ICONS_APPLIER
import dev.jahir.blueprint.extensions.ICONS_PICKER
import dev.jahir.blueprint.extensions.IMAGE_PICKER
import dev.jahir.blueprint.extensions.NOVA_ACTION
import dev.jahir.blueprint.extensions.PROJECTIVY_ACTION
import dev.jahir.blueprint.extensions.TURBO_ACTION
import dev.jahir.blueprint.extensions.WALLS_PICKER
import dev.jahir.blueprint.extensions.defaultLauncher
Expand Down Expand Up @@ -82,7 +83,7 @@ abstract class BlueprintActivity : FramesActivity(), RequestCallback {
return intent?.let {
when (it.action) {
APPLY_ACTION -> ICONS_APPLIER
ADW_ACTION, TURBO_ACTION, NOVA_ACTION -> ICONS_PICKER
ADW_ACTION, TURBO_ACTION, NOVA_ACTION, PROJECTIVY_ACTION -> ICONS_PICKER
Intent.ACTION_PICK, Intent.ACTION_GET_CONTENT -> IMAGE_PICKER
Intent.ACTION_SET_WALLPAPER -> WALLS_PICKER
else -> field
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions library/src/main/res/values/supported_launchers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<item>oneplus</item>
<item>pixel</item>
<item>posidon</item>
<item>projectivy</item>
<item>smart</item>
<item>smartpro</item>
<item>solo</item>
Expand Down

0 comments on commit 0db928f

Please sign in to comment.