From ecd8c9d9a9b6f73eec3ccfe69d07dd241ca6307f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 00:29:04 +0000 Subject: [PATCH] [create-pull-request] automated change --- .../tests/Core.UnitTests/Layouts/FlexLayoutTests.cs | 6 +++--- .../tests/DeviceTests/Elements/Layout/LayoutTests.cs | 4 ++-- src/Core/src/Layouts/Flex.cs | 2 +- src/Core/src/Platform/Windows/SliderExtensions.cs | 4 ++-- .../Handlers/Slider/SliderHandlerTests.Windows.cs | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Controls/tests/Core.UnitTests/Layouts/FlexLayoutTests.cs b/src/Controls/tests/Core.UnitTests/Layouts/FlexLayoutTests.cs index 5b0d19dbf310..15934ee07889 100644 --- a/src/Controls/tests/Core.UnitTests/Layouts/FlexLayoutTests.cs +++ b/src/Controls/tests/Core.UnitTests/Layouts/FlexLayoutTests.cs @@ -1,7 +1,7 @@ using Microsoft.Maui.Graphics; using Microsoft.Maui.Layouts; -using Xunit; using NSubstitute; +using Xunit; namespace Microsoft.Maui.Controls.Core.UnitTests.Layouts { @@ -91,7 +91,7 @@ public void FlexLayoutRecognizesVisibilityChange() * depending on the target platform. */ - (IFlexLayout, IView) SetUpUnconstrainedTest() + (IFlexLayout, IView) SetUpUnconstrainedTest() { var root = new Grid(); // FlexLayout requires a parent, at least for now var flexLayout = new FlexLayout() as IFlexLayout; @@ -114,7 +114,7 @@ public void UnconstrainedHeightChildrenHaveHeight() _ = flexLayout.CrossPlatformMeasure(400, double.PositiveInfinity); var flexFrame = flexLayout.GetFlexFrame(view); - + Assert.Equal(100, flexFrame.Height); } diff --git a/src/Controls/tests/DeviceTests/Elements/Layout/LayoutTests.cs b/src/Controls/tests/DeviceTests/Elements/Layout/LayoutTests.cs index 50bb680d9897..d047a71fe375 100644 --- a/src/Controls/tests/DeviceTests/Elements/Layout/LayoutTests.cs +++ b/src/Controls/tests/DeviceTests/Elements/Layout/LayoutTests.cs @@ -155,7 +155,7 @@ static void CreateLayout(Type layoutType, out Layout layout, out Label label) } [Fact, Category(TestCategory.FlexLayout)] - public async Task FlexLayoutInVerticalStackLayoutDoesNotCycle() + public async Task FlexLayoutInVerticalStackLayoutDoesNotCycle() { await FlexLayoutInStackLayoutDoesNotCycle(new VerticalStackLayout()); } @@ -182,7 +182,7 @@ await InvokeOnMainThreadAsync(async () => // If this can be attached to the hierarchy and make it through a layout // without crashing, then we're good. - + await root.ToPlatform(MauiContext).AttachAndRun(() => { }); }); } diff --git a/src/Core/src/Layouts/Flex.cs b/src/Core/src/Layouts/Flex.cs index b9f16253ee16..09cd596483fa 100644 --- a/src/Core/src/Layouts/Flex.cs +++ b/src/Core/src/Layouts/Flex.cs @@ -579,7 +579,7 @@ static void layout_item(Item item, float width, float height) layout.flex_grows += child.Grow; layout.flex_shrinks += child.Shrink; - if(layout.flex_dim > 0) + if (layout.flex_dim > 0) { // If flex_dim is zero, it's because we're measuring unconstrained in that direction // So we don't need to keep a running tally of available space diff --git a/src/Core/src/Platform/Windows/SliderExtensions.cs b/src/Core/src/Platform/Windows/SliderExtensions.cs index d9922b323978..21677e07e8c0 100644 --- a/src/Core/src/Platform/Windows/SliderExtensions.cs +++ b/src/Core/src/Platform/Windows/SliderExtensions.cs @@ -143,12 +143,12 @@ void OnImageOpened(object sender, RoutedEventArgs e) thumb.Height = bitmapImage.PixelHeight; thumb.Width = bitmapImage.PixelWidth; } - + if (nativeSlider.Parent is FrameworkElement frameworkElement) frameworkElement.InvalidateMeasure(); }; } - + nativeSlider.ThumbImageSource = nativeThumbImageSource?.Value; } } diff --git a/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs b/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs index a79077fce128..d707f4ce6633 100644 --- a/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs +++ b/src/Core/tests/DeviceTests/Handlers/Slider/SliderHandlerTests.Windows.cs @@ -57,7 +57,7 @@ await InvokeOnMainThreadAsync(async () => bool imageLoaded = await Wait(() => ImageSourceLoaded(handler)); Assert.True(imageLoaded); - + await Task.Delay(100); var expectedColor = Color.FromArgb("#FF0000"); @@ -84,7 +84,7 @@ await InvokeOnMainThreadAsync(async () => bool imageLoaded = await Wait(() => ImageSourceLoaded(handler)); Assert.True(imageLoaded); - + await handler.PlatformView.AttachAndRun(async () => { // Update the Slider ThumbImageSource @@ -117,8 +117,8 @@ double GetSmallChange(SliderHandler sliderHandler) => Size GetNativeThumbSize(SliderHandler sliderHandler) { var nativeSlider = GetNativeSlider(sliderHandler); - - if(nativeSlider.GetFirstDescendant() is Thumb thumb) + + if (nativeSlider.GetFirstDescendant() is Thumb thumb) { return new Size(thumb.Width, thumb.Height); } @@ -128,7 +128,7 @@ Size GetNativeThumbSize(SliderHandler sliderHandler) bool ImageSourceLoaded(SliderHandler sliderHandler) { - return (sliderHandler.PlatformView as MauiSlider)?.ThumbImageSource != null; + return (sliderHandler.PlatformView as MauiSlider)?.ThumbImageSource != null; } } } \ No newline at end of file