Skip to content

Fix: flag menu icons sometimes appear without colors#20469

Closed
AayushKrGupta wants to merge 6 commits intoankidroid:mainfrom
AayushKrGupta:fix-flag-color-render
Closed

Fix: flag menu icons sometimes appear without colors#20469
AayushKrGupta wants to merge 6 commits intoankidroid:mainfrom
AayushKrGupta:fix-flag-color-render

Conversation

@AayushKrGupta
Copy link

Fixes #20464

Issue:
Flag icons in the reviewer menu sometimes appear grey instead of their assigned color.
Closing and reopening the menu restores the colors.

Cause:
Drawable instances were reused without ensuring tint was applied during each UI binding.

Solution:
• Ensure drawable mutation before applying tint
• Explicitly apply tint when binding flag menu items
• Refresh reviewer menu state to prevent cached icon states
• Ensure consistent behavior across reviewer, browser, and previewer screens

Testing:

  • Open flag menu repeatedly
  • Switch flags quickly
  • Rotate device
  • Navigate between reviewer and browser

All flag icons now consistently render with their correct colors.

@david-allison
Copy link
Member

we need reproduction steps for this

@AayushKrGupta
Copy link
Author

we need reproduction steps for this

Hi @david-allison, sorry for the missing detail. Here are the steps to reproduce the intermittent grey icon issue:

Steps: Open the reviewer, access the flag menu, study several cards (or switch between cards), and re-open the menu repeatedly.

Observed Behavior: Eventually, the flag icons (Red, Orange, etc.) lose their specific colors and appear entirely grey.
Root Cause: Android caches drawables by resource ID. Since ic_flag is shared across the app, its state in the cache is being reset or overwritten because .mutate() was missing in several UI binding locations. This is why closing and reopening sometimes 'fixes' it temporarily as it pulls from the cache again.

I've tested this on both the Legacy and New Study screens.

Could you please reopen this so you can review the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flags sometime have no colors

2 participants