refactor: rename iosExpandSafeArea to iosOverflowSafeArea

Update type definitions.
This commit is contained in:
Vasil Chimev
2018-09-04 11:26:20 +03:00
parent 4379760dab
commit e1828d56cd
5 changed files with 21 additions and 11 deletions

View File

@@ -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>

View File

@@ -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);
@@ -1029,4 +1026,7 @@ export const isEnabledProperty = new Property<ViewCommon, boolean>({
isEnabledProperty.register(ViewCommon);
export const isUserInteractionEnabledProperty = new Property<ViewCommon, boolean>({ name: "isUserInteractionEnabled", defaultValue: true, valueConverter: booleanConverter });
isUserInteractionEnabledProperty.register(ViewCommon);
isUserInteractionEnabledProperty.register(ViewCommon);
export const iosOverflowSafeAreaProperty = new Property<ViewCommon, boolean>({ name: "iosOverflowSafeArea", defaultValue: false, valueConverter: booleanConverter });
iosOverflowSafeAreaProperty.register(ViewCommon);

View File

@@ -805,7 +805,7 @@ export class View extends ViewCommon {
}
export class ContainerView extends View {
public iosExpandSafeArea: boolean;
public iosOverflowSafeArea: boolean;
}
export class CustomLayoutView extends ContainerView implements CustomLayoutViewDefinition {

View File

@@ -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.
*/
@@ -707,7 +712,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;
}
/**
@@ -787,6 +792,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 {
/**
@@ -797,6 +803,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;
}

View File

@@ -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;
}
}