mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
54
nativescript-core/ui/progress/index.ios.ts
Normal file
54
nativescript-core/ui/progress/index.ios.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import {
|
||||
ProgressBase, Color, valueProperty, maxValueProperty,
|
||||
colorProperty, backgroundColorProperty, backgroundInternalProperty
|
||||
} from "./progress-common";
|
||||
|
||||
export * from "./progress-common";
|
||||
|
||||
export class Progress extends ProgressBase {
|
||||
nativeViewProtected: UIProgressView;
|
||||
|
||||
createNativeView() {
|
||||
return UIProgressView.new();
|
||||
}
|
||||
|
||||
get ios() {
|
||||
return this.nativeViewProtected;
|
||||
}
|
||||
|
||||
[valueProperty.getDefault](): number {
|
||||
return 0;
|
||||
}
|
||||
[valueProperty.setNative](value: number) {
|
||||
this.ios.progress = value / this.maxValue;
|
||||
}
|
||||
|
||||
[maxValueProperty.getDefault](): number {
|
||||
return 100;
|
||||
}
|
||||
[maxValueProperty.setNative](value: number) {
|
||||
this.ios.progress = this.value / value;
|
||||
}
|
||||
|
||||
[colorProperty.getDefault](): UIColor {
|
||||
return this.ios.progressTintColor;
|
||||
}
|
||||
[colorProperty.setNative](value: Color | UIColor) {
|
||||
this.ios.progressTintColor = value instanceof Color ? value.ios : value;
|
||||
}
|
||||
|
||||
[backgroundColorProperty.getDefault](): UIColor {
|
||||
return this.ios.trackTintColor;
|
||||
}
|
||||
[backgroundColorProperty.setNative](value: UIColor | Color) {
|
||||
let color = value instanceof Color ? value.ios : value;
|
||||
this.ios.trackTintColor = color;
|
||||
}
|
||||
|
||||
[backgroundInternalProperty.getDefault](): UIColor {
|
||||
return null;
|
||||
}
|
||||
[backgroundInternalProperty.setNative](value: Color) {
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user