Skip to content

Commit 59bf90a

Browse files
authored
December 1st, Inflight Candidate (dotnet#32841)
2 parents db3517c + f3b6078 commit 59bf90a

File tree

36 files changed

+620
-18
lines changed

36 files changed

+620
-18
lines changed

src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentContainer.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,5 @@ public override void OnDestroyView()
3737
((IShellContentController)ShellContentTab).RecyclePage(_page);
3838
_page = null;
3939
}
40-
41-
public override void OnDestroy()
42-
{
43-
_mauiContext
44-
.GetDispatcher()
45-
.Dispatch(Dispose);
46-
47-
base.OnDestroy();
48-
}
4940
}
5041
}

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutRenderer.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ public override void ViewDidLoad()
242242
UpdateFlyoutAccessibility();
243243
}
244244

245+
public override void ViewWillTransitionToSize(CGSize toSize, IUIViewControllerTransitionCoordinator coordinator)
246+
{
247+
base.ViewWillTransitionToSize(toSize, coordinator);
248+
249+
coordinator.AnimateAlongsideTransition((IUIViewControllerTransitionCoordinatorContext obj) =>
250+
{
251+
if (IsOpen && TapoffView != null)
252+
{
253+
TapoffView.Frame = View.Bounds;
254+
}
255+
}, null);
256+
}
257+
245258
protected override void Dispose(bool disposing)
246259
{
247260
base.Dispose(disposing);

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,11 @@ public override void WillShowViewController(UINavigationController navigationCon
805805
navBarVisible = _self._renderer.ShowNavBar;
806806
else
807807
navBarVisible = Shell.GetNavBarIsVisible(element);
808+
809+
// Update navigation bar visibility during the transition
810+
// This ensures the correct nav bar state is applied as part of the navigation animation
811+
bool animateVisibilityChange = animated && Shell.GetNavBarVisibilityAnimationEnabled(element);
812+
navigationController.SetNavigationBarHidden(!navBarVisible, animateVisibilityChange);
808813
}
809814

810815
var coordinator = viewController.GetTransitionCoordinator();

src/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ public static void MapEmptyViewTemplate(ItemsViewHandler2<TItemsView> handler, I
108108
public static void MapFlowDirection(ItemsViewHandler2<TItemsView> handler, ItemsView itemsView)
109109
{
110110
handler.Controller?.UpdateFlowDirection();
111+
112+
// UIKit does not automatically mirror or reflow UICollectionView layouts when the flow direction
113+
// (semanticContentAttribute) changes at runtime. To ensure correct RTL/LTR behavior, we explicitly
114+
// notify the controller to rebuild or reassign its layout. Without this, UICollectionViewCompositionalLayout
115+
// and other layouts will keep their previous geometry and ignore the new direction.
116+
handler.UpdateLayout();
111117
}
112118

113119
public static void MapIsVisible(ItemsViewHandler2<TItemsView> handler, ItemsView itemsView)

src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ public virtual void UpdateFlowDirection()
312312
}
313313
}
314314
}
315+
316+
CollectionView.UpdateFlowDirection(ItemsView);
315317
}
316318

317319
if (_emptyViewDisplayed)

src/Controls/src/Core/Platform/AlertManager/AlertManager.Standard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ internal partial class AlertManager
77
{
88
private partial IAlertManagerSubscription CreateSubscription(IMauiContext mauiContext)
99
{
10-
throw new NotImplementedException();
10+
return new AlertRequestHelper();
1111
}
1212

1313
internal partial class AlertRequestHelper
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
#nullable enable
2+
~override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.ViewWillTransitionToSize(CoreGraphics.CGSize toSize, UIKit.IUIViewControllerTransitionCoordinator coordinator) -> void
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
#nullable enable
2+
~override Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.ViewWillTransitionToSize(CoreGraphics.CGSize toSize, UIKit.IUIViewControllerTransitionCoordinator coordinator) -> void

src/Controls/src/Core/Shell/ShellSection.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,12 +992,22 @@ protected virtual void OnRemovePage(Page page)
992992
}
993993

994994
internal bool IsVisibleSection => Parent?.Parent is Shell shell && shell.CurrentItem?.CurrentItem == this;
995+
995996
void PresentedPageDisappearing()
996997
{
997998
if (this is IShellSectionController sectionController)
998999
{
9991000
CurrentItem?.SendDisappearing();
1000-
sectionController.PresentedPage?.SendDisappearing();
1001+
var presentedPage = sectionController.PresentedPage;
1002+
if (presentedPage is not null)
1003+
{
1004+
// Don't send disappearing to a modal page if we're switching ShellItems
1005+
// The modal belongs to the new ShellItem, not the old one being disappeared
1006+
if (IsVisibleSection)
1007+
{
1008+
presentedPage.SendDisappearing();
1009+
}
1010+
}
10011011
}
10021012
}
10031013

src/Controls/src/Core/TimePicker/TimePicker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void ITextElement.OnTextTransformChanged(TextTransform oldValue, TextTransform n
222222
static void TimePropertyChanged(BindableObject bindable, object oldValue, object newValue)
223223
{
224224
if (bindable is TimePicker timePicker)
225-
timePicker.TimeSelected?.Invoke(timePicker, new TimeChangedEventArgs((TimeSpan)oldValue, (TimeSpan)newValue));
225+
timePicker.TimeSelected?.Invoke(timePicker, new TimeChangedEventArgs((TimeSpan?)oldValue, (TimeSpan?)newValue));
226226
}
227227

228228
private protected override string GetDebuggerDisplay()

0 commit comments

Comments
 (0)