Skip to content

Commit 235ad46

Browse files
PureWeenTamilarasanSF4853sheiksyedmrmarinhoMartyIX
authored
Sync .NET 9 SR12 with .NET 10 GA release (#32012)
* [Testing] Fix for flaky UITests CookiesCorrectlyLoadWithMultipleWebViews in CI (#31823) This PR addresses the UI test image failures that occurred in the main branch and includes updates to improve rendering and test stability across platforms. - In the CookiesCorrectlyLoadWithMultipleWebViews test case, I changed the WebView source to match the cookies. ### Test cases: - CookiesCorrectlyLoadWithMultipleWebViews * [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. (#31831) * [iOS] Fix added for Navigation.SetTitleView does not work in ios 26. * changes added. * changed the version condition. * [testing] Update androidApiLevels for device tests (#31827) * Update androidApiLevels for device tests * [ci] Update provisioning of api 36 * Add reference (#31669) * [Windows, Catalyst] Fix IsPresented=true Not Working on Initial Value in FlyoutPage (#31515) * mac fix added * Windows fix added * test case added * Update Issue31372.cs * Update Issue31372.cs * Update WindowHandler.iOS.cs * fix updated * Update WindowHandler.iOS.cs * Update WindowHandler.iOS.cs * Update PublicAPI.Shipped.txt * changes added in UnShipped file * Temporarily disable flaky WebView tests using FlakyTest attribute (#31868) * Initial plan * Temporarily disable flaky WebView tests with FlakyTest attribute Co-authored-by: rmarinho <[email protected]> * Add tracking issue link to FlakyTest attributes Co-authored-by: rmarinho <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: rmarinho <[email protected]> * Invert NavigationPage UseMauiHandler flag (#31859) * Update dependencies from https://github.com/dotnet/xharness build 20251004.2 (#31872) On relative base path root Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 9.0.0-prerelease.25426.1 -> To Version 9.0.0-prerelease.25504.2 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [release/9.0.1xx-sr12] Fix ProjectList not displaying due to missing BindingContext update in template sample (#31954) * update ProjectListPage * Update MauiApp.1.csproj --------- Co-authored-by: Vignesh-SF3580 <[email protected]> * [release/9.0.1xx-sr12] [Android] -Picker dialog causes crash when page is popped while dialo… (#31919) * [Android] -Picker dialog causes crash when page is popped while dialog is open * removed the dispose call. * Revert "removed the dispose call." This reverts commit e1e7a9f. * removed the dispose call. * Modified with Dismiss() method. --------- Co-authored-by: sheiksyedm <[email protected]> * [release/9.0.1xx-sr12] [iOS] Fix memory leak in CollectionViewHandler2 ItemsLayout PropertyChanged subscription (#31922) * [release/9.0.1xx-sr12] [Android][Regression] Fixed Entry and Editor AppThemeBinding colors for text and placeholder reset to default on theme change (#31921) * added snapshots and fix * removed test cases * added the test cases and snapshots * added braces * added mac and windows snapshots * added mac and windows snapshots * added snapshot --------- Co-authored-by: TamilarasanSF4853 <[email protected]> * 9.0.120 Release Branding (#31979) * [release/9.0.1xx-sr12] [ci] Update arcade main (#31987) * Update arcade * Don t use internal feeds --------- Co-authored-by: Rui Marinho <[email protected]> * Update FlyoutViewHandler.Windows.cs (#32007) Co-authored-by: devanathan-vaithiyanathan <[email protected]> --------- Co-authored-by: TamilarasanSF4853 <[email protected]> Co-authored-by: sheiksyedm <[email protected]> Co-authored-by: Rui Marinho <[email protected]> Co-authored-by: MartyIX <[email protected]> Co-authored-by: devanathan-vaithiyanathan <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: rmarinho <[email protected]> Co-authored-by: Tim Miller <[email protected]> Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Vignesh-SF3580 <[email protected]>
1 parent c086862 commit 235ad46

File tree

42 files changed

+520
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+520
-44
lines changed

src/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public override void ViewDidAppear(bool animated)
124124
{
125125
base.ViewDidAppear(animated);
126126
Page.SendAppearing();
127+
if (!_intialLayoutFinished)
128+
{
129+
_intialLayoutFinished = true;
130+
SetInitialPresented();
131+
}
127132
}
128133

129134
public override void ViewDidDisappear(bool animated)
@@ -158,19 +163,6 @@ void SetInitialPresented()
158163
UpdateLeftBarButton();
159164
}
160165

161-
public override void ViewWillLayoutSubviews()
162-
{
163-
// Orientation doesn't seem to be set to a stable correct value until here.
164-
// So, we officially process orientation here.
165-
if (!_intialLayoutFinished)
166-
{
167-
_intialLayoutFinished = true;
168-
SetInitialPresented();
169-
}
170-
171-
base.ViewWillLayoutSubviews();
172-
}
173-
174166
public override void ViewDidLoad()
175167
{
176168
base.ViewDidLoad();

src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,13 @@ class Container : UIView
20892089

20902090
public Container(View view, UINavigationBar bar) : base(bar.Bounds)
20912091
{
2092-
if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11))
2092+
// For iOS 26+, we need to use autoresizing masks instead of constraints to ensure proper TitleView display
2093+
if (OperatingSystem.IsIOSVersionAtLeast(26) || OperatingSystem.IsMacCatalystVersionAtLeast(26))
2094+
{
2095+
TranslatesAutoresizingMaskIntoConstraints = true;
2096+
AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
2097+
}
2098+
else if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11))
20932099
{
20942100
TranslatesAutoresizingMaskIntoConstraints = false;
20952101
}
@@ -2178,7 +2184,9 @@ public override CGRect Frame
21782184
{
21792185
if (Superview != null)
21802186
{
2181-
if (!(OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11)))
2187+
// For iOS 26+ and pre-iOS 11, we use autoresizing masks and need to adjust the frame manually
2188+
if (OperatingSystem.IsIOSVersionAtLeast(26) || OperatingSystem.IsMacCatalystVersionAtLeast(26) ||
2189+
!(OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11)))
21822190
{
21832191
value.Y = Superview.Bounds.Y;
21842192

src/Controls/src/Core/Items/CarouselLayoutTypeConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destina
1919

2020
if (strValue == "HorizontalList")
2121
{
22-
return LinearItemsLayout.CarouselDefault;
22+
return LinearItemsLayout.CreateCarouselHorizontalDefault();
2323
}
2424

2525
if (strValue == "VerticalList")
2626
{
27-
return LinearItemsLayout.CarouselVertical;
27+
return LinearItemsLayout.CreateCarouselVerticalDefault();
2828
}
2929

3030
throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(LinearItemsLayout)}");

src/Controls/src/Core/Items/CarouselView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public object PositionChangedCommandParameter
187187
/// <summary>Bindable property for <see cref="ItemsLayout"/>.</summary>
188188
public static readonly BindableProperty ItemsLayoutProperty =
189189
BindableProperty.Create(nameof(ItemsLayout), typeof(LinearItemsLayout), typeof(ItemsView),
190-
LinearItemsLayout.CarouselDefault);
190+
null, defaultValueCreator: (b) => LinearItemsLayout.CreateCarouselHorizontalDefault());
191191

192192
/// <include file="../../../docs/Microsoft.Maui.Controls/CarouselView.xml" path="//Member[@MemberName='ItemsLayout']/Docs/*" />
193193
[System.ComponentModel.TypeConverter(typeof(CarouselLayoutTypeConverter))]

src/Controls/src/Core/Items/ItemsLayoutTypeConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destina
2626

2727
if (strValue == "VerticalList")
2828
{
29-
return LinearItemsLayout.Vertical;
29+
return LinearItemsLayout.CreateVerticalDefault();
3030
}
3131
else if (strValue == "HorizontalList")
3232
{
33-
return LinearItemsLayout.Horizontal;
33+
return LinearItemsLayout.CreateHorizontalDefault();
3434
}
3535
else if (strValue.StartsWith("VerticalGrid", StringComparison.Ordinal))
3636
{

src/Controls/src/Core/Items/ItemsView.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ public int RemainingItemsThreshold
113113

114114
internal static readonly BindableProperty InternalItemsLayoutProperty =
115115
BindableProperty.Create(nameof(ItemsLayout), typeof(IItemsLayout), typeof(ItemsView),
116-
LinearItemsLayout.Vertical, propertyChanged: OnInternalItemsLayoutPropertyChanged);
116+
null, propertyChanged: OnInternalItemsLayoutPropertyChanged,
117+
defaultValueCreator: (b) => LinearItemsLayout.CreateVerticalDefault());
117118

118119
static void OnInternalItemsLayoutPropertyChanged(BindableObject bindable, object oldValue, object newValue)
119120
{

src/Controls/src/Core/Items/LinearItemsLayout.cs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,14 @@ public LinearItemsLayout([Parameter("Orientation")] ItemsLayoutOrientation orien
1212
}
1313

1414
/// <include file="../../../docs/Microsoft.Maui.Controls/LinearItemsLayout.xml" path="//Member[@MemberName='Vertical']/Docs/*" />
15-
public static readonly IItemsLayout Vertical = new LinearItemsLayout(ItemsLayoutOrientation.Vertical);
15+
public static readonly IItemsLayout Vertical = CreateVerticalDefault();
1616
/// <include file="../../../docs/Microsoft.Maui.Controls/LinearItemsLayout.xml" path="//Member[@MemberName='Horizontal']/Docs/*" />
17-
public static readonly IItemsLayout Horizontal = new LinearItemsLayout(ItemsLayoutOrientation.Horizontal);
17+
public static readonly IItemsLayout Horizontal = CreateHorizontalDefault();
1818

1919
/// <include file="../../../docs/Microsoft.Maui.Controls/LinearItemsLayout.xml" path="//Member[@MemberName='CarouselVertical']/Docs/*" />
20-
public static readonly IItemsLayout CarouselVertical = new LinearItemsLayout(ItemsLayoutOrientation.Vertical)
21-
{
22-
SnapPointsType = SnapPointsType.MandatorySingle,
23-
SnapPointsAlignment = SnapPointsAlignment.Center
24-
};
20+
public static readonly IItemsLayout CarouselVertical = CreateCarouselVerticalDefault();
2521

26-
internal static readonly LinearItemsLayout CarouselDefault = new LinearItemsLayout(ItemsLayoutOrientation.Horizontal)
27-
{
28-
SnapPointsType = SnapPointsType.MandatorySingle,
29-
SnapPointsAlignment = SnapPointsAlignment.Center
30-
};
22+
internal static readonly LinearItemsLayout CarouselDefault = CreateCarouselHorizontalDefault();
3123

3224
/// <summary>Bindable property for <see cref="ItemSpacing"/>.</summary>
3325
public static readonly BindableProperty ItemSpacingProperty =
@@ -40,5 +32,25 @@ public double ItemSpacing
4032
get => (double)GetValue(ItemSpacingProperty);
4133
set => SetValue(ItemSpacingProperty, value);
4234
}
35+
36+
internal static LinearItemsLayout CreateVerticalDefault()
37+
=> new LinearItemsLayout(ItemsLayoutOrientation.Vertical);
38+
39+
internal static LinearItemsLayout CreateHorizontalDefault()
40+
=> new LinearItemsLayout(ItemsLayoutOrientation.Horizontal);
41+
42+
internal static LinearItemsLayout CreateCarouselVerticalDefault()
43+
=> new LinearItemsLayout(ItemsLayoutOrientation.Vertical)
44+
{
45+
SnapPointsType = SnapPointsType.MandatorySingle,
46+
SnapPointsAlignment = SnapPointsAlignment.Center
47+
};
48+
49+
internal static LinearItemsLayout CreateCarouselHorizontalDefault()
50+
=> new LinearItemsLayout(ItemsLayoutOrientation.Horizontal)
51+
{
52+
SnapPointsType = SnapPointsType.MandatorySingle,
53+
SnapPointsAlignment = SnapPointsAlignment.Center
54+
};
4355
}
4456
}

src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#nullable enable
1+
#nullable enable
2+
*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.ViewWillLayoutSubviews() -> void
23
*REMOVED*Microsoft.Maui.Controls.Accelerator
34
*REMOVED*~Microsoft.Maui.Controls.Accelerator.Keys.get -> System.Collections.Generic.IEnumerable<string>
45
*REMOVED*~Microsoft.Maui.Controls.Accelerator.Keys.set -> void

src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#nullable enable
1+
#nullable enable
2+
*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.ViewWillLayoutSubviews() -> void
23
*REMOVED*Microsoft.Maui.Controls.Accelerator
34
*REMOVED*~Microsoft.Maui.Controls.Accelerator.Keys.get -> System.Collections.Generic.IEnumerable<string>
45
*REMOVED*~Microsoft.Maui.Controls.Accelerator.Keys.set -> void

src/Controls/tests/Core.UnitTests/ItemsLayoutTypeConverterTests.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ public void HorizontalListShouldReturnLinearItemsLayout()
1111
{
1212
var converter = new ItemsLayoutTypeConverter();
1313
var result = converter.ConvertFromInvariantString("HorizontalList");
14-
Assert.Same(LinearItemsLayout.Horizontal, result);
14+
15+
Assert.IsType<LinearItemsLayout>(result);
16+
var linearLayout = (LinearItemsLayout)result;
17+
Assert.Equal(ItemsLayoutOrientation.Horizontal, linearLayout.Orientation);
1518
}
1619

1720
[Fact]
1821
public void VerticalListShouldReturnLinearItemsLayout()
1922
{
2023
var converter = new ItemsLayoutTypeConverter();
2124
var result = converter.ConvertFromInvariantString("VerticalList");
22-
Assert.Same(LinearItemsLayout.Vertical, result);
25+
26+
Assert.IsType<LinearItemsLayout>(result);
27+
var linearLayout = (LinearItemsLayout)result;
28+
Assert.Equal(ItemsLayoutOrientation.Vertical, linearLayout.Orientation);
2329
}
2430

2531
[Fact]

0 commit comments

Comments
 (0)