@@ -8,15 +8,18 @@ import {
8
8
helperColorProperty ,
9
9
helperProperty ,
10
10
strokeColorProperty ,
11
+ strokeDisabledColorProperty ,
11
12
strokeInactiveColorProperty
12
13
} from '@nativescript-community/ui-material-core/textbase/cssproperties' ;
13
14
import {
14
15
Background ,
15
16
Color ,
17
+ Font ,
16
18
Length ,
17
19
Utils ,
18
20
backgroundInternalProperty ,
19
21
borderBottomLeftRadiusProperty ,
22
+ fontInternalProperty ,
20
23
hintProperty ,
21
24
paddingBottomProperty ,
22
25
paddingLeftProperty ,
@@ -210,6 +213,15 @@ export class TextView extends TextViewBase {
210
213
}
211
214
}
212
215
216
+ [ strokeDisabledColorProperty . setNative ] ( value : Color ) {
217
+ const color = value instanceof Color ? value . android : value ;
218
+ if ( this . layoutView . setBoxStrokeColorStateList ) {
219
+ const activeColor = this . strokeColor instanceof Color ? this . strokeColor . android : this . layoutView . getBoxStrokeColor ( ) ;
220
+ const colorStateList = getFullColorStateList ( activeColor , color ) ;
221
+ this . layoutView . setBoxStrokeColorStateList ( colorStateList ) ;
222
+ }
223
+ }
224
+
213
225
[ strokeColorProperty . setNative ] ( value : Color ) {
214
226
const color = value instanceof Color ? value . android : value ;
215
227
if ( this . layoutView . setBoxStrokeColorStateList ) {
@@ -235,6 +247,9 @@ export class TextView extends TextViewBase {
235
247
this . layoutView . setBoxBackgroundColor ( value . color . android ) ;
236
248
}
237
249
}
250
+ if ( value . borderTopColor ) {
251
+ this . nativeViewProtected . setBoxStrokeColor ( value . borderTopColor . android ) ;
252
+ }
238
253
break ;
239
254
case 'outline' :
240
255
case 'underline' : {
@@ -249,13 +264,19 @@ export class TextView extends TextViewBase {
249
264
}
250
265
}
251
266
if ( value . borderTopColor ) {
252
- // TODO: for now no control over border color. it is an attr
253
- // this.nativeViewProtected.setStrokeColor(value.borderTopColor.android);
267
+ this . nativeViewProtected . setBoxStrokeColor ( value . borderTopColor . android ) ;
254
268
}
255
269
break ;
256
270
}
257
271
}
258
272
}
273
+
274
+ [ fontInternalProperty . setNative ] ( value : Font | UIFont ) {
275
+ if ( ! this . formattedText || ! ( value instanceof Font ) ) {
276
+ this . nativeViewProtected . setTypeface ( value instanceof Font ? value . getAndroidTypeface ( ) : value ) ;
277
+ this . nativeTextViewProtected . setTypeface ( value instanceof Font ? value . getAndroidTypeface ( ) : value ) ;
278
+ }
279
+ }
259
280
[ paddingTopProperty . setNative ] ( value : Length ) {
260
281
org . nativescript . widgets . ViewHelper . setPaddingTop ( this . nativeViewProtected , Length . toDevicePixels ( value , 0 ) + Length . toDevicePixels ( this . style . borderTopWidth , 0 ) ) ;
261
282
}
0 commit comments