mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Split get/set native to getDefault setNative
This commit is contained in:
@ -23,24 +23,24 @@ export class Progress extends ProgressBase {
|
||||
return this._android;
|
||||
}
|
||||
|
||||
get [valueProperty.native](): number {
|
||||
[valueProperty.getDefault](): number {
|
||||
return 0;
|
||||
}
|
||||
set [valueProperty.native](value: number) {
|
||||
[valueProperty.setNative](value: number) {
|
||||
this._android.setProgress(value);
|
||||
}
|
||||
|
||||
get [maxValueProperty.native](): number {
|
||||
[maxValueProperty.getDefault](): number {
|
||||
return 100;
|
||||
}
|
||||
set [maxValueProperty.native](value: number) {
|
||||
[maxValueProperty.setNative](value: number) {
|
||||
this._android.setMax(value);
|
||||
}
|
||||
|
||||
get [colorProperty.native](): android.graphics.drawable.Drawable {
|
||||
[colorProperty.getDefault](): android.graphics.drawable.Drawable {
|
||||
return null;
|
||||
}
|
||||
set [colorProperty.native](value: Color) {
|
||||
[colorProperty.setNative](value: Color) {
|
||||
let progressDrawable = this._android.getProgressDrawable();
|
||||
if (!progressDrawable) {
|
||||
return;
|
||||
@ -53,10 +53,10 @@ export class Progress extends ProgressBase {
|
||||
}
|
||||
}
|
||||
|
||||
get [backgroundColorProperty.native](): number {
|
||||
[backgroundColorProperty.getDefault](): number {
|
||||
return null;
|
||||
}
|
||||
set [backgroundColorProperty.native](value: Color) {
|
||||
[backgroundColorProperty.setNative](value: Color) {
|
||||
let progressDrawable = this._android.getProgressDrawable();
|
||||
if (!progressDrawable) {
|
||||
return;
|
||||
@ -74,10 +74,10 @@ export class Progress extends ProgressBase {
|
||||
}
|
||||
}
|
||||
|
||||
get [backgroundInternalProperty.native](): number {
|
||||
[backgroundInternalProperty.getDefault](): number {
|
||||
return null;
|
||||
}
|
||||
set [backgroundInternalProperty.native](value: Color) {
|
||||
[backgroundInternalProperty.setNative](value: Color) {
|
||||
//
|
||||
}
|
||||
}
|
@ -20,39 +20,39 @@ export class Progress extends ProgressBase {
|
||||
return this._ios;
|
||||
}
|
||||
|
||||
get [valueProperty.native](): number {
|
||||
[valueProperty.getDefault](): number {
|
||||
return 0;
|
||||
}
|
||||
set [valueProperty.native](value: number) {
|
||||
[valueProperty.setNative](value: number) {
|
||||
this._ios.progress = value / this.maxValue;
|
||||
}
|
||||
|
||||
get [maxValueProperty.native](): number {
|
||||
[maxValueProperty.getDefault](): number {
|
||||
return 100;
|
||||
}
|
||||
set [maxValueProperty.native](value: number) {
|
||||
[maxValueProperty.setNative](value: number) {
|
||||
this._ios.progress = this.value / value;
|
||||
}
|
||||
|
||||
get [colorProperty.native](): UIColor {
|
||||
[colorProperty.getDefault](): UIColor {
|
||||
return this._ios.progressTintColor;
|
||||
}
|
||||
set [colorProperty.native](value: Color | UIColor) {
|
||||
[colorProperty.setNative](value: Color | UIColor) {
|
||||
this._ios.progressTintColor = value instanceof Color ? value.ios : value;
|
||||
}
|
||||
|
||||
get [backgroundColorProperty.native](): UIColor {
|
||||
[backgroundColorProperty.getDefault](): UIColor {
|
||||
return this._ios.trackTintColor;
|
||||
}
|
||||
set [backgroundColorProperty.native](value: UIColor | Color) {
|
||||
[backgroundColorProperty.setNative](value: UIColor | Color) {
|
||||
let color = value instanceof Color ? value.ios : value;
|
||||
this._ios.trackTintColor = color;
|
||||
}
|
||||
|
||||
get [backgroundInternalProperty.native](): UIColor {
|
||||
[backgroundInternalProperty.getDefault](): UIColor {
|
||||
return null;
|
||||
}
|
||||
set [backgroundInternalProperty.native](value: Color) {
|
||||
[backgroundInternalProperty.setNative](value: Color) {
|
||||
//
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user