[Android] OnSizeAllocated event not fired for Android shell - fix#31035
[Android] OnSizeAllocated event not fired for Android shell - fix#31035kubaflo wants to merge 1 commit intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the OnSizeAllocated event was not being fired for Android Shell applications. The fix ensures that layout changes in the Shell's flyout renderer properly trigger the cross-platform layout system.
- Overrides the
OnLayoutmethod inShellFlyoutRendererto propagate layout changes to the Shell - Updates the public API to reflect the new method override
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
ShellFlyoutRenderer.cs |
Adds OnLayout override to trigger Shell layout updates when the flyout renderer's layout changes |
PublicAPI.Unshipped.txt |
Documents the new public API surface for the OnLayout method override |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRenderer.cs:315
- [nitpick] The variable name 'destination' is unclear in this context. Consider renaming it to 'layoutRect' or 'shellBounds' to better indicate it represents the layout bounds for the Shell.
var destination = Context.ToCrossPlatformRectInReferenceFrame(left, top, right, bottom);
|
Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
| base.OnLayout(changed, left, top, right, bottom); | ||
|
|
||
| var destination = Context.ToCrossPlatformRectInReferenceFrame(left, top, right, bottom); | ||
| Shell.Layout(destination); |
There was a problem hiding this comment.
The Layout method has been deprecated on net10
Can you rebase this to NET10 and we can see what this solution would look like on NET10
|
No needed |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
I've made the Android implementation to mirror the behavior of the iOS version shown below for consistency across platforms.

Issues Fixed
Fixes #31020