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

Enable use of CandyBar as a library #216

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

moertel
Copy link
Contributor

@moertel moertel commented Jan 21, 2025

This PR is a big refactoring accomplishing two things:

  1. All information that we have about launchers is now neatly encapsulated. Most notably, calling apps can use these methods:
    • supportsIconPacks
    • supportsDirectApply
    • supportsManualApply
    • applyDirectly
    • applyManually
  2. There's now a standard flow of events that all launchers adhere to automatically. No more forgetting ((AppCompatActivity) context).finish() and no more ambiguity whether Google Play is opened as a fallback. :) It's now easier than ever to spot if launchers are missing information. For example Blackberry where we used to open the MainActivity but without any instructions whatsoever. Fixing this is out of scope of this PR but it's now a clearly visible flaw in the definition.

If more freedom is necessary, launchers also offer DirectApply.getActivity (and DirectApply.getBroadcast if necessary) and ManualApply.getInstructionSteps.

Why?

After 3 years of using CandyBar, I now feel like I've outgrown the UI and Icon Request mechanics but I don't want to make a whole new fork of the library. Instead, I want to keep CandyBar as a dependency and leverage the sane defaults for the icon picker, etc., but build a new UI on top. :)

I believe the refactoring makes sense far beyond that, as it should invite more contributions: More manual descriptions as a fallback if the direct apply fails for whatever reason, links to settings in the respective launchers, you name it.

@moertel moertel changed the title Enable use of CandyBar as a library [WIP - DO NOT MERGE] Enable use of CandyBar as a library Jan 21, 2025
@moertel moertel marked this pull request as draft January 21, 2025 21:35
@moertel moertel changed the title [WIP - DO NOT MERGE] Enable use of CandyBar as a library Enable use of CandyBar as a library Jan 21, 2025
@moertel
Copy link
Contributor Author

moertel commented Jan 21, 2025

@sarsamurmu is this something you can imagine to merge? It's still a work in progress and I'd be testing this in my own apps for 1-2 months before requesting a merge, but before I go that route and invest more time, I want to see whether this change would be welcome.

@sarsamurmu
Copy link
Collaborator

@moertel Yeah, we can merge that. I always wanted to improve the overall code structure to make things more modular, but I guess I never got enough motivation. So, thanks for these improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants