KEMBAR78
[Android] Fix issues rendering gradients and CornerRadius on Button by jsuarezruiz · Pull Request #5971 · dotnet/maui · GitHub
Skip to content

Conversation

@jsuarezruiz
Copy link
Contributor

Description of Change

Fix issues rendering gradients and corner radius on Android Button.

image

Issues Fixed

Fixes #5950
Fixes #5930

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/android area-controls-button Button, ImageButton labels Apr 11, 2022
if (background is SolidPaint)
platformView.UpdateBackground(background);
else
platformView.UpdateBorderDrawable(button);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do we have this issue? Basically because we have implemented Handlers, in this specific case the Button in different phases and we have not detected this problem with tests. We initially implement the Background property using an AppCompatButton. Subsequently, by implementing properties related to the Border (BorderWidth, etc) we change the type of native control to use for a MaterialButton.

The MaterialButton requires BackgroundTintList to be set to null in order to render a custom background. If a custom background is set, a Drawable is used where the background is drawn and, if there is a border, use the Drawabable too. Otherwise, the BackgroundColor property and the StrokeWidth etc properties of the MaterialButton itself are used.

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 11, 2022
@Redth Redth merged commit a61092a into main Apr 26, 2022
@Redth Redth deleted the fix-5950 branch April 26, 2022 19:03
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@samhouts samhouts added the fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-button Button, ImageButton fixed-in-6.0.300-rc.3 Look for this fix in 6.0.300-rc.3! platform/android t/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mauipalooza] Button background doesn't render gradient [mauipalooza] CornerRadius not working on Button

4 participants