1
1
import { Color } from '@nativescript/core' ;
2
- import { AnimatedCircleCommon , barColorProperty , rimColorProperty , spinBarColorProperty } from './common' ;
2
+ import { AnimatedCircleCommon , barColorProperty , barWidthProperty , rimColorProperty , rimWidthProperty , spinBarColorProperty } from './common' ;
3
3
4
4
declare const at ;
5
5
@@ -68,8 +68,8 @@ export class AnimatedCircle extends AnimatedCircleCommon {
68
68
}
69
69
70
70
set progress ( value : number ) {
71
- this . _progress = value ;
72
- this . android ?. setValueAnimated ( this . _progress ) ;
71
+ this . _progress = Number ( value ) ;
72
+ this . updateAnimatedCircle ( ) ;
73
73
}
74
74
75
75
get progress ( ) : number {
@@ -104,8 +104,8 @@ export class AnimatedCircle extends AnimatedCircleCommon {
104
104
}
105
105
106
106
set maxValue ( value : number ) {
107
- this . _maxValue = value ;
108
- this . android ?. setMaxValue ( this . maxValue ) ;
107
+ this . _maxValue = Number ( value ) ;
108
+ this . updateAnimatedCircle ( ) ;
109
109
}
110
110
111
111
get maxValue ( ) : number {
@@ -114,11 +114,7 @@ export class AnimatedCircle extends AnimatedCircleCommon {
114
114
115
115
set rimColor ( value : any ) {
116
116
this . _rimColor = value ;
117
- if ( value instanceof Color ) {
118
- this . android ?. setRimColor ( value . argb ) ;
119
- } else {
120
- this . android ?. setRimColor ( new Color ( value ) . argb ) ;
121
- }
117
+ this . updateAnimatedCircle ( ) ;
122
118
}
123
119
124
120
get rimColor ( ) {
@@ -146,7 +142,7 @@ export class AnimatedCircle extends AnimatedCircleCommon {
146
142
147
143
set rimWidth ( value : number ) {
148
144
this . _rimWidth = Number ( value ) ;
149
- this . android ?. setRimWidth ( this . _rimWidth ) ;
145
+ this . updateAnimatedCircle ( ) ;
150
146
}
151
147
152
148
get rimWidth ( ) {
@@ -155,11 +151,7 @@ export class AnimatedCircle extends AnimatedCircleCommon {
155
151
156
152
set spinBarColor ( value : any ) {
157
153
this . _spinBarColor = value ;
158
- if ( value instanceof Color ) {
159
- this . android ?. setSpinBarColor ( value . argb ) ;
160
- } else {
161
- this . android ?. setSpinBarColor ( new Color ( this . spinBarColor ) . argb ) ;
162
- }
154
+ this . updateAnimatedCircle ( ) ;
163
155
}
164
156
165
157
get spinBarColor ( ) {
@@ -180,24 +172,17 @@ export class AnimatedCircle extends AnimatedCircleCommon {
180
172
}
181
173
182
174
set startAngle ( value : number ) {
183
- this . _startAngle = value ;
184
- this . android ?. setStartAngle ( this . _startAngle ) ;
175
+ this . _startAngle = Number ( value ) ;
176
+ this . updateAnimatedCircle ( ) ;
185
177
}
186
178
187
179
get startAngle ( ) {
188
180
return this . _startAngle ;
189
181
}
190
182
191
183
set barWidth ( value : number ) {
192
- this . _barWidth = value ;
193
- if ( this . _barWidth ) {
194
- this . android ?. setBarWidth ( this . _barWidth ) ;
195
- } else {
196
- if ( this . _rimWidth ) {
197
- // set rim width to bar width if no bar width provided
198
- this . android ?. setBarWidth ( this . _rimWidth ) ;
199
- }
200
- }
184
+ this . _barWidth = Number ( value ) ;
185
+ this . updateAnimatedCircle ( ) ;
201
186
}
202
187
203
188
get barWidth ( ) {
@@ -206,7 +191,7 @@ export class AnimatedCircle extends AnimatedCircleCommon {
206
191
207
192
set text ( value : string ) {
208
193
this . _text = value ;
209
- this . android ?. setText ( this . _text ) ;
194
+ this . updateAnimatedCircle ( ) ;
210
195
}
211
196
212
197
get text ( ) {
@@ -215,12 +200,12 @@ export class AnimatedCircle extends AnimatedCircleCommon {
215
200
216
201
set textColor ( value : string ) {
217
202
this . _textColor = new Color ( value ) ;
218
- this . android ?. setTextColor ( this . _textColor . argb ) ;
203
+ this . updateAnimatedCircle ( ) ;
219
204
}
220
205
221
206
set textSize ( value : number ) {
222
207
this . _textSize = value ;
223
- this . android ?. setTextSize ( value ) ;
208
+ this . updateAnimatedCircle ( ) ;
224
209
}
225
210
226
211
get textSize ( ) {
@@ -237,6 +222,16 @@ export class AnimatedCircle extends AnimatedCircleCommon {
237
222
}
238
223
// CSS Properties
239
224
225
+ [ barWidthProperty . setNative ] ( value : any ) {
226
+ this . _barWidth = value ;
227
+ this . android ?. setBarWidth ( value ) ;
228
+ }
229
+
230
+ [ rimWidthProperty . setNative ] ( value : any ) {
231
+ this . _rimWidth = value ;
232
+ this . android ?. setRimWidth ( value ) ;
233
+ }
234
+
240
235
[ rimColorProperty . setNative ] ( value : any ) {
241
236
this . _rimColor = value ;
242
237
if ( value instanceof Color ) {
0 commit comments