Fix getOpacity() for drawables#47103
Closed
jorge-cab wants to merge 2 commits into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D64273014 |
6e547d8 to
3ebd7c4
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D64273014 |
3ebd7c4 to
a3a9139
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D64273014 |
…acebook#46819) Summary: Just some preparation to implement the new `BackgroundDrawable` and `BorderDrawable`. This makes shadows and outline rely on `CompositeBackgroundDrawable` to set the state of `BorderRadiusStyle` and also makes them have a nullable borderRadius variable and initialize it only if we have it set saving a bit of overhead and performance Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D63798853
Summary: `getOpacity()` is supposed to return a PixelFormat enum instead of a value between 0..255. https://developer.android.com/reference/android/graphics/drawable/Drawable#getOpacity() Also, I'm taking the value from the paint instead of the color's alpha since the paint might've been modified by setAlpha by this point and otherwise the paint will hold the alpha set by the color anyway since setAlpha() on Paints is just a helper for setColor() (https://developer.android.com/reference/android/graphics/Paint#setAlpha(int)) Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D64273014
a3a9139 to
ed10590
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D64273014 |
Contributor
|
This pull request has been merged in 398512a. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
getOpacity()is supposed to return a PixelFormat enum instead of a value between 0..255.https://developer.android.com/reference/android/graphics/drawable/Drawable#getOpacity()
Also, I'm taking the value from the paint instead of the color's alpha since the paint might've been modified by setAlpha by this point and otherwise the paint will hold the alpha set by the color anyway since setAlpha() on Paints is just a helper for setColor() (https://developer.android.com/reference/android/graphics/Paint#setAlpha(int))
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D64273014