[TIMOB-24592] Add backgroundTint in Android Titanium to change the background colors of Ti.UI.Button keeping ripple effect+shadow same.
GitHub Issue | n/a |
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Prashant Saini |
Assignee | Unknown |
Created | 2017-04-18T04:35:51.000+0000 |
Updated | 2018-02-28T19:54:54.000+0000 |
Description
As you know that by default Titanium Android buttons have their backgroundColor from xml themes keeping the Ripple effect + Shadow intact.
But as soon as we set backgroundColor property of Ti.UI.Button in Android-Titanium, the Ripple effect is gone.
I really found out the same behaviour in native Android itself & here's the solution.
In native Android - we can use backgroundTint property to set any other backgroundColor than specified in theme file. It will keep the ripple effect + shadow same & will provide easiest option to change the backgroundColor of Ti.UI.Button.
Hence, we should also have a similar property in Titanium.
In attached screenshots, you can see the code & its UI result. Though I cannot capture ripple effect but it's there when you tap button.
Attachments
Thanks for submitting the ticket. Please provide Native docs link here. Our engineers will consider it. Thanks.
Here's the link: https://developer.android.com/reference/android/view/View.html#attr_android:backgroundTint Native Android Button inherits XML attributes from View as described in above link.