[TIMOB-23167] Android: Add Ti.UI.Button tintColor
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-25T05:14:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.4.0 |
Components | TiAPI |
Labels | android, button, parity, qe-5.4.0 |
Reporter | Michael Gangolf |
Assignee | Ashraf Abu |
Created | 2016-04-07T17:56:20.000+0000 |
Updated | 2016-09-22T18:30:01.000+0000 |
Description
Add
Ti.UI.Button.tintColor
on Android (https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Button-property-tintColor) to have the same feature on both platforms (iOS is available)
$.button.setTintColor("#ff0000");
$.button.tintColor = "#ff0000";
Button {tintColor:"ff0000";}
<Button tintColor="ff0000"/>
PR: https://github.com/appcelerator/titanium_mobile/pull/7924 -You can't reset the original color with "undefined" or "null". You need to set it to e.g. '#5A595B'. - *About the documentation:* Should I add it to Button.yml? The iOS property is listed in View.yml
Thanks for creating the PR. This is a valid feature request. Our engineers will look into it. Moving the ticket. Regards, Sharif.
small update: $.button.tintColor = null; will remove the tint. So you can easily use it in a touchstart/touchend scenario to tint and untint a button!
[~michael] Putting the doc in Button.yml with it mentioning that it's an Android property should be fine. (y)
not sure what to write :) https://github.com/m1ga/titanium_mobile/blob/tint_button/apidoc/Titanium/UI/Button.yml#L294
Very excited about this PR. Thank you [~michael], great work!
PR reviewed and merged. https://github.com/appcelerator/titanium_mobile/pull/7924
Verified as fixed,
tintColor
property for Ti.UI.Button is now supported for the Android platform. After setting the tintColor to a custom value, it can be reset by changing the value to "null". Tested On: Nexus 6P Device (6.0.1) Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160713141635 Appc Studio: 4.7.0.201607111053 Appc NPM: 4.2.7 App CLI: 5.4.0-33 Xcode 7.3 Node v4.4.7 *Closing ticket.*What's the difference between button's tintColor and color? On iOS they seem the same.