mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: rename iosExpandSafeArea to iosOverflowSafeArea
Update type definitions.
This commit is contained in:
committed by
Martin Yankov
parent
f40d6c1a97
commit
806d82288b
@@ -1,4 +1,4 @@
|
||||
<GridLayout rows="*, *, *" columns="*, *, *" class="grid" iosExpandSafeArea="false">
|
||||
<GridLayout rows="*, *, *" columns="*, *, *" class="grid" iosOverflowSafeArea="false">
|
||||
<Label row="0" col="0" text="overflowing text, overflowing text"></Label>
|
||||
<Label row="0" col="1" text="overflowing text, overflowing text"></Label>
|
||||
<Label row="0" col="2" text="overflowing text, overflowing text"></Label>
|
||||
|
||||
@@ -586,7 +586,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
||||
public originY: number;
|
||||
public isEnabled: boolean;
|
||||
public isUserInteractionEnabled: boolean;
|
||||
public iosExpandSafeArea: boolean;
|
||||
public iosOverflowSafeArea: boolean;
|
||||
|
||||
get isLayoutValid(): boolean {
|
||||
return this._isLayoutValid;
|
||||
@@ -1006,9 +1006,6 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
||||
}
|
||||
}
|
||||
|
||||
export const iosExpandSafeAreaProperty = new Property<ViewCommon, boolean>({ name: "iosExpandSafeArea", defaultValue: false, valueConverter: booleanConverter });
|
||||
iosExpandSafeAreaProperty.register(ViewCommon);
|
||||
|
||||
export const automationTextProperty = new Property<ViewCommon, string>({ name: "automationText" });
|
||||
automationTextProperty.register(ViewCommon);
|
||||
|
||||
@@ -1030,3 +1027,6 @@ isEnabledProperty.register(ViewCommon);
|
||||
|
||||
export const isUserInteractionEnabledProperty = new Property<ViewCommon, boolean>({ name: "isUserInteractionEnabled", defaultValue: true, valueConverter: booleanConverter });
|
||||
isUserInteractionEnabledProperty.register(ViewCommon);
|
||||
|
||||
export const iosOverflowSafeAreaProperty = new Property<ViewCommon, boolean>({ name: "iosOverflowSafeArea", defaultValue: false, valueConverter: booleanConverter });
|
||||
iosOverflowSafeAreaProperty.register(ViewCommon);
|
||||
|
||||
@@ -817,7 +817,7 @@ export class View extends ViewCommon {
|
||||
}
|
||||
|
||||
export class ContainerView extends View {
|
||||
public iosExpandSafeArea: boolean;
|
||||
public iosOverflowSafeArea: boolean;
|
||||
}
|
||||
|
||||
export class CustomLayoutView extends ContainerView implements CustomLayoutViewDefinition {
|
||||
|
||||
12
tns-core-modules/ui/core/view/view.d.ts
vendored
12
tns-core-modules/ui/core/view/view.d.ts
vendored
@@ -344,6 +344,11 @@ export abstract class View extends ViewBase {
|
||||
*/
|
||||
isUserInteractionEnabled: boolean;
|
||||
|
||||
/**
|
||||
* Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: false
|
||||
*/
|
||||
iosOverflowSafeArea: boolean;
|
||||
|
||||
/**
|
||||
* Gets is layout is valid. This is a read-only property.
|
||||
*/
|
||||
@@ -711,7 +716,7 @@ export class ContainerView extends View {
|
||||
/**
|
||||
* Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: true
|
||||
*/
|
||||
public iosExpandSafeArea: boolean;
|
||||
public iosOverflowSafeArea: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -791,6 +796,7 @@ export const originXProperty: Property<View, number>;
|
||||
export const originYProperty: Property<View, number>;
|
||||
export const isEnabledProperty: Property<View, boolean>;
|
||||
export const isUserInteractionEnabledProperty: Property<View, boolean>;
|
||||
export const iosOverflowSafeAreaProperty: Property<View, boolean>;
|
||||
|
||||
export namespace ios {
|
||||
/**
|
||||
@@ -801,6 +807,10 @@ export namespace ios {
|
||||
export function updateAutoAdjustScrollInsets(controller: any /* UIViewController */, owner: View): void
|
||||
export function updateConstraints(controller: any /* UIViewController */, owner: View): void;
|
||||
export function layoutView(controller: any /* UIViewController */, owner: View): void;
|
||||
export function getPositionFromFrame(frame: any /* CGRect */): { left, top, right, bottom };
|
||||
export function getFrameFromPosition(position: { left, top, right, bottom }, insets?: { left, top, right, bottom }): any /* CGRect */;
|
||||
export function shrinkToSafeArea(view: View, frame: any /* CGRect */): any /* CGRect */;
|
||||
export function expandBeyondSafeArea(view: View, frame: any /* CGRect */): any /* CGRect */;
|
||||
export class UILayoutViewController {
|
||||
public static initWithOwner(owner: WeakRef<View>): UILayoutViewController;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ export class View extends ViewCommon {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!this.iosExpandSafeArea) {
|
||||
if (!this.iosOverflowSafeArea) {
|
||||
return ios.shrinkToSafeArea(this, frame);
|
||||
} else if (this.nativeViewProtected && this.nativeViewProtected.window) {
|
||||
return ios.expandBeyondSafeArea(this, frame);
|
||||
@@ -579,11 +579,11 @@ View.prototype._nativeBackgroundState = "unset";
|
||||
|
||||
export class ContainerView extends View {
|
||||
|
||||
public iosExpandSafeArea: boolean;
|
||||
public iosOverflowSafeArea: boolean;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.iosExpandSafeArea = true;
|
||||
this.iosOverflowSafeArea = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user