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 <[email protected]>
  • Loading branch information
2 people authored and hansemannn committed May 27, 2024
1 parent 5fc9115 commit 4639ced
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 4639ced

Please sign in to comment.