Skip to content

Commit 5072867

Browse files
committed
add android fillColor on all Apis
1 parent 9dfb05f commit 5072867

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

checkbox.android.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export class CheckBox extends View implements CheckBoxInterface {
131131

132132
public _createUI() {
133133

134-
this._android = new android.widget.CheckBox(this._context, null);
134+
// this._android = new android.widget.CheckBox(this._context, null);
135+
this._android = new android.support.v7.widget.AppCompatCheckBox(this._context, null);
135136

136137
if (this.checkPaddingLeft) {
137138
this._android.setPadding(parseInt(this.checkPaddingLeft), this._android.getPaddingTop(), this._android.getPaddingRight(), this._android.getPaddingBottom());
@@ -182,11 +183,9 @@ export class CheckBox extends View implements CheckBoxInterface {
182183

183184

184185
if (this._android) {
185-
if (this.fillColor && device.sdkVersion >= "21") {
186-
//Set bound colors
187-
this._android.setButtonTintList(android.content.res.ColorStateList.valueOf(new Color(this._fillColor).android));
186+
if (this.fillColor) {
187+
android.support.v4.widget.CompoundButtonCompat.setButtonTintList(this._android, android.content.res.ColorStateList.valueOf(new Color(this._fillColor).android));
188188
}
189-
190189
}
191190

192191
var that = new WeakRef(this);

0 commit comments

Comments
 (0)