Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Projectivy Launcher #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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