1 | import { LayoutBaseCommon, clipToBoundsProperty, isPassThroughParentEnabledProperty } from './layout-base-common';
|
2 | import { Length, paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty } from '../styling/style-properties';
|
3 | export * from './layout-base-common';
|
4 | export class LayoutBase extends LayoutBaseCommon {
|
5 | [clipToBoundsProperty.getDefault]() {
|
6 | return true;
|
7 | }
|
8 | [clipToBoundsProperty.setNative](value) {
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | console.warn(`clipToBounds with value false is not supported on Android. You can use this.android.getParent().setClipChildren(false) as an alternative`);
|
20 | }
|
21 | [isPassThroughParentEnabledProperty.setNative](value) {
|
22 | this.nativeViewProtected.setPassThroughParent(value);
|
23 | }
|
24 | [paddingTopProperty.getDefault]() {
|
25 | return { value: this._defaultPaddingTop, unit: 'px' };
|
26 | }
|
27 | [paddingTopProperty.setNative](value) {
|
28 | org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0));
|
29 | }
|
30 | [paddingRightProperty.getDefault]() {
|
31 | return { value: this._defaultPaddingRight, unit: 'px' };
|
32 | }
|
33 | [paddingRightProperty.setNative](value) {
|
34 | org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0));
|
35 | }
|
36 | [paddingBottomProperty.getDefault]() {
|
37 | return { value: this._defaultPaddingBottom, unit: 'px' };
|
38 | }
|
39 | [paddingBottomProperty.setNative](value) {
|
40 | org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0));
|
41 | }
|
42 | [paddingLeftProperty.getDefault]() {
|
43 | return { value: this._defaultPaddingLeft, unit: 'px' };
|
44 | }
|
45 | [paddingLeftProperty.setNative](value) {
|
46 | org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
|
47 | }
|
48 | }
|
49 |
|
\ | No newline at end of file |