Merge branch 'ios-safe-area' of github.com:NativeScript/NativeScript into ios-safe-area

This commit is contained in:
Vasil Chimev
2018-09-21 16:43:13 +03:00
36 changed files with 362 additions and 85 deletions

View File

@@ -106,6 +106,7 @@ export class LayoutBaseCommon extends CustomLayoutView implements LayoutBaseDefi
}
public clipToBounds: boolean;
public isPassThroughParentEnabled: boolean;
public _childIndexToNativeChildIndex(index?: number): number {
if (index === undefined) {
@@ -151,3 +152,6 @@ export class LayoutBaseCommon extends CustomLayoutView implements LayoutBaseDefi
export const clipToBoundsProperty = new Property<LayoutBaseCommon, boolean>({ name: "clipToBounds", defaultValue: true, valueConverter: booleanConverter });
clipToBoundsProperty.register(LayoutBaseCommon);
export const isPassThroughParentEnabledProperty = new Property<LayoutBaseCommon, boolean>({ name: "isPassThroughParentEnabled", defaultValue: false, valueConverter: booleanConverter });
isPassThroughParentEnabledProperty.register(LayoutBaseCommon);

View File

@@ -1,5 +1,5 @@
import {
LayoutBaseCommon, clipToBoundsProperty,
LayoutBaseCommon, clipToBoundsProperty, isPassThroughParentEnabledProperty,
paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty, Length
} from "./layout-base-common";
@@ -25,6 +25,10 @@ export class LayoutBase extends LayoutBaseCommon {
console.warn(`clipToBounds with value false is not supported on Android. You can use this.android.getParent().setClipChildren(false) as an alternative`);
}
[isPassThroughParentEnabledProperty.setNative](value: boolean) {
(<any>this.nativeViewProtected).setPassThroughParent(value);
}
[paddingTopProperty.getDefault](): Length {
return { value: this._defaultPaddingTop, unit: "px" };
}

View File

@@ -96,6 +96,14 @@ export class LayoutBase extends CustomLayoutView {
* Gets or sets a value indicating whether to clip the content of this layout.
*/
clipToBounds: boolean;
/**
* Gets or sets a value indicating whether touch event should pass through to a parent view of the
* layout container in case an interactive child view did not handle it.
* Default value of this property is false. This does not affect the appearance of the view.
*/
isPassThroughParentEnabled: boolean;
}
export const clipToBoundsProperty: Property<LayoutBase, boolean>;
export const isPassThroughParentEnabledProperty: Property<LayoutBase, boolean>;

View File

@@ -1,10 +1,9 @@
import { LayoutBaseCommon, clipToBoundsProperty, View, layout } from "./layout-base-common";
import { ios as iosUtils } from "../../utils/utils";
import {
LayoutBaseCommon, clipToBoundsProperty, isPassThroughParentEnabledProperty, View
} from "./layout-base-common";
export * from "./layout-base-common";
const majorVersion = iosUtils.MajorVersion;
export class LayoutBase extends LayoutBaseCommon {
nativeViewProtected: UIView;
@@ -37,4 +36,8 @@ export class LayoutBase extends LayoutBaseCommon {
[clipToBoundsProperty.setNative](value: boolean) {
this._setNativeClipToBounds();
}
[isPassThroughParentEnabledProperty.setNative](value: boolean) {
(<any>this.nativeViewProtected).setPassThroughParent(value);
}
}