diff --git a/app/src/main/res/values/supported_launchers.xml b/app/src/main/res/values/supported_launchers.xml index b7530ebdd..e5e9ee453 100644 --- a/app/src/main/res/values/supported_launchers.xml +++ b/app/src/main/res/values/supported_launchers.xml @@ -22,6 +22,7 @@ smart smartpro solo + square tsf \ No newline at end of file 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 97da1d1c9..b46dc97c8 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 @@ -82,6 +82,12 @@ enum class Launcher( R.drawable.ic_smart_pro ), SOLO("solo", "Solo Launcher", arrayOf("home.solo.launcher.free"), R.drawable.ic_solo), + SQUARE( + "square", + "Square Home Launcher", + arrayOf("com.ss.squarehome2"), + R.drawable.ic_square_home + ), TSF("tsf", "TSF Launcher", arrayOf("com.tsf.shell"), R.drawable.ic_tsf); val cleanAppName: String 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 c5a96105e..b23288b3b 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.SMART -> executeSmartLauncherIntent() Launcher.SMART_PRO -> executeSmartLauncherProIntent() Launcher.SOLO -> executeSoloLauncherIntent() + Launcher.SQUARE -> executeSquareHomeIntent() Launcher.TSF -> executeTsfLauncherIntent() else -> showLauncherApplyError() } @@ -245,7 +246,10 @@ private fun Context.executeNovaLauncherIntent() { private fun Context.executeOnePlusLauncherIntent() { attemptApply { Intent().apply { - component = ComponentName("net.oneplus.launcher", "net.oneplus.launcher.IconPackSelectorActivity") + component = ComponentName( + "net.oneplus.launcher", + "net.oneplus.launcher.IconPackSelectorActivity" + ) } } } @@ -286,6 +290,16 @@ private fun Context.executeSoloLauncherIntent() { } } +private fun Context.executeSquareHomeIntent() { + attemptApply { + Intent("com.ss.squarehome2.ACTION_APPLY_ICONPACK").apply { + component = + ComponentName.unflattenFromString("com.ss.squarehome2/.ApplyThemeActivity") + putExtra("com.ss.squarehome2.EXTRA_ICONPACK", packageName) + } + } +} + private fun Context.executeTsfLauncherIntent() { attemptApply { packageManager.getLaunchIntentForPackage("com.tsf.shell").also { diff --git a/library/src/main/res/values/supported_launchers.xml b/library/src/main/res/values/supported_launchers.xml index b7530ebdd..e5e9ee453 100644 --- a/library/src/main/res/values/supported_launchers.xml +++ b/library/src/main/res/values/supported_launchers.xml @@ -22,6 +22,7 @@ smart smartpro solo + square tsf \ No newline at end of file