Skip to content

Commit f4c53c5

Browse files
committed
fix(tabs/bottom-navigation): image color filter not reset on unselect
1 parent ff12691 commit f4c53c5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/core/tab-navigation-base/tab-navigation/index.android.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -990,13 +990,12 @@ export abstract class TabNavigation<T extends android.view.ViewGroup = any> exte
990990
return;
991991
}
992992
const itemColor = tabStripItem._index === this.selectedIndex ? this.mSelectedItemColor : this.mUnSelectedItemColor;
993-
if (!itemColor) {
994-
return;
995-
}
993+
console.log('_setItemColor', tabStripItem, itemColor);
996994

997995
// set label color
998-
tabStripItem.nativeViewProtected.setTextColor(itemColor.android);
999-
996+
if (itemColor) {
997+
tabStripItem.nativeViewProtected.setTextColor(itemColor.android || null);
998+
}
1000999
// set icon color
10011000
this.setIconColor(tabStripItem, itemColor);
10021001
}
@@ -1010,9 +1009,7 @@ export abstract class TabNavigation<T extends android.view.ViewGroup = any> exte
10101009
const drawableInfo = this.getIconInfo(tabStripItem, color);
10111010
const imgView = tabBarItem.getChildAt(0) as android.widget.ImageView;
10121011
imgView.setImageDrawable(drawableInfo.drawable);
1013-
if (color) {
1014-
imgView.setColorFilter(color.android);
1015-
}
1012+
imgView.setColorFilter(color?.android || null);
10161013
}
10171014

10181015
public setTabBarItemColor(tabStripItem: TabStripItem, value: number | Color): void {

0 commit comments

Comments
 (0)