Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
- added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed Jun 17, 2022
1 parent 4a5dce7 commit 59e567f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ async void UpdateFlyoutLayoutBehavior(bool requestLayout = false)

if (Device.Idiom == TargetIdiom.Tablet && _flyoutLayout != null)
{
// This is required to add/remove the drawer button
// This basically runs the same code that runs when
// a device changes between landscape/portrait
_detailLayout.GetFirstChildOfType<NavigationPageRenderer>()?.ResetToolbar();
}
}
Expand Down Expand Up @@ -400,6 +403,8 @@ void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
else if (e.PropertyName == VisualElement.FlowDirectionProperty.PropertyName)
{
UpdateFlowDirection();

// This will move the drawer layout button to the proper side of the toolbar
_detailLayout.GetFirstChildOfType<NavigationPageRenderer>()?.UpdateToolbar();
}
else if (e.Is(FlyoutPage.FlyoutLayoutBehaviorProperty))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,10 @@ internal void UpdateToolbar()
toggle.DrawerIndicatorEnabled = _flyoutPage.ShouldShowToolbarButton();
toggle.SyncState();

// When pivoting between split mode and flyout mode
// The DrawerArrowDrawable Progress will get out of sync and show a back button
// this forces it back to a hamburger

if (toggle.DrawerArrowDrawable != null)
toggle.DrawerArrowDrawable.Progress = 0;
}
Expand Down

0 comments on commit 59e567f

Please sign in to comment.