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:
@@ -48,17 +48,17 @@ export class Switch extends SwitchBase {
|
||||
return this._android;
|
||||
}
|
||||
|
||||
get [checkedProperty.native](): boolean {
|
||||
[checkedProperty.getDefault](): boolean {
|
||||
return false;
|
||||
}
|
||||
set [checkedProperty.native](value: boolean) {
|
||||
[checkedProperty.setNative](value: boolean) {
|
||||
this._android.setChecked(value);
|
||||
}
|
||||
|
||||
get [colorProperty.native](): number {
|
||||
[colorProperty.getDefault](): number {
|
||||
return -1;
|
||||
}
|
||||
set [colorProperty.native](value: number | Color) {
|
||||
[colorProperty.setNative](value: number | Color) {
|
||||
if (value instanceof Color) {
|
||||
this._android.getThumbDrawable().setColorFilter(value.android, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
} else {
|
||||
@@ -66,10 +66,10 @@ export class Switch extends SwitchBase {
|
||||
}
|
||||
}
|
||||
|
||||
get [backgroundColorProperty.native](): number {
|
||||
[backgroundColorProperty.getDefault](): number {
|
||||
return -1;
|
||||
}
|
||||
set [backgroundColorProperty.native](value: number | Color) {
|
||||
[backgroundColorProperty.setNative](value: number | Color) {
|
||||
if (value instanceof Color) {
|
||||
this._android.getTrackDrawable().setColorFilter(value.android, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
} else {
|
||||
@@ -77,10 +77,10 @@ export class Switch extends SwitchBase {
|
||||
}
|
||||
}
|
||||
|
||||
get [backgroundInternalProperty.native](): any {
|
||||
[backgroundInternalProperty.getDefault](): any {
|
||||
return null;
|
||||
}
|
||||
set [backgroundInternalProperty.native](value: any) {
|
||||
[backgroundInternalProperty.setNative](value: any) {
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -62,31 +62,31 @@ export class Switch extends SwitchBase {
|
||||
this.setMeasuredDimension(widthAndState, heightAndState);
|
||||
}
|
||||
|
||||
get [checkedProperty.native](): boolean {
|
||||
[checkedProperty.getDefault](): boolean {
|
||||
return false;
|
||||
}
|
||||
set [checkedProperty.native](value: boolean) {
|
||||
[checkedProperty.setNative](value: boolean) {
|
||||
this._ios.on = value;
|
||||
}
|
||||
|
||||
get [colorProperty.native](): UIColor {
|
||||
[colorProperty.getDefault](): UIColor {
|
||||
return this._ios.thumbTintColor;
|
||||
}
|
||||
set [colorProperty.native](value: UIColor | Color) {
|
||||
[colorProperty.setNative](value: UIColor | Color) {
|
||||
this._ios.thumbTintColor = value instanceof Color ? value.ios : value;
|
||||
}
|
||||
|
||||
get [backgroundColorProperty.native](): UIColor {
|
||||
[backgroundColorProperty.getDefault](): UIColor {
|
||||
return this._ios.onTintColor;
|
||||
}
|
||||
set [backgroundColorProperty.native](value: UIColor | Color) {
|
||||
[backgroundColorProperty.setNative](value: UIColor | Color) {
|
||||
this._ios.onTintColor = value instanceof Color ? value.ios : value;
|
||||
}
|
||||
|
||||
get [backgroundInternalProperty.native](): any {
|
||||
[backgroundInternalProperty.getDefault](): any {
|
||||
return null;
|
||||
}
|
||||
set [backgroundInternalProperty.native](value: any) {
|
||||
[backgroundInternalProperty.setNative](value: any) {
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user