-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Crop the notification thumbnail in 1:1 mode instead of stretching it #8533
Crop the notification thumbnail in 1:1 mode instead of stretching it #8533
Conversation
Change the bitmap transformation strategy when a 1:1 aspect ratio is enabled to not stretch the bitmap but rather crop it. On Android 11/12, the way the whole thumbnail was used for the notification icon was not ideal, however the setting to toggle a 1:1 (as it states in settings) resulted in distortions. Fix this by simply cropping the bitmap.
By the way @opusforlife2, should I update the setting string to remove the "May cause distortions" portion? Or will this be done by the maintainers? |
Go ahead. 👍 |
Update the 1:1 mode strings to remove mentions of scaling or distortions, as those no longer apply.
Done. This can probably be merged now @opusforlife2. |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you!
Note: we have to delete translations of the strings updated in this PR in order to apply their changes in translations. |
Uhm, no? Weblate already takes care of asking translators to re-translate outdated strings, if I remember correctly. |
What is it?
Description of the changes in your PR
While using the whole thumbnail for the notification's large icon works fine on Android 10 and below, it breaks down on Android 11/12, in which it leaves a large amount of whitespace. The 1:1 option is also not ideal here, as it distorts the thumbnail in an unappealing manner.
This PR changes the scaling mechanism used to crop the thumbnail to a 1:1 ratio instead of stretching it. More specifically, it picks the smaller dimension from the thumbnail and then scales the larger dimension down to fit, cropping the thumbnail to the center in the process. I feel this is much better than how the option currently works.
Before/After Screenshots/Screen Record
Before:
After:
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence