{ "id": "112865", "key": "TIMOB-13558", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-04-15T17:20:20.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "exalture", "supportTeam" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "35506", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "126296", "key": "TIMOB-16449", "fields": { "summary": "Android: When touchEnabled and enabled properties are set to false the event listener added to the view stops working", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-02-28T20:03:20.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h6.Problem\r\nif you have a Button with a touchstart event it can look disabled if you call setEnabled(true) after the button is clicked. If they use a touchend, or click event then this issue is not present or if I use the 2.1.3.GA sdk then this issue does not occur with the touchstart event.\r\n\r\nh6.To reproduce\r\n1. Install this app to a android device. \r\n2. Launch ADB so you can see when the buttons are pressed. \r\n3. Click Button 1, watch the logs to verify the button was clicked. \r\n4. Click Enable Button 1\r\n5. Notice that Button 1 is now in a depressed state. \r\n6. Click on Button 1, notice it clicked and is now in a enabled state\r\n7. Click Enable BUtton\r\n8. Notice its back to the depressed state.\r\n\r\nh6. == app.js ==\r\n{code}\r\nvar view = require('FirstView')();\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"white\"\r\n});\r\nwin.add(view);\r\nwin.open();\r\n{code}\r\n\r\nh6. == FirstView.js ==\r\n{code}\r\n//FirstView Component Constructor\r\nfunction FirstView() {\r\n\r\n\tvar self = Ti.UI.createView();\r\n\r\n\tvar defaults = {\r\n\t\tenabled: true,//me\r\n\t\ttitle : \"Button 1\",\r\n\t\ttop : 20,\r\n\t\twidth : 400,\r\n\t\theight : 200,\r\n\t\tbackgroundTopCap : 50,\r\n\t\tbackgroundLeftCap : 50,\r\n\t\tcolor : \"#2C4471\",\r\n\t\tselectedColor : \"#2C4471\",\r\n\t\tfont : {\r\n\t\t\t\"fontSize\" : \"16dp\",\r\n\t\t\t\"fontFamily\" : \"HelveticaNeue-Bold\",\r\n\t\t\t\"fontWeight\" : \"bold\"\r\n\t\t},\r\n\t\tbackgroundImage : '/global-btn-up.png',\r\n\t\tbackgroundSelectedImage : '/global-btn-down.png',\r\n\t\tshadow : {\r\n\t\t\tshadowRadius : 4,\r\n\t\t\tshadowOpacity : 0.2,\r\n\t\t\tshadowOffset : {\r\n\t\t\t\tx : 0,\r\n\t\t\t\ty : 0\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar button = Titanium.UI.createButton(defaults);\r\n\r\n\tself.add(button);\r\n\r\n\tbutton.addEventListener('touchstart', function() {\r\n\t\tbutton.setEnabled(false);\r\n\t\tTi.API.info(\"[INFO] [Button 1 clicked!!]\");\r\n\t});\r\n\r\n\tvar button2 = Titanium.UI.createButton(defaults);\r\n\tbutton2.top = 260;\r\n\tbutton2.title = \"Enable Button 1\";\r\n\tself.add(button2);\r\n\r\n\tbutton2.addEventListener('touchstart', function() {\r\n\t\tbutton.setEnabled(true);\r\n\t\tTi.API.info(\"[INFO] [Button 2 clicked!!]\");\r\n\t});\r\n\r\n\treturn self;\r\n\r\n}\r\n\r\nmodule.exports = FirstView; \r\n{code}", "attachment": [ { "id": "37487", "filename": "global-btn-down.9.png", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-15T17:20:20.000+0000", "size": 1788, "mimeType": "image/png" }, { "id": "37486", "filename": "global-btn-up.9.png", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-15T17:20:20.000+0000", "size": 1674, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Button with a touchstart event can look disabled if you call setEnabled(true)", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.3.4 & 2.3.5\r\nTiSDK 2.1.3 & 3.x", "comment": { "comments": [ { "id": "256420", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I have logged my findings", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-06-06T15:15:52.000+0000", "updated": "2013-06-06T15:15:52.000+0000" }, { "id": "297576", "author": { "name": "dfortner", "key": "dfortner", "displayName": "Daniel Fortner", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "dfortner", "key": "dfortner", "displayName": "Daniel Fortner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-17T16:52:42.000+0000", "updated": "2014-03-17T16:52:42.000+0000" }, { "id": "298330", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "This looks like an Android issue where the state is messed up if the button is disabled during touch event. One workaround could be to use 'touchend' instead of 'touchstart'\r\n", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-03-23T05:13:49.000+0000", "updated": "2014-03-23T05:13:49.000+0000" }, { "id": "298433", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It appears that it worked with a previous Titanium SDK version. Can you reproduce this issue with a native application? If yes, can we have a workaround for Titanium SDK?", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-24T16:55:26.000+0000", "updated": "2014-03-24T16:55:26.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }