mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: move _getCurrentLayoutBounds from CustomLayoutView to View as extended by ListViewBase
This commit is contained in:
@@ -843,7 +843,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
||||
}
|
||||
|
||||
_getCurrentLayoutBounds(): { left: number; top: number; right: number; bottom: number } {
|
||||
return { left: this._oldLeft, top: this._oldTop, right: this._oldRight, bottom: this._oldBottom };
|
||||
return { left: 0, top: 0, right: 0, bottom: 0 };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -881,7 +881,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
||||
}
|
||||
|
||||
public getSafeAreaInsets(): { left, top, right, bottom } {
|
||||
return {left: 0, top: 0, right: 0, bottom: 0};
|
||||
return { left: 0, top: 0, right: 0, bottom: 0 };
|
||||
}
|
||||
|
||||
public getLocationInWindow(): Point {
|
||||
|
||||
@@ -545,6 +545,23 @@ export class View extends ViewCommon {
|
||||
}
|
||||
}
|
||||
|
||||
_getCurrentLayoutBounds(): { left: number; top: number; right: number; bottom: number } {
|
||||
const nativeView = this.nativeViewProtected;
|
||||
if (nativeView && !this.isCollapsed) {
|
||||
const frame = nativeView.frame;
|
||||
const origin = frame.origin;
|
||||
const size = frame.size;
|
||||
return {
|
||||
left: Math.round(layout.toDevicePixels(origin.x)),
|
||||
top: Math.round(layout.toDevicePixels(origin.y)),
|
||||
right: Math.round(layout.toDevicePixels(origin.x + size.width)),
|
||||
bottom: Math.round(layout.toDevicePixels(origin.y + size.height))
|
||||
};
|
||||
} else {
|
||||
return { left: 0, top: 0, right: 0, bottom: 0 };
|
||||
}
|
||||
}
|
||||
|
||||
_redrawNativeBackground(value: UIColor | Background): void {
|
||||
let updateSuspended = this._isPresentationLayerUpdateSuspeneded();
|
||||
if (!updateSuspended) {
|
||||
@@ -630,23 +647,6 @@ export class CustomLayoutView extends ContainerView {
|
||||
child.nativeViewProtected.removeFromSuperview();
|
||||
}
|
||||
}
|
||||
|
||||
_getCurrentLayoutBounds(): { left: number; top: number; right: number; bottom: number } {
|
||||
const nativeView = this.nativeViewProtected;
|
||||
if (nativeView && !this.isCollapsed) {
|
||||
const frame = nativeView.frame;
|
||||
const origin = frame.origin;
|
||||
const size = frame.size;
|
||||
return {
|
||||
left: layout.toDevicePixels(origin.x),
|
||||
top: layout.toDevicePixels(origin.y),
|
||||
right: layout.toDevicePixels(origin.x + size.width),
|
||||
bottom: layout.toDevicePixels(origin.y + size.height)
|
||||
};
|
||||
} else {
|
||||
return { left: 0, top: 0, right: 0, bottom: 0 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ios {
|
||||
@@ -845,7 +845,7 @@ export namespace ios {
|
||||
}
|
||||
}
|
||||
|
||||
return { safeArea: safeArea, fullscreen: fullscreen}
|
||||
return { safeArea: safeArea, fullscreen: fullscreen }
|
||||
}
|
||||
|
||||
export class UILayoutViewController extends UIViewController {
|
||||
|
||||
Reference in New Issue
Block a user