zixpo / candybar

Dashboard for Android Icon Packs. Supported by the community.
Apache License 2.0
288 stars 53 forks source link

Exclude specific category from search #151

Closed flameshikari closed 7 months ago

flameshikari commented 1 year ago

Hello!

Is there a way to exclude a specific category from search? For example, in Delta Icon Pack we have 'New' category that shows new icons for the current release and also these icons present in their named categories, which means they show up from two categories when searching.

Would be nice to have this feature. Thanks!

sarsamurmu commented 1 year ago

It's currently not possible. I will add this functionality in the next version.

flameshikari commented 11 months ago

@sarsamurmu I see you added an option to exclude categories from search in 3cbe875ec88def31fe3b8dfa9c3d5b169d641844; thanks a lot for that. I've tried it, but it didn't work. The icon still appear from multiple categories. Maybe I did something wrong? By the way, what I did:

  1. Made changes according to this commit
  2. Added the option to CandyBar.java

    configuration.setExcludedCategoryForSearch(new String[]{"New"});

    A category name from drawable.xml to be sure:

     <!-- category that should be excluded -->
     <category title="New" />
sarsamurmu commented 11 months ago

Hmm, I will let you know after I check the issue

sarsamurmu commented 11 months ago

It's working fine for me, I don't know what's causing the issue

moertel commented 11 months ago

I can confirm that it's not working for me either. Could it be a logic error, @sarsamurmu? It seems that when the option .setShowTabAllIcons(true) is set, we never reach the else branch:

https://github.com/zixpo/candybar/blob/3cbe875ec88def31fe3b8dfa9c3d5b169d641844/library/src/main/java/candybar/lib/fragments/IconsSearchFragment.java#L247-L253

When I set .setShowTabAllIcons(false), it works.