Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CollapsingToolbarLayout] Fixed shadow issues when transition between…
… expanded and collapsed states. Includes two main fixes: 1. Applied a workaround for alpha issue of shadow layer in Paint for API 31(+). - Issue: For API 31 and plus, Paint doesn't apply the correct alpha value to the shadow layer. When the shadow color is opaque (alpha=255), the alpha of shadow should use the alpha of the Paint. But it seems the inverse alpha (255-alpha) is applied to the shadow layer. - Solution: Added a workaround to set shadow color with a real-time alpha value, Paint still respects to the shadow color's alpha when it's not opaque. 2. Fixed rounding issue when blending shadow color for API 30(-). - Issue: The rounding of alpha value in removed blendColors() function is casting (round down). This causes the shadow color occasionally becomes non-opaque. Then Paint stops to apply the alpha value to it. - Solution: When blending colors, round values with Math.round() (round to nearest). Note: Fix (1) covers fix (2). But fix (2) is still worth to keep, if issue (1) is fixed in the framework in future and workaround is removed. Resolves: #2545 PiperOrigin-RevId: 427812326
- Loading branch information
1 parent
d5856fd
commit 86e8b00
Showing
1 changed file
with
84 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86e8b00
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.
When will that get into some release? Thx.
86e8b00
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.
Hi @bazinac,
We're planning on cutting a 1.6.0-alpha03 release in the next day or so. It will be included in that release.