@@ -89,7 +89,7 @@ function initLayoutGuide(controller: UIViewController) {
89
89
90
90
return layoutGuide ;
91
91
}
92
- function layoutView ( controller : IUILayoutViewController , owner : View ) : void {
92
+ function layoutView ( controller : IMDLayoutViewController , owner : View ) : void {
93
93
let layoutGuide = controller . view . safeAreaLayoutGuide ;
94
94
if ( ! layoutGuide ) {
95
95
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
248
248
return { safeArea, fullscreen } ;
249
249
}
250
250
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 ;
254
254
owner : WeakRef < View > ;
255
255
nsAnimated : boolean ;
256
256
ignoreBottomSafeArea : boolean ;
257
257
ignoreTopSafeArea : boolean ;
258
258
}
259
259
260
260
@NativeClass
261
- class UILayoutViewController extends UIViewController {
261
+ class MDLayoutViewController extends UIViewController {
262
262
owner : WeakRef < View > ;
263
263
ignoreBottomSafeArea : boolean ;
264
264
ignoreTopSafeArea : boolean ;
265
265
nsAnimated : boolean ;
266
266
public static initWithOwner ( owner : View ) {
267
- const delegate = UILayoutViewController . new ( ) as UILayoutViewController ;
267
+ const delegate = MDLayoutViewController . new ( ) as MDLayoutViewController ;
268
268
delegate . owner = new WeakRef ( owner ) ;
269
269
270
270
return delegate ;
@@ -298,41 +298,6 @@ class UILayoutViewController extends UIViewController {
298
298
const owner = this . owner . get ( ) ;
299
299
if ( owner ) {
300
300
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
- // }
336
301
}
337
302
}
338
303
@@ -355,10 +320,6 @@ class UILayoutViewController extends UIViewController {
355
320
// let s not call callUnloaded here in case
356
321
// another modal / sheet is shown on top
357
322
// will be called on dismiss
358
- // const owner = this.owner.get();
359
- // if (owner && !owner.parent) {
360
- // owner.callUnloaded();
361
- // }
362
323
}
363
324
364
325
// Mind implementation for other controllers
@@ -402,11 +363,11 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
402
363
this . _setupAsRootView ( { } ) ;
403
364
404
365
this . _commonShowNativeBottomSheet ( parentWithController , options ) ;
405
- let controller : IUILayoutViewController = this . viewController ;
366
+ let controller : IMDLayoutViewController = this . viewController ;
406
367
if ( ! controller ) {
407
368
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;
410
371
if ( options . ignoreBottomSafeArea !== undefined ) {
411
372
controller . ignoreBottomSafeArea = options . ignoreBottomSafeArea ;
412
373
} else {
0 commit comments