{ "id": "172955", "key": "TIMOB-26794", "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": "2019-02-03T11:14:20.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2019-02-04T19:18:17.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "This is a weird one. When creating a view programmatically, e.g. via a CommonJS file, it later cannot be shown / hidden anymore. We need to elaborate more on it, but it's similar to the following (using Alloy):\r\n**xp.ui.js**\r\n{code:js}\r\nexports.createMyView = (args = {}) => {\r\n\r\n};\r\n{code}\r\n**index.xml**\r\n{code:xml}\r\n\r\n \r\n \r\n \r\n\r\n{code}\r\n**index.js**\r\n{code:js}\r\nfunction hideView() {\r\n $.theView.hide();\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Cannot show / hide a view created via Common JS", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "445827", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hmm... I can't reproduce the issue. I've tried the below code which dynamically calls a label's {{show()}} and {{hide()}} methods, as well as setting its \"visible\" property {{true}}/{{false}}.\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow({\r\n\tlayout: \"vertical\",\r\n});\r\nvar label = Ti.UI.createLabel({\r\n\ttext: \"Hello World!\",\r\n\ttop: \"40dp\",\r\n//\tvisible: false,\r\n});\r\n//label.hide();\r\nwindow.add(label);\r\nvar showButton = Ti.UI.createButton({\r\n\ttitle: \"show()\",\r\n\ttop: \"40dp\",\r\n});\r\nshowButton.addEventListener(\"click\", function() {\r\n\tlabel.show();\r\n});\r\nwindow.add(showButton);\r\nvar hideButton = Ti.UI.createButton({\r\n\ttitle: \"hide()\",\r\n\ttop: \"20dp\",\r\n});\r\nhideButton.addEventListener(\"click\", function() {\r\n\tlabel.hide();\r\n});\r\nwindow.add(hideButton);\r\nvar visibleTrueButton = Ti.UI.createButton({\r\n\ttitle: \"visible = true\",\r\n\ttop: \"40dp\",\r\n});\r\nvisibleTrueButton.addEventListener(\"click\", function() {\r\n\tlabel.visible = true;\r\n});\r\nwindow.add(visibleTrueButton);\r\nvar visibleFalseButton = Ti.UI.createButton({\r\n\ttitle: \"visible = false\",\r\n\ttop: \"20dp\",\r\n});\r\nvisibleFalseButton.addEventListener(\"click\", function() {\r\n\tlabel.visible = false;\r\n});\r\nwindow.add(visibleFalseButton);\r\nwindow.open();\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-04T19:05:29.000+0000", "updated": "2019-02-04T19:07:07.000+0000" }, { "id": "445828", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The below code should be a similar equivalent of your Alloy example. But I cannot reproduce the issue with this either.\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar view = Ti.UI.createView({\r\n\tbackgroundColor: \"red\",\r\n\twidth: \"100dp\",\r\n\theight: \"100dp\",\r\n});\r\nwindow.add(view);\r\nwindow.addEventListener(\"open\", function() {\r\n\tview.hide();\r\n\tsetTimeout(function() { view.show(); }, 2000);\r\n});\r\nwindow.open();\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-04T19:16:06.000+0000", "updated": "2019-02-04T19:16:06.000+0000" }, { "id": "445829", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The main difference is that my example is about a require()'d view.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-02-04T19:18:17.000+0000", "updated": "2019-02-04T19:18:17.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }