Skip to content

Commit

Permalink
fix(android): touchFeedbackColor not working for a bottomNavigation t…
Browse files Browse the repository at this point in the history
…ab (#14003)

Co-authored-by: Chris Barber <chris@cb1inc.com>
  • Loading branch information
m1ga and cb1kenobi authored May 13, 2024
1 parent 90c4d1f commit 20735d4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,17 @@ public void updateTabBackgroundDrawable(int index)
try {
// BottomNavigationMenuView rebuilds itself after adding a new item, so we need to reset the colors each time.
TiViewProxy tabProxy = tabs.get(index).getProxy();
if (hasCustomBackground(tabProxy) || hasCustomIconTint(tabProxy)) {
boolean hasTouchFeedbackColor = tabProxy.hasPropertyAndNotNull(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR);
if (hasCustomBackground(tabProxy) || hasCustomIconTint(tabProxy) || hasTouchFeedbackColor) {
BottomNavigationMenuView bottomMenuView =
((BottomNavigationMenuView) this.mBottomNavigationView.getChildAt(0));
Drawable drawable = createBackgroundDrawableForState(tabProxy, android.R.attr.state_checked);
drawable = new RippleDrawable(createRippleColorStateListFrom(getActiveColor(tabProxy)), drawable, null);
int color = getActiveColor(tabProxy);
if (hasTouchFeedbackColor) {
color = TiConvert.toColor(tabProxy.getProperty(TiC.PROPERTY_TOUCH_FEEDBACK_COLOR),
tabProxy.getActivity());
}
drawable = new RippleDrawable(createRippleColorStateListFrom(color), drawable, null);
bottomMenuView.getChildAt(index).setBackground(drawable);
}
} catch (Exception e) {
Expand Down

0 comments on commit 20735d4

Please sign in to comment.