mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Split get/set native to getDefault setNative
This commit is contained in:
@@ -65,38 +65,38 @@ export class Button extends ButtonBase {
|
||||
}
|
||||
}
|
||||
|
||||
get [paddingTopProperty.native](): Length {
|
||||
[paddingTopProperty.getDefault](): Length {
|
||||
return { value: this._defaultPaddingTop, unit: "px" }
|
||||
}
|
||||
set [paddingTopProperty.native](value: Length) {
|
||||
[paddingTopProperty.setNative](value: Length) {
|
||||
org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeView, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0));
|
||||
}
|
||||
|
||||
get [paddingRightProperty.native](): Length {
|
||||
[paddingRightProperty.getDefault](): Length {
|
||||
return { value: this._defaultPaddingRight, unit: "px" }
|
||||
}
|
||||
set [paddingRightProperty.native](value: Length) {
|
||||
[paddingRightProperty.setNative](value: Length) {
|
||||
org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeView, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0));
|
||||
}
|
||||
|
||||
get [paddingBottomProperty.native](): Length {
|
||||
[paddingBottomProperty.getDefault](): Length {
|
||||
return { value: this._defaultPaddingBottom, unit: "px" }
|
||||
}
|
||||
set [paddingBottomProperty.native](value: Length) {
|
||||
[paddingBottomProperty.setNative](value: Length) {
|
||||
org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeView, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0));
|
||||
}
|
||||
|
||||
get [paddingLeftProperty.native](): Length {
|
||||
[paddingLeftProperty.getDefault](): Length {
|
||||
return { value: this._defaultPaddingLeft, unit: "px" }
|
||||
}
|
||||
set [paddingLeftProperty.native](value: Length) {
|
||||
[paddingLeftProperty.setNative](value: Length) {
|
||||
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeView, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
|
||||
}
|
||||
|
||||
get [zIndexProperty.native](): number {
|
||||
[zIndexProperty.getDefault](): number {
|
||||
return org.nativescript.widgets.ViewHelper.getZIndex(this.nativeView);
|
||||
}
|
||||
set [zIndexProperty.native](value: number) {
|
||||
[zIndexProperty.setNative](value: number) {
|
||||
org.nativescript.widgets.ViewHelper.setZIndex(this.nativeView, value);
|
||||
// API >= 21
|
||||
if (this.nativeView.setStateListAnimator) {
|
||||
|
||||
Reference in New Issue
Block a user