Skip to content

Commit

Permalink
Merge pull request #21 from Donnnno/Projectivy-Launcher
Browse files Browse the repository at this point in the history
Add support for Projectivy Launcher
  • Loading branch information
Donnnno authored Dec 17, 2024
2 parents 709b4aa + 14ddff1 commit dd7b2e5
Show file tree
Hide file tree
Showing 6 changed files with 38 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 @@ -157,6 +157,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>
<!-- TSF Shell -->
<intent-filter>
<action android:name="com.tsf.shell.themes" />
Expand Down
2 changes: 2 additions & 0 deletions library/src/main/java/candybar/lib/helpers/IntentHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class IntentHelper {
private static final String ACTION_NOVA_LAUNCHER = "com.novalauncher.THEME";
private static final String ACTION_ONEPLUS_PICK_ICON = "net.oneplus.launcher.icons.ACTION_PICK_ICON";
private static final String ACTION_PLUS_HOME = "jp.co.a_tm.android.launcher.icons.ACTION_PICK_ICON";
private static final String ACTION_PROJECTIVY_PICK_ICON = "com.spocky.projengmenu.icons.ACTION_PICK_ICON";

public static int getAction(@Nullable Intent intent) {
if (intent == null) return ACTION_DEFAULT;
Expand All @@ -49,6 +50,7 @@ public static int getAction(@Nullable Intent intent) {
case ACTION_NOVA_LAUNCHER:
case ACTION_ONEPLUS_PICK_ICON:
case ACTION_PLUS_HOME:
case ACTION_PROJECTIVY_PICK_ICON:
return ICON_PICKER;
case Intent.ACTION_PICK:
case Intent.ACTION_GET_CONTENT:
Expand Down
25 changes: 25 additions & 0 deletions library/src/main/java/candybar/lib/helpers/LauncherHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ public enum Launcher {
R.drawable.ic_launcher_pixel,
new String[]{"com.google.android.apps.nexuslauncher"},
false),
PROJECTIVY(
"Projectivy",
R.drawable.ic_launcher_projectivy,
new String[]{"com.spocky.projengmenu"},
true),
SMART(
"Smart",
R.drawable.ic_launcher_smart,
Expand Down Expand Up @@ -693,6 +698,26 @@ private static void applyLauncher(@NonNull Context context, String launcherPacka
case POCO:
applyManual(context, launcherPackage, launcherName, "com.miui.home.settings.HomeSettingsActivity");
break;
case PROJECTIVY:
try {
final Intent projectivy = new Intent("com.spocky.projengmenu.APPLY_ICONPACK");
projectivy.setPackage("com.spocky.projengmenu");
projectivy.putExtra("com.spocky.projengmenu.extra.ICONPACK_PACKAGENAME", context.getPackageName());
projectivy.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(projectivy);
((AppCompatActivity) context).finish();
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
"click",
new HashMap<String, Object>() {{
put("section", "apply");
put("action", "confirm");
put("launcher", launcherPackage);
}}
);
} catch (ActivityNotFoundException | NullPointerException e) {
openGooglePlay(context, launcherPackage, launcherName);
}
break;
case ONEUI:
applyOneUI(context, launcherName);
break;
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/launchers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<item>oxygenos</item>
<item>pixel</item>
<item>poco</item>
<item>projectivy</item>
<item>realme_ui</item><!-- Will only be displayed if actually detected on device -->
<item>samsung_one_ui</item>
<item>smart</item>
Expand Down
6 changes: 5 additions & 1 deletion library/src/main/res/xml/dashboard_contributors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,9 @@
contribution=""
image="https://github.com/connyduck.png"
link="https://github.com/connyduck" />

<contributor
name="Spocky"
contribution=""
image="https://github.com/spocky.png"
link="https://github.com/spocky" />
</resources>

0 comments on commit dd7b2e5

Please sign in to comment.