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

Fix Android ImageButton background, ripple and padding #22298

Merged
merged 47 commits into from May 22, 2024
Merged

Conversation

mattleibow
Copy link
Member

@mattleibow mattleibow commented May 8, 2024

Description of Change

An alternative to #21638

The main difference is that I just moved the code into a separate file and reused it for the most part. Very different to #21638 in that instead of using the new APIs that actually give a slightly different behavior with regards to border/corner calculations, I just use the code wholesale.

The padding was also pretty broken, so this PR also sort of makes it better. Seems to work around the several bugs in the Android code.

Issues Fixed

(I tried to work in smaller parts by splitting, but this control is so dodgy that it is all linked)

Outstanding Issues

This PR is trying to make Android better, and when I added the UI tests I saw all the other platforms are different. This PR is just to make the Android ripple and "background drawable" work, and not to fix all things.

@mattleibow mattleibow requested a review from a team as a code owner May 8, 2024 17:58
@mattleibow mattleibow marked this pull request as draft May 8, 2024 18:52
@mattleibow
Copy link
Member Author

Need to add some UI tests tomorrow. Somehow. Might just be able to make sure the button looks OK.

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 8, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the image take into account the BorderWidth and not overflow it?

@mattleibow
Copy link
Member Author

mattleibow commented May 13, 2024

You mean this?
image

Feels like it, right? RealPadding == BorderWidth + UserPadding?

I will test other controls and see what that does. But you probably onto something big. Thanks for catching this.

@mattleibow mattleibow marked this pull request as ready for review May 20, 2024 09:29
@jsuarezruiz
Copy link
Contributor

Ready for a review, right @mattleibow?

@mattleibow
Copy link
Member Author

Ready!

Copy link
Contributor

@tj-devel709 tj-devel709 left a comment

Choose a reason for hiding this comment

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

From what I am seeing, this looks great to me!

@mattleibow mattleibow merged commit 682f69b into main May 22, 2024
49 checks passed
@mattleibow mattleibow deleted the dev/shared-ripple branch May 22, 2024 14:40
@AlleSchonWeg
Copy link

Hi @mattleibow ,
i tried your changes (Nightly from today) but the ripple is not working when the BackgroundColor is not set or it's the same color as the parent element.
Is this expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageButton Padding stops working with .NET 8 ImageButton ripple effect stops working with .NET 8
5 participants