-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Material button lollipop shape fix #2331
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
Material button lollipop shape fix #2331
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
Fallback logic for button shape update logic for lollipop
be723b2 to
cd17642
Compare
| class MaterialButtonHelper { | ||
|
|
||
| private static final boolean IS_LOLLIPOP = VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP; | ||
| private static final boolean IS_MIN_LOLLIPOP = VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP; |
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.
IS_LOLLIPOP_OR_ABOVE?
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.
Good point, wasn't "IS_MIN" and old used convention in Android when gating min API logic? I'm pretty sure that I saw some time ago code using this prefix.
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.
I guess Android uses atLeastXXXX in many places, which also works. : )
Resolves material-components#2331 Resolves material-components#1797 GIT_ORIGIN_REV_ID=cd176426395bf93f701c623c00947384aabf0706 PiperOrigin-RevId: 393405994
[Android Lollipop][Buttons] Fallback when updating drawable shapes. (closes #1797)
Changing a button shape in Lollipop doesn't affect the view ripple drawable, which overflows the background drawable:

This change introduces a fallback only for

Lollipop, in which we recreate the background drawable when the shape changes (As it is currently done when changing the drawable insets):