Skip to content

Commit

Permalink
Merge pull request #201 from spocky/projectivy-launcher-support
Browse files Browse the repository at this point in the history
Add support for Projectivy Launcher
  • Loading branch information
sarsamurmu authored Dec 19, 2024
2 parents a111352 + c0fda61 commit d5dff67
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,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 @@ -690,6 +695,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: 6 additions & 0 deletions library/src/main/res/xml/dashboard_contributors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
image="https://github.com/maxtron95.png"
link="https://github.com/maxtron95" />

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

<contributor
name="Donno"
contribution=""
Expand Down

0 comments on commit d5dff67

Please sign in to comment.