-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix Button IconSize #16164
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
Conversation
|
From the images it looks like the aspect is not preserved (it's stretched or squashed) is that something we should do? |
| if (Handler is ButtonHandler buttonHandler && buttonHandler.PlatformView is MaterialButton materialButton) | ||
| { | ||
| _materialButton = materialButton; | ||
| _materialButton.LayoutChange += OnButtonLayoutChange; |
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.
This is going to cause memory leaks.
Can we trigger this logic from the handler without events?
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.
|
|
||
| private protected override void OnHandlerChangedCore() | ||
| { | ||
| base.OnHandlerChangedCore(); |
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.
This isn't going to always fire. Can we make this work without needing to subscribe to LayoutChange from the controls code?
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 are also unsubscribing when the parent Window is null. I have added a test to validate leaks. What would be a possible scenario for testing?
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.
Removed and start using ArrangeOverride
|
Fixed by |


Description of Change
Fix Button IconSize on Android.
Before

After

To validate the changes, launch the .NET MAUI Gallery and navigate to the Button samples. Check the added samples using the huge dotnet bot png.
Issues Fixed
Fixes #12054