@@ -89,7 +89,7 @@ function initLayoutGuide(controller: UIViewController) {
8989
9090 return layoutGuide ;
9191}
92- function layoutView ( controller : IUILayoutViewController , owner : View ) : void {
92+ function layoutView ( controller : IMDLayoutViewController , owner : View ) : void {
9393 let layoutGuide = controller . view . safeAreaLayoutGuide ;
9494 if ( ! layoutGuide ) {
9595 Trace . write ( `safeAreaLayoutGuide during layout of ${ owner } . Creating fallback constraints, but layout might be wrong.` , Trace . categories . Layout , Trace . messageType . error ) ;
@@ -248,23 +248,23 @@ function getAvailableSpaceFromParent(view: View, frame: CGRect): { safeArea: CGR
248248 return { safeArea, fullscreen } ;
249249}
250250
251- declare class IUILayoutViewController extends UIViewController {
252- static new ( ) : IUILayoutViewController ;
253- static alloc ( ) : IUILayoutViewController ;
251+ declare class IMDLayoutViewController extends UIViewController {
252+ static new ( ) : IMDLayoutViewController ;
253+ static alloc ( ) : IMDLayoutViewController ;
254254 owner : WeakRef < View > ;
255255 nsAnimated : boolean ;
256256 ignoreBottomSafeArea : boolean ;
257257 ignoreTopSafeArea : boolean ;
258258}
259259
260260@NativeClass
261- class UILayoutViewController extends UIViewController {
261+ class MDLayoutViewController extends UIViewController {
262262 owner : WeakRef < View > ;
263263 ignoreBottomSafeArea : boolean ;
264264 ignoreTopSafeArea : boolean ;
265265 nsAnimated : boolean ;
266266 public static initWithOwner ( owner : View ) {
267- const delegate = UILayoutViewController . new ( ) as UILayoutViewController ;
267+ const delegate = MDLayoutViewController . new ( ) as MDLayoutViewController ;
268268 delegate . owner = new WeakRef ( owner ) ;
269269
270270 return delegate ;
@@ -298,41 +298,6 @@ class UILayoutViewController extends UIViewController {
298298 const owner = this . owner . get ( ) ;
299299 if ( owner ) {
300300 layoutView ( this , owner ) ;
301- // if (majorVersion >= 11) {
302- // // Handle nested UILayoutViewController safe area application.
303- // // Currently, UILayoutViewController can be nested only in a TabView.
304- // // The TabView itself is handled by the OS, so we check the TabView's parent (usually a Page, but can be a Layout).
305- // const tabViewItem = owner.parent;
306- // const tabView = tabViewItem && tabViewItem.parent;
307- // let parent = tabView && tabView.parent;
308-
309- // // Handle Angular scenario where TabView is in a ProxyViewContainer
310- // // It is possible to wrap components in ProxyViewContainers indefinitely
311- // // Not using instanceof ProxyViewContainer to avoid circular dependency
312- // // TODO: Try moving UILayoutViewController out of view module
313- // while (parent && !parent.nativeViewProtected) {
314- // parent = parent.parent;
315- // }
316- // const additionalInsets = { top: 0, left: 0, bottom: 0, right: 0 };
317-
318- // if (parent) {
319- // const parentPageInsetsTop = parent.nativeViewProtected.safeAreaInsets.top;
320- // const currentInsetsTop = this.view.safeAreaInsets.top;
321- // const additionalInsetsTop = Math.max(parentPageInsetsTop - currentInsetsTop, 0);
322-
323- // const parentPageInsetsBottom = parent.nativeViewProtected.safeAreaInsets.bottom;
324- // const currentInsetsBottom = this.view.safeAreaInsets.bottom;
325- // const additionalInsetsBottom = Math.max(parentPageInsetsBottom - currentInsetsBottom, 0);
326-
327- // if (additionalInsetsTop > 0 || additionalInsetsBottom > 0) {
328- // additionalInsets.top = additionalInsetsTop;
329- // additionalInsets.bottom = additionalInsetsBottom;
330- // }
331- // }
332-
333- // const insets = new UIEdgeInsets(additionalInsets);
334- // this.additionalSafeAreaInsets = insets;
335- // }
336301 }
337302 }
338303
@@ -355,10 +320,6 @@ class UILayoutViewController extends UIViewController {
355320 // let s not call callUnloaded here in case
356321 // another modal / sheet is shown on top
357322 // will be called on dismiss
358- // const owner = this.owner.get();
359- // if (owner && !owner.parent) {
360- // owner.callUnloaded();
361- // }
362323 }
363324
364325 // Mind implementation for other controllers
@@ -402,11 +363,11 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
402363 this . _setupAsRootView ( { } ) ;
403364
404365 this . _commonShowNativeBottomSheet ( parentWithController , options ) ;
405- let controller : IUILayoutViewController = this . viewController ;
366+ let controller : IMDLayoutViewController = this . viewController ;
406367 if ( ! controller ) {
407368 const nativeView = this . ios || this . nativeViewProtected ;
408- controller = UILayoutViewController . initWithOwner ( this ) ;
409- // newController = IOSHelper.UILayoutViewController .initWithOwner(new WeakRef(item.content)) as UIViewController;
369+ controller = MDLayoutViewController . initWithOwner ( this ) ;
370+ // newController = IOSHelper.MDLayoutViewController .initWithOwner(new WeakRef(item.content)) as UIViewController;
410371 if ( options . ignoreBottomSafeArea !== undefined ) {
411372 controller . ignoreBottomSafeArea = options . ignoreBottomSafeArea ;
412373 } else {
0 commit comments