Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23167] Android: Add Ti.UI.Button tintColor

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-04-25T05:14:16.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsTiAPI
Labelsandroid, button, parity, qe-5.4.0
ReporterMichael Gangolf
AssigneeAshraf Abu
Created2016-04-07T17:56:20.000+0000
Updated2016-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"/>

Comments

  1. Michael Gangolf 2016-04-07

    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
  2. Sharif AbuDarda 2016-04-07

    Thanks for creating the PR. This is a valid feature request. Our engineers will look into it. Moving the ticket. Regards, Sharif.
  3. Michael Gangolf 2016-04-08

    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!
  4. Ashraf Abu 2016-04-08

    [~michael] Putting the doc in Button.yml with it mentioning that it's an Android property should be fine. (y)
  5. Michael Gangolf 2016-04-08

    not sure what to write :) https://github.com/m1ga/titanium_mobile/blob/tint_button/apidoc/Titanium/UI/Button.yml#L294
  6. Hans Knöchel 2016-04-10

    Very excited about this PR. Thank you [~michael], great work!
  7. Ashraf Abu 2016-04-25

    PR reviewed and merged. https://github.com/appcelerator/titanium_mobile/pull/7924
  8. Harry Bryant 2016-07-19

    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.*
  9. Shawn Lan 2016-09-22

    What's the difference between button's tintColor and color? On iOS they seem the same.

JSON Source