Skip to content

Commit cb8cea8

Browse files
author
vakrilov
committed
fix(android): tap-trip-item title disappearing
1 parent 9d5bddb commit cb8cea8

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

nativescript-core/ui/bottom-navigation/bottom-navigation.android.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export class BottomNavigation extends TabNavigationBase {
391391
if (this._manager && this._manager.isDestroyed()) {
392392
return;
393393
}
394-
394+
395395
this._attachedToWindow = true;
396396
this.changeTab(this.selectedIndex);
397397
}
@@ -705,7 +705,10 @@ export class BottomNavigation extends TabNavigationBase {
705705
}
706706

707707
public setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void {
708-
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
708+
if (value.fontSize) {
709+
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
710+
}
711+
709712
tabStripItem.nativeViewProtected.setTypeface(value.getAndroidTypeface());
710713
}
711714

nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,23 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
127127
const parent = <TabStrip>this.parent;
128128
const tabStripParent = parent && <TabNavigationBase>parent.parent;
129129

130-
return tabStripParent && (<any>tabStripParent).setTabBarIconColor(this, args.value);
130+
return tabStripParent && tabStripParent.setTabBarIconColor(this, args.value);
131131
});
132132
this.image.style.on("colorChange", this._imageColorHandler);
133133

134134
this._imageFontHandler = this._imageFontHandler || ((args: PropertyChangeData) => {
135135
const parent = <TabStrip>this.parent;
136136
const tabStripParent = parent && <TabNavigationBase>parent.parent;
137137

138-
return tabStripParent && (<any>tabStripParent).setTabBarIconColor(this, args.value);
138+
return tabStripParent && tabStripParent.setTabBarIconColor(this, args.value);
139139
});
140140
this.image.style.on("fontInternalChange", this._imageFontHandler);
141141

142142
this._imageSrcHandler = this._imageSrcHandler || ((args: PropertyChangeData) => {
143143
const parent = <TabStrip>this.parent;
144144
const tabStripParent = parent && <TabNavigationBase>parent.parent;
145145

146-
return tabStripParent && (<any>tabStripParent).setTabBarIconColor(this, args.value);
146+
return tabStripParent && tabStripParent.setTabBarIconColor(this, args.value);
147147
});
148148
this.image.on("srcChange", this._imageSrcHandler);
149149
}

nativescript-core/ui/tabs/tabs.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ export class Tabs extends TabsBase {
819819
}
820820

821821
public setTabBarItemFontInternal(tabStripItem: TabStripItem, value: Font): void {
822-
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
822+
if (value.fontSize) {
823+
tabStripItem.nativeViewProtected.setTextSize(value.fontSize);
824+
}
823825
tabStripItem.nativeViewProtected.setTypeface(value.getAndroidTypeface());
824826
}
825827

0 commit comments

Comments
 (0)