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

Implement Safe Area handling for iOS #2001

Merged
merged 4 commits into from
Aug 9, 2021
Merged

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Aug 8, 2021

Adds the ISafeAreaView interface to ILayout (and to Page in Controls).

Page implements ISafeAreaView.IgnoreSafeArea via the UseSafeArea platform specific.

Handle safe area offset checking for LayoutView and PageView.

Also fixes incorrect parameter type for ILayoutManager.ArrangeChildren (Rectangle -> Size).

IgnoreSafeArea=False IgnoreSafeArea=True
stayinsafearea ignore
safearea ignoresafearea

@@ -6,7 +6,7 @@ namespace Microsoft.Maui
/// Provides the base properties and methods for all Layout elements.
/// Use Layout elements to position and size child elements in .NET MAUI applications.
/// </summary>
public interface ILayout : IView, IContainer
public interface ILayout : IView, IContainer, ISafeAreaView
Copy link
Member

Choose a reason for hiding this comment

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

What is the benefit of having this on ILayout as opposed to IView?

I am thinking that for most people, a IScrollView might be the root? Also, for a game/drawn app, the root may be a canvas/graphics view?

@@ -6,6 +6,7 @@ namespace Microsoft.Maui.Layouts
public interface ILayoutManager
{
Size Measure(double widthConstraint, double heightConstraint);
Size ArrangeChildren(Rectangle childBounds);

Size ArrangeChildren(Size finalSize);
Copy link
Member

Choose a reason for hiding this comment

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

Just an FYI that this is an ABI break for P7 that may break layout implementors. So we may have to let them know before we release.

@Redth Redth added this to the 6.0.100-preview.7 milestone Aug 9, 2021
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Looks good. We can add the interface to IView later.

@mattleibow mattleibow merged commit ebb4a99 into release/6.0.1xx-preview7 Aug 9, 2021
@mattleibow mattleibow deleted the safearea branch August 9, 2021 15:25
@samhouts samhouts added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter area-controls-pages Page types layout-flex FlexLayout issues layout-grid layout-stack platform/android 🤖 platform/iOS 🍎 platform/windows 🪟 labels Jul 11, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jul 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2023
@Eilon Eilon removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-pages Page types labels May 10, 2024
@samhouts samhouts added the fixed-in-6.0.100-preview.7.3 Look for this fix in 6.0.100-preview.7.3! label Aug 2, 2024
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 fixed-in-6.0.100-preview.7.3 Look for this fix in 6.0.100-preview.7.3! layout-flex FlexLayout issues layout-grid layout-stack platform/android 🤖 platform/iOS 🍎 platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants