{ "id": "172199", "key": "TIMOB-26374", "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": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-09-14T22:25:43.000+0000", "created": "2018-09-10T11:37:59.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "button" ], "versions": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-09-23T12:58:17.000+0000", "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" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "It is not possible to disable a button via it's \"enabled\" property upon creation on Android:\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: \"test\",\r\n enabled: false\r\n})\r\n\r\nbtn.addEventListener(\"click\",function() {\r\n alert(\"enabled\")\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\nThe button is still clickable and has the default style (touch effect). Using the setEnabled method didn't work either.\r\n\r\nHTC A9, Android 7\r\nTi SDK 7.3.1.GA \r\n", "attachment": [], "flagged": false, "summary": "Android: Ti.UI.Button can't be disabled until displayed as of 6.1.0", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "441450", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've confirmed that the \"enabled\" property is ignored upon creation.\r\nThis has been an as issue since Titanium 6.1.0.\r\n\r\n*Work-Around:*\r\nYou can enable/disable the button once its hosting window has been opened. For example...\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar button = Ti.UI.createButton({\r\n\ttitle: \"Test\",\r\n// This does not work on Android.\r\n//\tenabled: false,\r\n});\r\nwindow.add(button);\r\nwindow.addEventListener(\"open\", function() {\r\n\t// This works on both Android and iOS.\r\n\tbutton.enabled = false;\r\n});\r\nwindow.open();\r\n{code}", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-10T18:20:17.000+0000", "updated": "2018-09-10T18:20:47.000+0000" }, { "id": "441506", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/10320", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-09-12T13:51:22.000+0000", "updated": "2018-09-12T13:51:22.000+0000" }, { "id": "441507", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~ybanev] sorry had no time to compile your PR, but does this change put the button into disabled mode?\r\nlike this: https://materialdoc.com/images/raised-button-intro-v2.png", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-12T15:11:58.000+0000", "updated": "2018-09-12T15:11:58.000+0000" }, { "id": "441509", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~michael] Yes.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-09-12T15:17:43.000+0000", "updated": "2018-09-12T15:17:43.000+0000" }, { "id": "441612", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix in SDK Version: {{7.5.0.v20180914153007.}} Button is now able to be disabled. \r\n\r\n*FR passed (Test steps):*\r\n# Created a new Titanium application \r\n# Added the code in the description above in to the app\r\n# Ran the application\r\n# Button was now disabled when the application was ran \r\n# Changed the test case to match the test case in https://github.com/appcelerator/titanium_mobile/pull/10320\r\n# Button properties seem to work as intended \r\n\r\n*Test Environment*\r\n{code:java}\r\nAPPC Studio: 5.1.0.201808080937\r\nAPPC CLI: 7.0.7-master.1\r\nNexus 6P (API 23)\r\nOperating System Name: Mac OS High Sierra\r\nOperating System Version: 10.13.6\r\nNode.js Version: 8.9.1\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-17T10:03:16.000+0000", "updated": "2018-09-17T10:03:16.000+0000" }, { "id": "441924", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi [~ybanev],\r\nI was playing with 7.5.0 today and used and older project with a drag feature:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"white\"\r\n});\r\nvar view = Ti.UI.createView({\r\n\twidth: 150,\r\n\theight: 300,\r\n\tbackgroundColor: \"red\",\r\n\tborderRadius: 10,\r\n\ttouchEnabled: false\r\n})\r\n\r\n// setInterval(function(){\r\n// \tview.rotation +=1;\r\n// },100)\r\n//\r\nwin.add(view);\r\nvar sx = 0;\r\nvar sy = 0;\r\nvar cx = 0;\r\nvar cy = 0;\r\nvar dpi = Ti.Platform.displayCaps.logicalDensityFactor;\r\nvar WIDTH = Ti.Platform.displayCaps.platformWidth / dpi;\r\nvar HEIGHT = Ti.Platform.displayCaps.platformHeight / dpi;\r\n\r\nfunction onTouchStart(e) {\r\n\t// start movement\r\n\r\n\tconsole.log(\"start\", e);\r\n\r\n\tsx = e.x;\r\n\tsy = e.y;\r\n\r\n\tcx = e.x;\r\n\tcy = e.y;\r\n}\r\n\r\nfunction onTouchMove(e) {\r\n\tvar xDistance = cx - sx;\r\n\tvar yDistance = cy - sy;\r\n\r\n\tvar rotationStrength = Math.min(xDistance / (WIDTH), 1);\r\n\r\n\tvar rotationAngel = (2 * Math.PI * rotationStrength / 16);\r\n\r\n\tvar rotationStrengthX = Math.min(yDistance / (HEIGHT), 1);\r\n\tvar rotationAngelX = (2 * Math.PI * rotationStrengthX / 16);\r\n\r\n\tvar scaleStrength = 1 - Math.abs(rotationStrength) / 4;\r\n\tvar scale = Math.max(scaleStrength, 0.93)\r\n\r\n\tview.rotation = rotationAngel * 20;\r\n\r\n\tview.rotationX = rotationAngelX * 20;\r\n\tview.translationX = xDistance;\r\n\tview.setTranslationY(yDistance);\r\n\tview.scaleX = scale;\r\n\tview.scaleY = scale;\r\n\r\n\tcx = e.x;\r\n\tcy = e.y;\r\n}\r\nwin.addEventListener(\"touchmove\", onTouchMove);\r\nwin.addEventListener(\"touchstart\", onTouchStart);\r\nwin.open();\r\n{code}\r\n\r\nWith 7.4.0.GA it is working fine, with 7.5.0 the disabled view (touchEnabled:false) is still appearing in the touchstart event of the window. The console.log shows two elements (window and view). While I can work around that issue and use the coordinates from the correct source it would bring some changes to existing apps.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-09-23T12:58:17.000+0000", "updated": "2018-09-23T12:58:17.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }