NotchSystem

NotchSystem is designed to calculate safe insets (paddings and margins) based on the shape of the device. It works well on the iOS devices for detecting the size of the notch. On other devices, insets can be manually fed into NotchSystem.

Many RedCorners.Forms views, including ContentPage2, ContentView2, TabBar and TitleBar, use the values from NotchSystem to adjust their appearance.

Methods

Thickness GetPageMargin()

This method returns the calculated safe insets for the device.

Properties

Thickness? OverridePadding = null;

When set, this overrides any values returned by the system.

Thickness ExtraPadding = new Thickness();

This value is added to any values returned by the system.

Thickness GetOverridePadding() { get; }

This readonly property returns OverridePadding + ExtraPadding.

GridLength BottomHeight { get; }

This readonly property returns new GridLength(GetPageMargin().Bottom).

Thickness TopMargin { get; }

This readonly property returns new Thickness(0, GetPageMargin().Top, 0, 0).

Thickness BottomMargin { get; }

This readonly property returns new Thickness(0, 0, 0, GetPageMargin().Bottom).

bool HasNotch { get; }

This readonly property returns whether the device has a notch. It only works on the iOS devices, and always returns false anywhere else.

bool HasWindowInformation { get; }

This readonly property returns true when NotchSystem has sufficient information about the type of the device.