99 Style ,
1010 booleanConverter
1111} from "tns-core-modules/ui/core/view" ;
12- declare const android : any ;
12+ declare const android : any , java : any ;
1313
1414export const checkedProperty = new Property < CheckBox , boolean > ( {
1515 name : "checked" ,
@@ -41,8 +41,14 @@ export const tintColorProperty = new CssProperty<Style, string>({
4141 }
4242} ) ;
4343
44+ export const enum BoxType {
45+ Circle = 1 ,
46+ Square = 2
47+ }
48+
4449export class CheckBox extends View implements CheckBoxInterface {
4550 private _android : any ; /// android.widget.CheckBox
51+ private _boxType : number ;
4652 private _checkStyle : string ;
4753 private _checkPadding : string ;
4854 private _checkPaddingLeft : string ;
@@ -58,6 +64,14 @@ export class CheckBox extends View implements CheckBoxInterface {
5864 return this . _android ;
5965 }
6066
67+ set boxType ( value : number ) {
68+ this . _boxType = value ;
69+ }
70+
71+ get boxType ( ) {
72+ return this . _boxType ;
73+ }
74+
6175 get checkStyle ( ) {
6276 return this . _checkStyle ;
6377 }
@@ -115,7 +129,7 @@ export class CheckBox extends View implements CheckBoxInterface {
115129 return "" ;
116130 }
117131 [ textProperty . setNative ] ( value : string ) {
118- this . nativeView . setText ( value ) ;
132+ this . nativeView . setText ( java . lang . String . valueOf ( value ) ) ;
119133 }
120134
121135 get fillColor ( ) : string {
@@ -140,10 +154,11 @@ export class CheckBox extends View implements CheckBoxInterface {
140154 }
141155
142156 public createNativeView ( ) {
143- this . _android = new android . support . v7 . widget . AppCompatCheckBox (
144- this . _context ,
145- null
146- ) ;
157+ this . _android = new android . support . v7 . widget [
158+ this . boxType == BoxType . Circle
159+ ? "AppCompatRadioButton"
160+ : "AppCompatCheckBox"
161+ ] ( this . _context , null ) ;
147162 if ( this . checkPaddingLeft ) {
148163 this . _android . setPadding (
149164 parseInt ( this . checkPaddingLeft ) ,
0 commit comments