From ace7c33cbf56586222e9c1dbe672eabe6473c23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Fri, 10 Feb 2023 18:47:33 +0100 Subject: [PATCH 1/2] Revert changes from 11721 --- src/Core/src/Platform/iOS/ViewExtensions.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Core/src/Platform/iOS/ViewExtensions.cs b/src/Core/src/Platform/iOS/ViewExtensions.cs index b79257076f14..df30aa16b40b 100644 --- a/src/Core/src/Platform/iOS/ViewExtensions.cs +++ b/src/Core/src/Platform/iOS/ViewExtensions.cs @@ -268,23 +268,16 @@ public static void UpdateBackgroundLayerFrame(this UIView view) var layer = view.Layer; - UpdateBackgroundLayerFrame(layer, view.Bounds); - } - - static void UpdateBackgroundLayerFrame(CALayer layer, CGRect bounds) - { if (layer == null || layer.Sublayers == null || layer.Sublayers.Length == 0) return; foreach (var sublayer in layer.Sublayers) { - if (sublayer.Name == BackgroundLayerName && sublayer.Frame != bounds) + if (sublayer.Name == BackgroundLayerName && sublayer.Frame != view.Bounds) { - sublayer.Frame = bounds; + sublayer.Frame = view.Bounds; break; } - - UpdateBackgroundLayerFrame(sublayer, bounds); } } From 762ba996d65b4959d08f3cf5c31cb765e9677cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Fri, 10 Feb 2023 19:03:20 +0100 Subject: [PATCH 2/2] Revert device tests --- .../ContentView/ContentViewTests.iOS.cs | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/Core/tests/DeviceTests/Handlers/ContentView/ContentViewTests.iOS.cs b/src/Core/tests/DeviceTests/Handlers/ContentView/ContentViewTests.iOS.cs index 70fb6de52381..956cc11f764b 100644 --- a/src/Core/tests/DeviceTests/Handlers/ContentView/ContentViewTests.iOS.cs +++ b/src/Core/tests/DeviceTests/Handlers/ContentView/ContentViewTests.iOS.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.Maui.DeviceTests.Stubs; using UIKit; using Xunit; @@ -9,23 +8,6 @@ namespace Microsoft.Maui.DeviceTests.Handlers.ContentView [Category(TestCategory.ContentView)] public partial class ContentViewTests { - [Theory(DisplayName = "Background Updates Correctly")] - [InlineData(0xFF0000)] - [InlineData(0x00FF00)] - [InlineData(0x0000FF)] - public async Task BackgroundUpdatesCorrectly(uint color) - { - var expected = Color.FromUint(color); - - var contentView = new ContentViewStub() - { - Content = new LabelStub { Text = "Background", TextColor = Colors.White }, - Background = new LinearGradientPaintStub(Colors.Red, Colors.Blue), - }; - - await ValidateHasColor(contentView, expected); - } - [Fact, Category(TestCategory.FlowDirection)] public async Task FlowDirectionPropagatesToContent() { @@ -123,18 +105,5 @@ public async Task DoesNotPropagateToContentWithExplicitFlowDirection() Assert.Equal(UIUserInterfaceLayoutDirection.LeftToRight, labelFlowDirection); } - - Platform.ContentView GetNativeContentView(ContentViewHandler contentViewHandler) => - contentViewHandler.PlatformView; - - Task ValidateHasColor(IContentView contentView, Color color, Action action = null) - { - return InvokeOnMainThreadAsync(() => - { - var nativeContentView = GetNativeContentView(CreateHandler(contentView)); - action?.Invoke(); - nativeContentView.AssertContainsColor(color); - }); - } } }