Skip to content

Commit 4639ced

Browse files
m1gacb1kenobi
authored andcommitted
fix(android): touchFeedbackColor not working for a bottomNavigation tab (#14003)
Co-authored-by: Chris Barber <chris@cb1inc.com>
1 parent 5fc9115 commit 4639ced

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,17 @@ public void updateTabBackgroundDrawable(int index)
344344
try {
345345
// BottomNavigationMenuView rebuilds itself after adding a new item, so we need to reset the colors each time.
346346
TiViewProxytabProxy = tabs.get(index).getProxy();
347-
if (hasCustomBackground(tabProxy) || hasCustomIconTint(tabProxy)) {
347+
booleanhasTouchFeedbackColor = tabProxy.hasPropertyAndNotNull(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR);
348+
if (hasCustomBackground(tabProxy) || hasCustomIconTint(tabProxy) || hasTouchFeedbackColor) {
348349
BottomNavigationMenuViewbottomMenuView =
349350
((BottomNavigationMenuView) this.mBottomNavigationView.getChildAt(0));
350351
Drawabledrawable = createBackgroundDrawableForState(tabProxy, android.R.attr.state_checked);
351-
drawable = newRippleDrawable(createRippleColorStateListFrom(getActiveColor(tabProxy)), drawable, null);
352+
intcolor = getActiveColor(tabProxy);
353+
if (hasTouchFeedbackColor) {
354+
color = TiConvert.toColor(tabProxy.getProperty(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR),
355+
tabProxy.getActivity());
356+
}
357+
drawable = newRippleDrawable(createRippleColorStateListFrom(color), drawable, null);
352358
bottomMenuView.getChildAt(index).setBackground(drawable);
353359
}
354360
} catch (Exceptione) {

0 commit comments

Comments
 (0)
close