|
1 |
| -import {CheckBoxInterface} from "./"; |
2 |
| -import {View} from "ui/core/view"; |
3 |
| -import {Color} from "color"; |
4 |
| -import {isAndroid, device} from "platform"; |
5 |
| -import {Property, PropertyChangeData} from "ui/core/dependency-observable"; |
6 |
| -import {PropertyMetadata} from "ui/core/proxy"; |
7 |
| -import {Font} from "ui/styling/font"; |
| 1 | +import { CheckBoxInterface } from "./"; |
| 2 | +import { View } from "ui/core/view"; |
| 3 | +import { Color } from "color"; |
| 4 | +import { isAndroid, device } from "platform"; |
| 5 | +import { Property, PropertyChangeData } from "ui/core/dependency-observable"; |
| 6 | +import { PropertyMetadata } from "ui/core/proxy"; |
| 7 | +import { Font } from "ui/styling/font"; |
8 | 8 | import enums = require("ui/enums");
|
9 | 9 | import style = require("ui/styling/style");
|
10 | 10 | import app = require("application");
|
@@ -51,44 +51,44 @@ export class CheckBox extends View implements CheckBoxInterface {
|
51 | 51 | this._checkStyle = style;
|
52 | 52 | }
|
53 | 53 |
|
54 |
| - set checkPadding(padding){ |
| 54 | + set checkPadding(padding) { |
55 | 55 | this._checkPadding = padding;
|
56 | 56 | }
|
57 | 57 |
|
58 |
| - get checkPadding(){ |
| 58 | + get checkPadding() { |
59 | 59 | return this._checkPadding;
|
60 | 60 | }
|
61 | 61 |
|
62 |
| - set checkPaddingLeft(padding){ |
| 62 | + set checkPaddingLeft(padding) { |
63 | 63 | this._checkPaddingLeft = padding;
|
64 | 64 | }
|
65 | 65 |
|
66 |
| - get checkPaddingLeft(){ |
| 66 | + get checkPaddingLeft() { |
67 | 67 | return this._checkPaddingLeft;
|
68 | 68 | }
|
69 | 69 |
|
70 | 70 |
|
71 |
| - set checkPaddingTop(padding){ |
| 71 | + set checkPaddingTop(padding) { |
72 | 72 | this._checkPaddingTop = padding;
|
73 | 73 | }
|
74 | 74 |
|
75 |
| - get checkPaddingTop(){ |
| 75 | + get checkPaddingTop() { |
76 | 76 | return this._checkPaddingTop;
|
77 | 77 | }
|
78 | 78 |
|
79 |
| - set checkPaddingRight(padding){ |
| 79 | + set checkPaddingRight(padding) { |
80 | 80 | this._checkPaddingRight = padding;
|
81 | 81 | }
|
82 | 82 |
|
83 |
| - get checkPaddingRight(){ |
| 83 | + get checkPaddingRight() { |
84 | 84 | return this._checkPaddingRight;
|
85 | 85 | }
|
86 | 86 |
|
87 |
| - set checkPaddingBottom(padding){ |
| 87 | + set checkPaddingBottom(padding) { |
88 | 88 | this._checkPaddingBottom = padding;
|
89 | 89 | }
|
90 | 90 |
|
91 |
| - get checkPaddingBottom(){ |
| 91 | + get checkPaddingBottom() { |
92 | 92 | return this._checkPaddingBottom;
|
93 | 93 | }
|
94 | 94 |
|
@@ -133,44 +133,46 @@ export class CheckBox extends View implements CheckBoxInterface {
|
133 | 133 |
|
134 | 134 | this._android = new android.widget.CheckBox(this._context, null);
|
135 | 135 |
|
136 |
| - if(this.checkPaddingLeft){ |
137 |
| - this._android.setPadding(parseInt(this.checkPaddingLeft),this._android.getPaddingTop(),this._android.getPaddingRight(),this._android.getPaddingBottom()); |
| 136 | + if (this.checkPaddingLeft) { |
| 137 | + this._android.setPadding(parseInt(this.checkPaddingLeft), this._android.getPaddingTop(), this._android.getPaddingRight(), this._android.getPaddingBottom()); |
138 | 138 | }
|
139 | 139 |
|
140 |
| - if(this.checkPaddingTop){ |
141 |
| - this._android.setPadding(this._android.getPaddingLeft(),parseInt(this.checkPaddingTop),this._android.getPaddingRight(),this._android.getPaddingBottom()); |
| 140 | + if (this.checkPaddingTop) { |
| 141 | + this._android.setPadding(this._android.getPaddingLeft(), parseInt(this.checkPaddingTop), this._android.getPaddingRight(), this._android.getPaddingBottom()); |
142 | 142 | }
|
143 | 143 |
|
144 |
| - if(this.checkPaddingRight){ |
145 |
| - this._android.setPadding(this._android.getPaddingLeft(),this._android.getPaddingTop(),parseInt(this.checkPaddingRight),this._android.getPaddingBottom()); |
| 144 | + if (this.checkPaddingRight) { |
| 145 | + this._android.setPadding(this._android.getPaddingLeft(), this._android.getPaddingTop(), parseInt(this.checkPaddingRight), this._android.getPaddingBottom()); |
146 | 146 | }
|
147 | 147 |
|
148 |
| - if(this.checkPaddingBottom){ |
149 |
| - this._android.setPadding(this._android.getPaddingLeft(),this._android.getPaddingTop(),this._android.getPaddingRight(),parseInt(this.checkPaddingBottom)); |
| 148 | + if (this.checkPaddingBottom) { |
| 149 | + this._android.setPadding(this._android.getPaddingLeft(), this._android.getPaddingTop(), this._android.getPaddingRight(), parseInt(this.checkPaddingBottom)); |
150 | 150 | }
|
151 | 151 |
|
152 |
| - if(this.checkPadding){ |
153 |
| - let pads = this.checkPadding.toString().split(','); |
154 |
| - switch(pads.length){ |
155 |
| - case 1: |
156 |
| - this._android.setPadding(parseInt(pads[0]),parseInt(pads[0]),parseInt(pads[0]),parseInt(pads[0])); |
157 |
| - break; |
158 |
| - case 2: |
159 |
| - this._android.setPadding(parseInt(pads[0]),parseInt(pads[1]),parseInt(pads[0]),parseInt(pads[1])); |
160 |
| - break; |
161 |
| - case 3: |
162 |
| - this._android.setPadding(parseInt(pads[0]),parseInt(pads[1]),parseInt(pads[2]),parseInt(pads[1])); |
163 |
| - break; |
164 |
| - case 4: |
165 |
| - this._android.setPadding(parseInt(pads[0]),parseInt(pads[1]),parseInt(pads[2]),parseInt(pads[3])); |
166 |
| - break; |
167 |
| - } |
| 152 | + if (this.checkPadding) { |
| 153 | + let pads = this.checkPadding.toString().split(','); |
| 154 | + switch (pads.length) { |
| 155 | + case 1: |
| 156 | + this._android.setPadding(parseInt(pads[0]), parseInt(pads[0]), parseInt(pads[0]), parseInt(pads[0])); |
| 157 | + break; |
| 158 | + case 2: |
| 159 | + this._android.setPadding(parseInt(pads[0]), parseInt(pads[1]), parseInt(pads[0]), parseInt(pads[1])); |
| 160 | + break; |
| 161 | + case 3: |
| 162 | + this._android.setPadding(parseInt(pads[0]), parseInt(pads[1]), parseInt(pads[2]), parseInt(pads[1])); |
| 163 | + break; |
| 164 | + case 4: |
| 165 | + this._android.setPadding(parseInt(pads[0]), parseInt(pads[1]), parseInt(pads[2]), parseInt(pads[3])); |
| 166 | + break; |
| 167 | + } |
168 | 168 | }
|
169 | 169 | if (this.text) {
|
170 | 170 | this._android.setText(this.text);
|
171 | 171 | }
|
172 |
| - if (!this.style.fontSize) { |
173 |
| - this.style.fontSize = 15; |
| 172 | + |
| 173 | + /// works with class styling - Brad |
| 174 | + if (!this.fontSize) { |
| 175 | + this.fontSize = 15; |
174 | 176 | }
|
175 | 177 |
|
176 | 178 | if (this._checkStyle) {
|
|
0 commit comments