This repository was archived by the owner on Jun 3, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
ios/sdk/WeexSDK/Sources/Component Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 23
23
@implementation WXLoadingIndicator {
24
24
UIActivityIndicatorView *_indicator;
25
25
UIColor *_indicatorColor;
26
+ id _animating;
26
27
}
27
28
28
29
- (instancetype )initWithRef : (NSString *)ref type : (NSString *)type styles : (NSDictionary *)styles attributes : (NSDictionary *)attributes events : (NSArray *)events weexInstance : (WXSDKInstance *)weexInstance {
@@ -31,6 +32,9 @@ - (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDict
31
32
if (styles[@" color" ]) {
32
33
_indicatorColor = [WXConvert UIColor: styles[@" color" ]];
33
34
}
35
+ if (attributes[@" animating" ]) {
36
+ _animating = attributes[@" animating" ];
37
+ }
34
38
}
35
39
return self;
36
40
}
@@ -45,6 +49,13 @@ - (void)viewDidLoad {
45
49
if (_indicatorColor) {
46
50
_indicator.color = _indicatorColor;
47
51
}
52
+ if (_animating) {
53
+ if ([WXConvert BOOL: _animating]) {
54
+ [_indicator startAnimating ];
55
+ } else {
56
+ [_indicator stopAnimating ];
57
+ }
58
+ }
48
59
}
49
60
50
61
- (void )updateStyles : (NSDictionary *)styles {
@@ -54,6 +65,19 @@ - (void)updateStyles:(NSDictionary *)styles {
54
65
}
55
66
}
56
67
68
+ - (void )updateAttributes : (NSDictionary *)attributes
69
+ {
70
+ if (attributes[@" animating" ]) {
71
+ _animating = attributes[@" animating" ];
72
+
73
+ if ([WXConvert BOOL: _animating]) {
74
+ [_indicator startAnimating ];
75
+ } else {
76
+ [_indicator stopAnimating ];
77
+ }
78
+ }
79
+ }
80
+
57
81
#pragma mark - lifeCircle
58
82
59
83
- (void )viewWillUnload {
You can’t perform that action at this time.
0 commit comments