Skip to content
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 Ripple Effect in ImageButton #21638

Closed
wants to merge 7 commits into from

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Apr 4, 2024

Description of Change

Fix Ripple Effect in ImageButton.

fix-imagebutton-ripple

Issues Fixed

Fixes #18857
Related with #20412 (comment)

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/android 🤖 area-controls-button Button, ImageButton labels Apr 4, 2024
@dotnet-policy-service dotnet-policy-service bot added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 4, 2024
platformButton.Background = paint?.ToDrawable(platformButton.Context);
if (paint is not null)
{
// TODO: Assign Ids to detect if we already created the RippleDrawable to just
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen @mattleibow Different Views are used for Button and ImageButton and they have classes with different extension methods as well. However, the fix may be similar to Button one. Wrap the drawable with the Background with a RippleDrawable that we only create once, and subsequent updates, we modify the one created.

Thoughts?

@jsuarezruiz jsuarezruiz marked this pull request as ready for review April 5, 2024 08:11
@jsuarezruiz jsuarezruiz requested a review from a team as a code owner April 5, 2024 08:11
@AlleSchonWeg
Copy link

Hi,
a common use case for ImageButton is to use a FontImageSource to display a icon (Font Awesome for example). Could you test this also in your gallery page?
Thank you

@PureWeen PureWeen added this to the .NET 8 SR5 milestone Apr 12, 2024
@jsuarezruiz jsuarezruiz closed this May 9, 2024
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-button Button, ImageButton platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageButton ripple effect stops working with .NET 8
5 participants