From 261d94037f851d1f60517793f9d9ed0304b07d69 Mon Sep 17 00:00:00 2001 From: Martin Yankov Date: Fri, 24 Aug 2018 17:16:09 +0300 Subject: [PATCH] remove getSafeArea and geFullscreen methods --- tns-core-modules/ui/core/view/view-common.ts | 8 -------- tns-core-modules/ui/core/view/view.d.ts | 10 ---------- tns-core-modules/ui/core/view/view.ios.ts | 15 +++------------ 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/tns-core-modules/ui/core/view/view-common.ts b/tns-core-modules/ui/core/view/view-common.ts index 1b54240b9..e1fbe2afe 100644 --- a/tns-core-modules/ui/core/view/view-common.ts +++ b/tns-core-modules/ui/core/view/view-common.ts @@ -892,14 +892,6 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition { return undefined; } - public getFullscreenArea(): any { - return undefined; - } - - public getSafeArea(): any { - return undefined; - } - public getLocationInWindow(): Point { return undefined; } diff --git a/tns-core-modules/ui/core/view/view.d.ts b/tns-core-modules/ui/core/view/view.d.ts index 2d8130ab4..463853fb8 100644 --- a/tns-core-modules/ui/core/view/view.d.ts +++ b/tns-core-modules/ui/core/view/view.d.ts @@ -541,16 +541,6 @@ export abstract class View extends ViewBase { */ public getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top }): any; - /** - * Returns the iOS safe area frame of the closest parent with UIViewController. - */ - public getSafeArea(): any; - - /** - * Returns the iOS frame of the closest parent with UIViewController. - */ - public getFullscreenArea(): any; - /** * Returns the location of this view in the window coordinate system. */ diff --git a/tns-core-modules/ui/core/view/view.ios.ts b/tns-core-modules/ui/core/view/view.ios.ts index 20778e17d..f70b33a81 100644 --- a/tns-core-modules/ui/core/view/view.ios.ts +++ b/tns-core-modules/ui/core/view/view.ios.ts @@ -237,8 +237,9 @@ export class View extends ViewCommon { const locationOnScreen = this.getLocationOnScreen(); if (locationOnScreen) { - const safeArea = this.getSafeArea(); - const fullscreen = this.getFullscreenArea(); + const parentWithController = ios.getParentWithViewController(this); + const safeArea = parentWithController.viewController.view.safeAreaLayoutGuide.layoutFrame; + const fullscreen = parentWithController.viewController.view.frame; const onScreenLeft = layout.round(layout.toDevicePixels(locationOnScreen.x)); const onScreenTop = layout.round(layout.toDevicePixels(locationOnScreen.y)); @@ -306,16 +307,6 @@ export class View extends ViewCommon { return CGRectMake(left, top, width, height); } - public getFullscreenArea(): any { - const parentWithController = ios.getParentWithViewController(this); - return parentWithController.viewController.view.frame; - } - - public getSafeArea(): any { - const parentWithController = ios.getParentWithViewController(this); - return parentWithController.viewController.view.safeAreaLayoutGuide.layoutFrame; - } - public getLocationInWindow(): Point { if (!this.nativeViewProtected || !this.nativeViewProtected.window) { return undefined;