@@ -281,20 +281,18 @@ function initializeNativeClasses() {
281
281
TabLayout = TabLayoutImplementation ;
282
282
}
283
283
284
- function createTabItemSpec ( item : TabStripItem ) : org . nativescript . widgets . TabItemSpec {
284
+ function createTabItemSpec ( tabStripItem : TabStripItem ) : org . nativescript . widgets . TabItemSpec {
285
285
let iconSource ;
286
286
const tabItemSpec = new org . nativescript . widgets . TabItemSpec ( ) ;
287
287
288
- if ( item . backgroundColor ) {
289
- if ( item . backgroundColor instanceof Color ) {
290
- tabItemSpec . backgroundColor = item . backgroundColor . android ;
291
- }
288
+ if ( tabStripItem . backgroundColor instanceof Color ) {
289
+ tabItemSpec . backgroundColor = tabStripItem . backgroundColor . android ;
292
290
}
293
-
291
+
294
292
// Image and Label children of TabStripItem
295
293
// take priority over its `iconSource` and `title` properties
296
- iconSource = item . image ? item . image . src : item . iconSource ;
297
- tabItemSpec . title = item . label ? item . label . text : item . title ;
294
+ iconSource = tabStripItem . image ? tabStripItem . image . src : tabStripItem . iconSource ;
295
+ tabItemSpec . title = tabStripItem . label ? tabStripItem . label . text : tabStripItem . title ;
298
296
299
297
if ( iconSource ) {
300
298
if ( iconSource . indexOf ( RESOURCE_PREFIX ) === 0 ) {
@@ -305,15 +303,15 @@ function createTabItemSpec(item: TabStripItem): org.nativescript.widgets.TabItem
305
303
}
306
304
} else {
307
305
let is = new ImageSource ( ) ;
308
- if ( isFontIconURI ( item . iconSource ) ) {
309
- const fontIconCode = item . iconSource . split ( "//" ) [ 1 ] ;
310
- const font = item . style . fontInternal ;
311
- const color = item . style . color ;
306
+ if ( isFontIconURI ( tabStripItem . iconSource ) ) {
307
+ const fontIconCode = tabStripItem . iconSource . split ( "//" ) [ 1 ] ;
308
+ const font = tabStripItem . style . fontInternal ;
309
+ const color = tabStripItem . style . color ;
312
310
is = fromFontIconCode ( fontIconCode , font , color ) ;
313
311
} else {
314
- is = fromFileOrResource ( item . iconSource ) ;
312
+ is = fromFileOrResource ( tabStripItem . iconSource ) ;
315
313
}
316
-
314
+
317
315
if ( is ) {
318
316
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
319
317
tabItemSpec . iconDrawable = new android . graphics . drawable . BitmapDrawable ( application . android . context . getResources ( ) , is . android ) ;
0 commit comments