UNPKG

1.42 kBJavaScriptView Raw
1import { ProgressBase, valueProperty, maxValueProperty } from './progress-common';
2import { Color } from '../../color';
3import { colorProperty, backgroundColorProperty, backgroundInternalProperty } from '../styling/style-properties';
4export * from './progress-common';
5export class Progress extends ProgressBase {
6 createNativeView() {
7 return UIProgressView.new();
8 }
9 // @ts-ignore
10 get ios() {
11 return this.nativeViewProtected;
12 }
13 [valueProperty.getDefault]() {
14 return 0;
15 }
16 [valueProperty.setNative](value) {
17 this.ios.progress = value / this.maxValue;
18 }
19 [maxValueProperty.getDefault]() {
20 return 100;
21 }
22 [maxValueProperty.setNative](value) {
23 this.ios.progress = this.value / value;
24 }
25 [colorProperty.getDefault]() {
26 return this.ios.progressTintColor;
27 }
28 [colorProperty.setNative](value) {
29 this.ios.progressTintColor = value instanceof Color ? value.ios : value;
30 }
31 [backgroundColorProperty.getDefault]() {
32 return this.ios.trackTintColor;
33 }
34 [backgroundColorProperty.setNative](value) {
35 const color = value instanceof Color ? value.ios : value;
36 this.ios.trackTintColor = color;
37 }
38 [backgroundInternalProperty.getDefault]() {
39 return null;
40 }
41 [backgroundInternalProperty.setNative](value) {
42 //
43 }
44}
45//# sourceMappingURL=index.ios.js.map
\No newline at end of file