Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add background color option for media detail page #5394

Conversation

Pierre-Monier
Copy link
Contributor

@Pierre-Monier Pierre-Monier commented Nov 23, 2023

Description (required)

Fixes #102

What changes did you make and why?

I add two menu items for transparent image only. It gives the user the possibility to change the background color to either black or white. I think you should do this instead of toggling the background color, because the background color is based on the user theme (dark or light mode). My solution works even if user change theme. The data is then saved into SharedPreferences, (with the key specified by the media pageId).

Tests performed (required)

I add two tests on the MediaDetailPagerFragment to verify if menu items are displayed only on transparent image.

I add two tests on MediaDetailFragment to verify that we set the correct background color, only if it's not currently used.

Tested BetaDebug on realme 10 with API level 33 - Android 13.

Screenshots (for UI changes only)

Screen.Recording.2023-11-23.at.21.18.49.mov

@nicolas-raoul
Copy link
Member

Looks great!
I am super busy this week, but will try to test next week. :-)

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with 50 transparent PNGs and GIFs, it works well in both media details and fullscreen.
Great documentation. Unit tests.
Thanks a lot for your contribution and sorry for the delay!

@nicolas-raoul nicolas-raoul merged commit e1e4f93 into commons-app:main Nov 30, 2023
1 check passed
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.

With transparent files have an option to turn the background white
2 participants