Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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:

  1. Google Play categories

    • toCategory() was still extracting the category ID from cat=...&c=...
    • the current gplayapi response 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
  2. Open Source categories

    • CleanAPK now returns many newer, more specific slugs such as browser, wallet, voice-video-chat, workout, etc.
    • CategoryUtils only mapped the older broader category IDs, so these newer slugs fell back to ic_cat_default

Changes

  • updated GPlay category ID parsing to support:
    • current path-based URLs
    • legacy query-based URLs
  • extended categoryIconMap with 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, and workout

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

👪 ❤️ code review guidelines

Edited by Fahim M. Choudhury

Merge request reports

Loading