-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Android] Fix Button Ripple Effect not working #17821
Conversation
bool HasBorder() | ||
{ | ||
InitializeBorderIfNeeded(); | ||
|
||
return _stroke != null || _borderColor != null; | ||
} | ||
|
||
bool HasRipple() |
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.
Only render and run the ripple animation if set the RippleColor.
@@ -14,8 +18,10 @@ | |||
|
|||
namespace Microsoft.Maui.Platform | |||
{ | |||
public class BorderDrawable : PaintDrawable | |||
public class BorderDrawable : PaintDrawable, IAnimatorUpdateListener |
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.
We can't add a new interface
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.
With IAnimatorUpdateListener
, should go to .NET 9?. In this case, we need an alternative for .NET 8.
@jsuarezruiz Is this the planned fix for #18815 as well? |
Hi @jsuarezruiz. We have added the "s/pr-needs-author-input" label to this issue, which indicates that we have an open question/action for you before we can take further action. This PRwill be closed automatically in 14 days if we do not hear back from you by then - please feel free to re-open it if you come back to this PR after that time. |
So this will just be closed? How can it be, that throughout a whole major version of .NET, button animations (so almost everything that's being tapped) just don't work for one of the biggest platforms of .NET MAUI (Android), and Microsoft doesn't seem to care about it. I was really looking forward to migrate from Xamarin to .NET MAUI, but with this issue the app just looks plain unprofessional and cannot be delivered to any customers as it is. |
Reopened and is a priority for the next release. |
That is really, really good to hear. Just to clarify: "Next release" as in ".NET 9" or as in ".NET 8 SR1/2"? 🤔 |
…7821) (#20412) * Other approach to fix the issue * More changes * Fixed Stroke * Added device test * Updated sample * More changes * Updated test * Fix build errors * Fix format * working * So much done here! * - fix Tizen --------- Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
Description of Change
Fix Button Ripple Effect not working using a custom background.
We use the MaterialButton instead a Button on Android, and this type use
MaterialShapeDrawable
. MaterialShapeDrawable does not support gradients. Settings a gradient or creating a composition drawable with two layers: gradient drawable and ripple drawable create a black background. [MaterialShapeDrawable] Unable to add gradient to MaterialShapeDrawable · Issue #1167 · material-components/material-components-android (github.com)To set the gradient we set to null the backgroundTintList property and set a custom drawable in the background. The PR apply changes in the custom drawable adding the ripple effect animation to maintain the same drawable and the MaterialButton.
surprised 1
Issues Fixed
Fixes #17642
Fixes #18815