tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

fix(android): touchFeedbackColor not working for a bottomNavigation tab #14003

Closed m1ga closed 6 months ago

m1ga commented 8 months ago

Currently the activeTintColor is used for the ripple color (our touchFeedbackColor) on a BottomNavigation Tab. The touchFeedbackColor is mentioned in the docs already but it doesn't have any effect.

This PR will check if that is set and will use it instead of the activeTintColor

Test

var win1 = Ti.UI.createWindow({
    backgroundColor: 'blue',
    title: 'Blue'
});
win1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));

var win2 = Ti.UI.createWindow({
    backgroundColor: 'red',
    title: 'Red'
});
win2.add(Ti.UI.createLabel({text: 'I am a red window.'}));

var tab1 = Ti.UI.createTab({
    window: win1,
    title: 'Blue',
    touchFeedbackColor: "green"
}),
tab2 = Ti.UI.createTab({
    window: win2,
    activeTintColor: "red",
    touchFeedbackColor: "yellow",
    title: 'Red'
}),
tabGroup = Ti.UI.createTabGroup({
    tabs: [tab1, tab2],
    style: Titanium.UI.Android.TABS_STYLE_BOTTOM_NAVIGATION
});
tabGroup.open();

click the tabs and check the ripple color