Skip to content

Introduce icon tags for search - #249

Draft
moertel wants to merge 4 commits into
zixpo:mainfrom
moertel:icon-tagging
Draft

Introduce icon tags for search#249
moertel wants to merge 4 commits into
zixpo:mainfrom
moertel:icon-tagging

Conversation

@moertel

@moertel moertel commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This commit introduces a new XML file icon_tags.xml that contains a mapping from drawable to a list of tags. The tags are translatable, so users searching in their native language get a better chance of matching an icon rather than just searching by app title.

The feature is behind a feature flag enable_icons_tag_search which is false by default, so devs need to opt-in explicitly to make use of the feature.

It would have been easier to store tags in drawables.xml directly but there is reason to believe that some launchers don't cope well with unknown xml tag names. So this feature is a plugin by design.

Open Questions

  • Tags perform "exact match" if query is shorter than 2 characters, so we don't get all tags with the letter "f", for example. Should this threshold be configurable? Is there a use case where matching on two letters is bad?
  • Does this raise performance problems for large apps? Especially as this adds a full loop on all the icons in the section.
  • How can we make this consumable by a launcher's own icon search feature without repeating the entire XML parsing process? Perhaps via an explicit ContentProvider? Probably out of scope for this PR but still potentially useful as we could index icons, names and tags via AppSearch (https://developer.android.com/jetpack/androidx/releases/appsearch)

Refs #224

This commit introduces a new XML file `icon_tags.xml` that contains a mapping
from drawable to a list of tags. The tags are translatable, so users
searching in their native language get a better chance of matching an icon
rather than just searching by app title.

The feature is behind a feature flag `enable_icons_tag_search` which is false
by default, so users need to opt-in explicitly to make use of the feature.

It would have been easier to store tags in `drawables.xml` directly but there
is reason to believe that some launchers don't cope well with unknown xml tag
names. So this feature is a plugin by design.
@moertel

moertel commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@sarsamurmu, @Donnnno, @Kaiserdragon2 open for feedback! :)

Screenshot_20260708_202752

@Donnnno

Donnnno commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Only seeing this now, but it sounds impressive!

With the way that CandyBar defines icons and categories and how titles and tags
have to be computed before they're populated, it was incredibly easy to miss a
step and end up with the wrong result set.

This commit adds a dedicated Content Provider to CandyBar that allows all apps
on the system (not just CandyBar itself) to query icons from the app, get their
drawable IDs or categories, or to search them by name or tag.

Prefix-search is used by default and delivers snappy results in <10ms even for
large icon packs. Be super careful with enabling substring search as this falls
back to regular Java `contains` functionality on every single icon and can
easily reach latencies of 100ms which can be visible in the UI.
This makes icon packs and other apps completely independent from the library
interface. Instead, a list of categories (order is preserved) can be queried
from the ContentProvider and then the list of icons can be retrieved for each.
That allows for lazy-loading of categories. Just a few of them are visible at
any point in time anyway.
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