From 1b423ab40cc919c25f120d3d418079117d8d08e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Sat, 16 Mar 2024 23:50:18 +0100 Subject: [PATCH] [Android] Correctly scale Button image (#19834) * Fixed on Android * Added snapshots * Fix on iOS * Fixed broken test * Added iOS snapshot * Changed logic to resize on iOS (now rescale) * Updated snapshots * Moved changes in Button iOS from Core to Controls * Revert Windows related changes * Revert iOS snapshot * Revert more changes * Resize the image to fit the button * Use the correct measure spec mode * nice things * this * More things * add a comment * rename * Update Issue18242.cs * Add files via upload --------- Co-authored-by: Matthew Leibowitz --- .../Pages/Controls/ButtonPage.xaml | 8 + .../Android/Extensions/ButtonExtensions.cs | 13 +- .../tests/UITests/Tests/Issues/Issue18242.cs | 2 +- .../snapshots/android/Issue18242Test.png | Bin 0 -> 188564 bytes .../Handlers/Button/ButtonHandler.Android.cs | 8 +- .../Handlers/ViewHandlerExtensions.Android.cs | 10 +- .../Platform/Android/MauiMaterialButton.cs | 164 ++++++++++++++++-- .../net-android/PublicAPI.Unshipped.txt | 3 + 8 files changed, 177 insertions(+), 31 deletions(-) create mode 100644 src/Controls/tests/UITests/snapshots/android/Issue18242Test.png diff --git a/src/Controls/samples/Controls.Sample/Pages/Controls/ButtonPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Controls/ButtonPage.xaml index 758a56587796..6ad737cb367a 100644 --- a/src/Controls/samples/Controls.Sample/Pages/Controls/ButtonPage.xaml +++ b/src/Controls/samples/Controls.Sample/Pages/Controls/ButtonPage.xaml @@ -144,6 +144,14 @@ CharacterSpacing="20" TextColor="HotPink" Text="Button"/> +