Skip to content

[Android] Fixed SafeAreaEdges issue during Shell Navigation Transition#33788

Merged
PureWeen merged 4 commits intodotnet:mainfrom
NirmalKumarYuvaraj:fix-32941_2
Feb 2, 2026
Merged

[Android] Fixed SafeAreaEdges issue during Shell Navigation Transition#33788
PureWeen merged 4 commits intodotnet:mainfrom
NirmalKumarYuvaraj:fix-32941_2

Conversation

@NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Jan 30, 2026

Description of Change

This pull request improves how safe area insets are handled for animated views on Android, particularly during Shell navigation transitions. The changes ensure that insets are correctly applied when views are in motion (e.g., sliding in/out), preventing visual glitches and ensuring that child views receive valid inset data. Additionally, the logic has been refactored for clarity and maintainability.

Safe Area Insets Handling Improvements:

  • Added detection for animated states during Shell navigation by checking view positions relative to the screen and insets, ensuring the correct application of top and left insets when views are in transition. [1] [2]
  • Adjusted logic to avoid resetting padding for views that are already tracked, improving efficiency and correctness in how insets are reapplied.
  • Refined bottom and right inset calculations to maintain consistency with the new animation-aware logic. [1] [2]

Codebase Maintenance:

  • Removed outdated logic that handled views extending beyond screen bounds, replacing it with more precise animation state checks and comments for better maintainability.
  • Added missing AndroidX.Core.View import to support new inset handling features.

Test already present in Main

Issues Fixed

Fixes #33034
Fixes #32941
Fixes #33038
Fixes #33731

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 30, 2026
@NirmalKumarYuvaraj NirmalKumarYuvaraj added community ✨ Community Contribution area-safearea Issues/PRs that have to do with the SafeArea functionality platform/android labels Jan 30, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review January 30, 2026 13:26
Copilot AI review requested due to automatic review settings January 30, 2026 13:26
Copy link
Contributor

Copilot AI left a comment

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 fixes safe area inset handling on Android during Shell navigation transitions. The changes address three related issues where safe area padding was incorrectly applied or missing when navigating between tabs or pages in Shell.

Changes:

  • Replaced outdated "view extends beyond screen" detection with precise animation state detection logic
  • Added detection for Shell navigation animation states by checking view position relative to screen and insets
  • Improved code maintainability with additional comments explaining animation detection
  • Fixed inset calculation to properly handle views mid-transition
  • Added missing import and refactored variable declarations

Reviewed changes

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

File Description
src/Core/src/Platform/Android/SafeAreaExtensions.cs Core fix: Replaced view-extends-beyond-screen logic with animation-aware inset detection; added detailed comments explaining animation states; improved code formatting with consistent brace placement
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellPageContainer.cs Added AndroidX.Core.View import (though appears unused in final code)

@PureWeen
Copy link
Member

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@PureWeen
Copy link
Member

/rebase

@PureWeen
Copy link
Member

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@PureWeen
Copy link
Member

PureWeen commented Feb 1, 2026

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@PureWeen
Copy link
Member

PureWeen commented Feb 2, 2026

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/candidate February 2, 2026 21:21
@PureWeen PureWeen changed the base branch from inflight/candidate to main February 2, 2026 21:28
@PureWeen
Copy link
Member

PureWeen commented Feb 2, 2026

  • all android tests passed for this and that's all we are changing

@PureWeen PureWeen merged commit 9c0887b into dotnet:main Feb 2, 2026
142 of 163 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-safearea Issues/PRs that have to do with the SafeArea functionality community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android

Projects

None yet

3 participants