diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a940e351f..a73de3224 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -147,6 +147,11 @@ + + + + + diff --git a/app/src/main/res/values/supported_launchers.xml b/app/src/main/res/values/supported_launchers.xml index 50307584a..bfe33e0e1 100644 --- a/app/src/main/res/values/supported_launchers.xml +++ b/app/src/main/res/values/supported_launchers.xml @@ -21,6 +21,7 @@ oneplus pixel posidon + projectivy smart smartpro solo diff --git a/library/src/main/kotlin/dev/jahir/blueprint/data/models/Launcher.kt b/library/src/main/kotlin/dev/jahir/blueprint/data/models/Launcher.kt index 0f0e51291..9d284b5e2 100644 --- a/library/src/main/kotlin/dev/jahir/blueprint/data/models/Launcher.kt +++ b/library/src/main/kotlin/dev/jahir/blueprint/data/models/Launcher.kt @@ -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", diff --git a/library/src/main/kotlin/dev/jahir/blueprint/extensions/Intent.kt b/library/src/main/kotlin/dev/jahir/blueprint/extensions/Intent.kt index 223d3f56f..43bbe8c25 100644 --- a/library/src/main/kotlin/dev/jahir/blueprint/extensions/Intent.kt +++ b/library/src/main/kotlin/dev/jahir/blueprint/extensions/Intent.kt @@ -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" diff --git a/library/src/main/kotlin/dev/jahir/blueprint/extensions/Launchers.kt b/library/src/main/kotlin/dev/jahir/blueprint/extensions/Launchers.kt index 421afa6b6..1a0d108c7 100644 --- a/library/src/main/kotlin/dev/jahir/blueprint/extensions/Launchers.kt +++ b/library/src/main/kotlin/dev/jahir/blueprint/extensions/Launchers.kt @@ -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() @@ -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 { diff --git a/library/src/main/kotlin/dev/jahir/blueprint/ui/activities/BlueprintActivity.kt b/library/src/main/kotlin/dev/jahir/blueprint/ui/activities/BlueprintActivity.kt index aabeaa578..ade75416f 100644 --- a/library/src/main/kotlin/dev/jahir/blueprint/ui/activities/BlueprintActivity.kt +++ b/library/src/main/kotlin/dev/jahir/blueprint/ui/activities/BlueprintActivity.kt @@ -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 @@ -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 diff --git a/library/src/main/res/drawable-nodpi/ic_projectivy.png b/library/src/main/res/drawable-nodpi/ic_projectivy.png new file mode 100644 index 000000000..30256216e Binary files /dev/null and b/library/src/main/res/drawable-nodpi/ic_projectivy.png differ diff --git a/library/src/main/res/values/supported_launchers.xml b/library/src/main/res/values/supported_launchers.xml index be92567ae..9acce675f 100644 --- a/library/src/main/res/values/supported_launchers.xml +++ b/library/src/main/res/values/supported_launchers.xml @@ -21,6 +21,7 @@ oneplus pixel posidon + projectivy smart smartpro solo