Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16655] Android: Add disabledColor property

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.2.2
Fix Version/sn/a
ComponentsAndroid
Labelsandoid, theme, tss
ReporterGianpaolo
AssigneeUnknown
Created2014-03-14T10:27:47.000+0000
Updated2019-04-24T13:55:56.000+0000

Description

Android don't have this basilar function. Workaround with "addEventListener('click'...". Is useful function. Test with: TiSDK 3.2.1.GA

Comments

  1. Ritu Agrawal 2014-03-17

    Please clarify which UI control you need this property on. I am assuming it is Ti.UI.Button but want to confirm.
  2. Gianpaolo 2014-03-17

    oh I'm sorry, but yes, it is Ti.UI.Button, but I think we can use in every object that has properties backgroundDisabledColor. And thanks for your reply
  3. Ritu Agrawal 2014-03-18

    This functionality already exists on Android platform with another property - backgroundDisabledColor. Please refer to TIMOB-15374 for detailed discussion on this topic.
  4. Gianpaolo 2014-03-18

    Wait, I'm not referring to the property backgroundDisabledColor, this change the background color of the object. i talk about the Color property, the Color property change the text content color of object. when i write this: var enabled = z; var x = Ti.UI.createButton({ backgroundColor:"red", color:"brown", backgroundDisabledColor:"#000", disabledColor:"#777", enabled:enabled }) I expect that when the button is disabled it has a black background and gray text. When it is active has a red background and brown text. sorry for my bad English.
  5. Ritu Agrawal 2014-03-21

    Moving this feature request to engineering for further evaluation. Adding this property would bring the behavior at par with iOS platform. Another property that is not available for Android platform is selectedColor.
       var win = Ti.UI.createWindow({
           fullscreen:true,
           backgroundColor:'white',
       });
       
       var container = Ti.UI.createView({
           height:Ti.UI.SIZE,
           layout:'vertical'
       });
       
       win.add(container);
       
       var isenabled = true;
       var b1 = Ti.UI.createButton({
           title:'I am enabled',
           backgroundImage:'red.png',
           backgroundSelectedImage:'green.png',
           backgroundDisabledImage:'green.png',
           color:'black',
           selectedColor:'white',
           disabledColor:'yellow',
           backgroundDisabledColor:'yellow',
           top:10,
           enabled:isenabled,
           width:200
       });
       
       var b2 = Ti.UI.createButton({
           title:'TOGGLE ENABLED',
           top:10
       });
       
       container.add(b1);
       container.add(b2);
       
       b2.addEventListener('click',function(e){
           if (isenabled == true) {
               b1.enabled = false;
               b1.title = 'I AM DISABLED';
           } else {
               b1.enabled = true;
               b1.title = 'I AM ENABLED';
           };
           isenabled = !isenabled;
       });
       
       win.open();
       
  6. Brian GarcĂ­a 2019-04-24

    I think this one is a must have for parity.

JSON Source