File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -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 }
@@ -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 ) ,
You can’t perform that action at this time.
0 commit comments