Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update StatusBar Size On Device Orientation Change - #3208

#3208
Merged
TheCodeTraveler merged 10 commits into
mainCommunityToolkit/Maui:mainfrom
Update-StatusBar-Size-On-Device-RotateCommunityToolkit/Maui:Update-StatusBar-Size-On-Device-RotateCopy head branch name to clipboard
Apr 21, 2026
Merged

Update StatusBar Size On Device Orientation Change#3208
TheCodeTraveler merged 10 commits into
mainCommunityToolkit/Maui:mainfrom
Update-StatusBar-Size-On-Device-RotateCommunityToolkit/Maui:Update-StatusBar-Size-On-Device-RotateCopy head branch name to clipboard

Conversation

@TheCodeTraveler

Copy link
Copy Markdown
Collaborator

Description of Change

This PR adds DeviceDisplay.Current.MainDisplayInfoChanged += OnMainDisplayInfoChanged; to StatusBarBehavior.shared.cs.

When the device is rotated, OnMainDisplayInfoChanged executes and updates the status bar size.

Linked Issues

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

Copilot AI review requested due to automatic review settings April 21, 2026 17:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses incorrect status bar sizing after device orientation changes by reacting to display info changes and updating the status bar overlay sizing accordingly (iOS safe-area sizing and Android API 35+ overlay sizing).

Changes:

  • Subscribes to DeviceDisplay.Current.MainDisplayInfoChanged in StatusBarBehavior to react to rotation/display changes.
  • Adds an Android API 35+ StatusBar.UpdateBarSize() helper and refactors overlay height calculation into a shared helper.
  • Minor doc comment tweak in the iOS status bar implementation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/StatusBar/StatusBarBehavior.shared.cs Adds display-change handling to update status bar size on orientation/display changes.
src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.android.cs Introduces UpdateBarSize() and consolidates status bar overlay height computation for API 35+.
src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.ios.cs Adjusts the XML doc summary wording for SetBarSize.

Comment thread src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.android.cs Outdated
Comment thread src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.android.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@TheCodeTraveler
TheCodeTraveler merged commit 4bfa770 into main Apr 21, 2026
10 checks passed
@TheCodeTraveler
TheCodeTraveler deleted the Update-StatusBar-Size-On-Device-Rotate branch April 21, 2026 19:04
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
@TheCodeTraveler
TheCodeTraveler restored the Update-StatusBar-Size-On-Device-Rotate branch May 11, 2026 16:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Android StatusBar size not updated on orientation switch [BUG] Setting StatusBarBehavior breaks it on iOS in landscape mode

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.