Skip to content

Conversation

praveenkumarkarunanithi
Copy link
Contributor

Root Cause

On Android and Windows, the FlyoutPage toolbar button did not update correctly when the device orientation changed. The NavigationPageToolbar lacked orientation change detection, so ShouldShowToolbarButton() was never re-evaluated after rotation.

Description of Change

Added orientation change handling in NavigationPageToolbar for Android and Windows by subscribing to DeviceDisplay.MainDisplayInfoChanged. On rotation, the toolbar button visibility is re-evaluated by calling ApplyChanges, which internally checks ShouldShowToolbarButton(). The subscription is cleaned up on disconnect to prevent leaks. This ensures the toolbar button updates correctly across orientation changes while following MAUI’s existing patterns for cross-platform event handling.

Issues Fixed

Fixes #24468

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Note:
The fix was implemented and tested on Android, iOS, and Windows platforms, as orientation changes could not be performed on macOS.

Output Video

Before Issue Fix After Issue Fix
Beforefix.mov
Afterfix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 10, 2025
Copy link
Contributor

Hey there @@praveenkumarkarunanithi! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 10, 2025
#if ANDROID || WINDOWS
void OnOrientationChanged(object sender, Microsoft.Maui.Devices.DisplayInfoChangedEventArgs e)
{
// Re-evaluate toolbar button visibility when orientation changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is re-evaluated on iOS? Why is not required in that case?


var text = App.FindElement("StatusLabel").GetText();
Assert.That(text, Contains.Substring("ShouldShowToolbarButton is called"));
App.SetOrientationPortrait();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use try-finally to always restore the state even if there is any error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-flyoutpage FlyoutPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flyout page in Android does not show flyout button (burger) consistently

2 participants