revert: "chore: ios relayout condition cleanup (#10241)"

This reverts commit 7eaafa519e8fa3579a92fc3ca9f2310182e5eb34.
This commit is contained in:
Nathan Walker
2023-03-28 10:43:31 -07:00
parent 318fb36175
commit 8da1ca910a
3 changed files with 98 additions and 101 deletions

View File

@ -138,19 +138,19 @@ allTests['STACKLAYOUT'] = stackLayoutTests;
import * as flexBoxLayoutTests from './ui/layouts/flexbox-layout-tests'; import * as flexBoxLayoutTests from './ui/layouts/flexbox-layout-tests';
allTests['FLEXBOXLAYOUT'] = flexBoxLayoutTests; allTests['FLEXBOXLAYOUT'] = flexBoxLayoutTests;
import * as safeAreaLayoutTests from './ui/layouts/safe-area-tests'; // import * as safeAreaLayoutTests from './ui/layouts/safe-area-tests';
import * as safeAreaListViewtTests from './ui/list-view/list-view-safe-area-tests'; // import * as safeAreaListViewtTests from './ui/list-view/list-view-safe-area-tests';
import * as scrollViewSafeAreaTests from './ui/scroll-view/scroll-view-safe-area-tests'; // import * as scrollViewSafeAreaTests from './ui/scroll-view/scroll-view-safe-area-tests';
import * as repeaterSafeAreaTests from './ui/repeater/repeater-safe-area-tests'; // import * as repeaterSafeAreaTests from './ui/repeater/repeater-safe-area-tests';
import * as webViewSafeAreaTests from './ui/web-view/web-view-safe-area-tests'; // import * as webViewSafeAreaTests from './ui/web-view/web-view-safe-area-tests';
if (isIOS && Utils.ios.MajorVersion > 10) { // if (isIOS && Utils.ios.MajorVersion > 10) {
allTests['SAFEAREALAYOUT'] = safeAreaLayoutTests; // allTests['SAFEAREALAYOUT'] = safeAreaLayoutTests;
allTests['SAFEAREA-LISTVIEW'] = safeAreaListViewtTests; // allTests['SAFEAREA-LISTVIEW'] = safeAreaListViewtTests;
allTests['SAFEAREA-SCROLL-VIEW'] = scrollViewSafeAreaTests; // allTests['SAFEAREA-SCROLL-VIEW'] = scrollViewSafeAreaTests;
allTests['SAFEAREA-REPEATER'] = repeaterSafeAreaTests; // allTests['SAFEAREA-REPEATER'] = repeaterSafeAreaTests;
allTests['SAFEAREA-WEBVIEW'] = webViewSafeAreaTests; // allTests['SAFEAREA-WEBVIEW'] = webViewSafeAreaTests;
} // }
import * as rootViewsCssClassesTests from './ui/styling/root-views-css-classes-tests'; import * as rootViewsCssClassesTests from './ui/styling/root-views-css-classes-tests';
allTests['ROOT-VIEWS-CSS-CLASSES'] = rootViewsCssClassesTests; allTests['ROOT-VIEWS-CSS-CLASSES'] = rootViewsCssClassesTests;

View File

@ -92,16 +92,14 @@ class UILayoutViewController extends UIViewController {
} }
layoutOwner(force = false) { layoutOwner(force = false) {
const owner = this.owner?.deref(); const owner = this.owner?.deref();
if (!owner) { if (!force && !!owner.nativeViewProtected?.layer.needsLayout?.()) {
return;
}
if (!force && owner.isLayoutValid && !owner.nativeViewProtected?.layer.needsLayout?.()) {
// we skip layout if the view is not yet laid out yet // we skip layout if the view is not yet laid out yet
// this usually means that viewDidLayoutSubviews will be called again // this usually means that viewDidLayoutSubviews will be called again
// so doing a layout pass now will layout with the wrong parameters // so doing a layout pass now will layout with the wrong parameters
return; return;
} }
if (owner) {
if (majorVersion >= 11) { if (majorVersion >= 11) {
// Handle nested UILayoutViewController safe area application. // Handle nested UILayoutViewController safe area application.
// Currently, UILayoutViewController can be nested only in a TabView. // Currently, UILayoutViewController can be nested only in a TabView.
@ -149,6 +147,7 @@ class UILayoutViewController extends UIViewController {
IOSHelper.layoutView(this, owner); IOSHelper.layoutView(this, owner);
} }
}
public viewWillAppear(animated: boolean): void { public viewWillAppear(animated: boolean): void {
super.viewWillAppear(animated); super.viewWillAppear(animated);

View File

@ -312,16 +312,13 @@ class UIViewControllerImpl extends UIViewController {
layoutOwner(force = false) { layoutOwner(force = false) {
const owner = this._owner?.deref(); const owner = this._owner?.deref();
if (!owner) { if (!force && !!owner.nativeViewProtected?.layer.needsLayout?.()) {
return;
}
if (!force && owner.isLayoutValid && !owner.nativeViewProtected?.layer.needsLayout?.()) {
// we skip layout if the view is not yet laid out yet // we skip layout if the view is not yet laid out yet
// this usually means that viewDidLayoutSubviews will be called again // this usually means that viewDidLayoutSubviews will be called again
// so doing a layout pass now will layout with the wrong parameters // so doing a layout pass now will layout with the wrong parameters
return; return;
} }
if (owner) {
// layout(owner.actionBar) // layout(owner.actionBar)
// layout(owner.content) // layout(owner.content)
@ -372,6 +369,7 @@ class UIViewControllerImpl extends UIViewController {
IOSHelper.layoutView(this, owner); IOSHelper.layoutView(this, owner);
} }
}
// Mind implementation for other controllerss // Mind implementation for other controllerss
public traitCollectionDidChange(previousTraitCollection: UITraitCollection): void { public traitCollectionDidChange(previousTraitCollection: UITraitCollection): void {