@@ -23,6 +23,7 @@ export class CheckBox extends Button implements CheckBoxInterface {
23
23
private _hideBox : boolean ;
24
24
private _boxType : number ;
25
25
private _tint : string ;
26
+ private _checkBoxBackgroundColor :string ;
26
27
private _onCheckColor : string ;
27
28
private _animationDuration : number ;
28
29
private _onAnimationType : number ;
@@ -50,34 +51,33 @@ export class CheckBox extends Button implements CheckBoxInterface {
50
51
this . _setValue ( CheckBox . checkedProperty , value ) ;
51
52
}
52
53
54
+ set checkBoxBackgroundColor ( color :string ) {
55
+ ( < any > this . _iosCheckbox ) . backgroundColor = new Color ( color ) . ios ;
56
+ this . _checkBoxBackgroundColor = color ;
57
+ }
53
58
set fillColor ( color : string ) {
54
59
this . _iosCheckbox . onFillColor = new Color ( color ) . ios ;
55
60
this . _fillColor = color ;
56
61
}
57
62
58
63
set tintColor ( color : string ) {
59
- this . _tintColor = color ;
60
64
this . _iosCheckbox . onTintColor = new Color ( color ) . ios ;
65
+ this . _tintColor = color ;
61
66
}
62
67
63
68
/* NATIVE PROPERTIES */
64
69
set checkedAnimated ( value : boolean ) {
65
- if ( this . _iosCheckbox )
66
- this . _iosCheckbox . setOnAnimated ( value , true ) ;
70
+ this . _iosCheckbox . setOnAnimated ( value , true ) ;
67
71
}
68
72
69
73
set lineWidth ( value : number ) {
70
- if ( this . _iosCheckbox )
71
- this . _iosCheckbox . lineWidth = value ;
72
- else
73
- this . _lineWidth = value ;
74
+ this . _iosCheckbox . lineWidth = value ;
75
+ this . _lineWidth = value ;
74
76
}
75
77
76
78
set hideBox ( value : boolean ) {
77
- if ( this . _iosCheckbox )
78
- this . _iosCheckbox . hideBox = value ;
79
- else
80
- this . _hideBox = value ;
79
+ this . _iosCheckbox . hideBox = value ;
80
+ this . _hideBox = value ;
81
81
}
82
82
83
83
set boxType ( value : number ) {
@@ -92,24 +92,18 @@ export class CheckBox extends Button implements CheckBoxInterface {
92
92
}
93
93
94
94
set tint ( color : string ) {
95
- if ( this . _iosCheckbox )
96
- this . _iosCheckbox . tintColor = new Color ( color ) . ios ;
97
- else
98
- this . _tint = color ;
95
+ ( < any > this . _iosCheckbox ) . tintColor = new Color ( color ) . ios ;
96
+ this . _tint = color ;
99
97
}
100
98
101
99
set onCheckColor ( color : string ) {
102
- if ( this . _iosCheckbox )
103
- this . _iosCheckbox . onCheckColor = new Color ( color ) . ios ;
104
- else
105
- this . _onCheckColor = color ;
100
+ this . _iosCheckbox . onCheckColor = new Color ( color ) . ios ;
101
+ this . _onCheckColor = color ;
106
102
}
107
103
108
104
set animationDuration ( value : number ) {
109
- if ( this . _iosCheckbox )
110
- this . _iosCheckbox . animationDuration = value ;
111
- else
112
- this . _animationDuration = value ;
105
+ this . _iosCheckbox . animationDuration = value ;
106
+ this . _animationDuration = value ;
113
107
}
114
108
115
109
set onAnimationType ( value : number ) {
@@ -120,10 +114,8 @@ export class CheckBox extends Button implements CheckBoxInterface {
120
114
}
121
115
122
116
set offAnimationType ( value : number ) {
123
- if ( this . _iosCheckbox )
124
- this . _iosCheckbox . offAnimationType = this . getAnimationType ( value ) ;
125
- else
126
- this . _offAnimationType = value ;
117
+ this . _iosCheckbox . offAnimationType = this . getAnimationType ( value ) ;
118
+ this . _offAnimationType = value ;
127
119
}
128
120
129
121
get nativeiOSCheckBox ( ) {
@@ -181,6 +173,9 @@ export class CheckBox extends Button implements CheckBoxInterface {
181
173
if ( typeof this . _onCheckColor !== 'undefined' ) {
182
174
this . onCheckColor = this . _onCheckColor ;
183
175
}
176
+ if ( typeof this . _checkBoxBackgroundColor !== 'undefined' ) {
177
+ this . checkBoxBackgroundColor = this . _checkBoxBackgroundColor ;
178
+ }
184
179
if ( typeof this . _fillColor !== 'undefined' ) {
185
180
this . fillColor = this . _fillColor ;
186
181
}
0 commit comments