diff --git a/e2e/safe-area/app/expand/fragments/grid-3x3-fragment.xml b/e2e/safe-area/app/expand/fragments/grid-3x3-fragment.xml index 41da31d83..ee5bb9b97 100644 --- a/e2e/safe-area/app/expand/fragments/grid-3x3-fragment.xml +++ b/e2e/safe-area/app/expand/fragments/grid-3x3-fragment.xml @@ -1,4 +1,4 @@ - + diff --git a/tns-core-modules/ui/core/view/view-common.ts b/tns-core-modules/ui/core/view/view-common.ts index 0a1f4d2e3..c3a7d4b28 100644 --- a/tns-core-modules/ui/core/view/view-common.ts +++ b/tns-core-modules/ui/core/view/view-common.ts @@ -586,7 +586,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition { public originY: number; public isEnabled: boolean; public isUserInteractionEnabled: boolean; - public iosExpandSafeArea: boolean; + public iosOverflowSafeArea: boolean; get isLayoutValid(): boolean { return this._isLayoutValid; @@ -1006,9 +1006,6 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition { } } -export const iosExpandSafeAreaProperty = new Property({ name: "iosExpandSafeArea", defaultValue: false, valueConverter: booleanConverter }); -iosExpandSafeAreaProperty.register(ViewCommon); - export const automationTextProperty = new Property({ name: "automationText" }); automationTextProperty.register(ViewCommon); @@ -1030,3 +1027,6 @@ isEnabledProperty.register(ViewCommon); export const isUserInteractionEnabledProperty = new Property({ name: "isUserInteractionEnabled", defaultValue: true, valueConverter: booleanConverter }); isUserInteractionEnabledProperty.register(ViewCommon); + +export const iosOverflowSafeAreaProperty = new Property({ name: "iosOverflowSafeArea", defaultValue: false, valueConverter: booleanConverter }); +iosOverflowSafeAreaProperty.register(ViewCommon); diff --git a/tns-core-modules/ui/core/view/view.android.ts b/tns-core-modules/ui/core/view/view.android.ts index 37f35fc9d..948763d86 100644 --- a/tns-core-modules/ui/core/view/view.android.ts +++ b/tns-core-modules/ui/core/view/view.android.ts @@ -817,7 +817,7 @@ export class View extends ViewCommon { } export class ContainerView extends View { - public iosExpandSafeArea: boolean; + public iosOverflowSafeArea: boolean; } export class CustomLayoutView extends ContainerView implements CustomLayoutViewDefinition { diff --git a/tns-core-modules/ui/core/view/view.d.ts b/tns-core-modules/ui/core/view/view.d.ts index 8ab778172..83efcd184 100644 --- a/tns-core-modules/ui/core/view/view.d.ts +++ b/tns-core-modules/ui/core/view/view.d.ts @@ -344,6 +344,11 @@ export abstract class View extends ViewBase { */ isUserInteractionEnabled: boolean; + /** + * Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: false + */ + iosOverflowSafeArea: boolean; + /** * Gets is layout is valid. This is a read-only property. */ @@ -711,7 +716,7 @@ export class ContainerView extends View { /** * Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: true */ - public iosExpandSafeArea: boolean; + public iosOverflowSafeArea: boolean; } /** @@ -791,6 +796,7 @@ export const originXProperty: Property; export const originYProperty: Property; export const isEnabledProperty: Property; export const isUserInteractionEnabledProperty: Property; +export const iosOverflowSafeAreaProperty: Property; export namespace ios { /** @@ -801,6 +807,10 @@ export namespace ios { export function updateAutoAdjustScrollInsets(controller: any /* UIViewController */, owner: View): void export function updateConstraints(controller: any /* UIViewController */, owner: View): void; export function layoutView(controller: any /* UIViewController */, owner: View): void; + export function getPositionFromFrame(frame: any /* CGRect */): { left, top, right, bottom }; + export function getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top, right, bottom }): any /* CGRect */; + export function shrinkToSafeArea(view: View, frame: any /* CGRect */): any /* CGRect */; + export function expandBeyondSafeArea(view: View, frame: any /* CGRect */): any /* CGRect */; export class UILayoutViewController { public static initWithOwner(owner: WeakRef): UILayoutViewController; } diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts index c9cfb4f71..d9394929b 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -225,7 +225,7 @@ export class View extends ViewCommon { return null; } - if (!this.iosExpandSafeArea) { + if (!this.iosOverflowSafeArea) { return ios.shrinkToSafeArea(this, frame); } else if (this.nativeViewProtected && this.nativeViewProtected.window) { return ios.expandBeyondSafeArea(this, frame); @@ -579,11 +579,11 @@ View.prototype._nativeBackgroundState = "unset"; export class ContainerView extends View { - public iosExpandSafeArea: boolean; + public iosOverflowSafeArea: boolean; constructor() { super(); - this.iosExpandSafeArea = true; + this.iosOverflowSafeArea = true; } }