Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layout and safe area on FlyoutPage #10083

Merged
merged 4 commits into from
Sep 15, 2022
Merged

Fix layout and safe area on FlyoutPage #10083

merged 4 commits into from
Sep 15, 2022

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Sep 13, 2022

Description of Change

  • Change Catalyst so that "UseSafeArea" is true by default. On Catalyst the SafeArea is the title bar so if you don't account for it the content just vanishes behind the title bar. For example, currently if you just put a ContentPage on the screen with a label the label will just vanish behind the titlebar.
  • fix the check inside PhoneFlyoutPageRenderer so it checks the correct properties to figure out if it should call layout with the new size

Issues Fixed

Fixes #6408

@PureWeen PureWeen marked this pull request as ready for review September 13, 2022 02:47
_viewHandlerWrapper.SetVirtualView(element, OnElementChanged, false);
Presented = ((FlyoutPage)element).IsPresented;
Copy link
Member Author

@PureWeen PureWeen Sep 13, 2022

Choose a reason for hiding this comment

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

This fixes an NRE caused by setting Presented before the _viewHandlerWrapper has been set. Which popped up from the test that's part of this PR

@@ -594,29 +594,48 @@ internal static IDisposable OnLoaded(this UIView uiView, Action action)
}

Dictionary<NSString, NSObject> observers = new Dictionary<NSString, NSObject>();
ActionDisposable? disposable = new ActionDisposable(() =>
ActionDisposable? disposable = null;
Copy link
Member Author

Choose a reason for hiding this comment

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

The modifications here all were necessary to fix FlyoutPage so it would fire Loaded. The Unit Tests use Loaded to know when to proceed with the tests.

@jsuarezruiz jsuarezruiz added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Sep 13, 2022
@PureWeen PureWeen marked this pull request as draft September 14, 2022 15:16
@PureWeen PureWeen marked this pull request as ready for review September 14, 2022 15:56
@Redth Redth added this to the 7.0-rc2 milestone Sep 14, 2022
# Conflicts:
#	src/Controls/tests/DeviceTests/Stubs/WindowHandlerStub.iOS.cs
@PureWeen PureWeen merged commit ad821cd into main Sep 15, 2022
@PureWeen PureWeen deleted the fix_flyout_safe_area branch September 15, 2022 19:13
RadekVyM added a commit to RadekVyM/SimpleToolkit that referenced this pull request Nov 25, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlyoutPage issues on macOS
5 participants