Draft: fix: fix icons in the Categories screen
Description
The Categories screen was falling back to the generic icon for many entries even though suitable icons already existed. This MR fixes the loading of the icons and also assigns icons to the newly added categories.
Screen record
Technical details
There were two separate causes:
-
Google Play categories
-
toCategory()was still extracting the category ID fromcat=...&c=... - the current
gplayapiresponse uses path-style URLs such as/store/apps/category/ART_AND_DESIGN - this caused IDs to be parsed incorrectly, so valid categories missed the icon map
-
-
Open Source categories
- CleanAPK now returns many newer, more specific slugs such as
browser,wallet,voice-video-chat,workout, etc. -
CategoryUtilsonly mapped the older broader category IDs, so these newer slugs fell back toic_cat_default
- CleanAPK now returns many newer, more specific slugs such as
Changes
- updated GPlay category ID parsing to support:
- current path-based URLs
- legacy query-based URLs
- extended
categoryIconMapwith aliases for the current CleanAPK Open Source category slugs using existing drawable resources - added tests covering:
- current GPlay path-style category URLs
- legacy GPlay query-style category URLs
- representative CleanAPK aliases such as
browser,wallet,voice-video-chat, andworkout
Notes
This MR only reuses existing icons. It does not add new artwork.
Tests
Issues
https://gitlab.e.foundation/e/os/backlog/-/work_items/3928
10 commandments of code review
Edited by Fahim M. Choudhury