{ "id": "62804", "key": "TIMOB-2172", "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": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:18.000+0000", "created": "2011-04-15T03:12:37.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "defect", "ios", "iphone", "rplist", "window" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:18.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
On the iphone, using the hide/show methods will hide a window\nbut will not show it again. However, manually setting the visible\nproperty does work.
\nBelow code shows this:
\nvar app = {
\nsetupActivity: function(message) {\n this.activityTrans = Ti.UI.createWindow(\n {backgroundColor: \"#fff\", opacity: 0.65, zIndex: 1});\n this.activityWin = Ti.UI.createWindow(\n {opacity: 0.9,\n backgroundImage: 'images/gradround.png',\n top: \"40%\", height: 80, left: \"20%\", right: \"20%\", zIndex: 2,\n color:\"#fff\"\n });\n this.activity = Ti.UI.createActivityIndicator(\n {top: 30, height: 25, color:\"#fff\",\n style:Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN});\n this.activity.show();\n this.activityWin.add(this.activity);\n this.activityLabel = Ti.UI.createLabel(\n {left: 5, right: 5, top: 35, height: 35,\n text: \"\", color: \"#fff\", textAlign: \"center\",\n font:{fontSize:16}\n });\n this.activityWin.add(this.activityLabel);\n\n this.activityTrans.open();\n this.activityWin.open();\n this.activity.message = message;\n Titanium.App.idleTimerDisabled = true;\n},\n\nactivityOn: function (message) {\n if (!message) {\n message = \"Loading...\";\n }\n if (!this.activityWin) {\n this.setupActivity(message);\n } else {\n this.activityWin.height = 80;\n this.activityWin.left = \"20%\";\n this.activityWin.right = \"20%\";\n this.activityLabel.text = \"\";\n this.activity.message = message;\n this.activity.top = 30;\n this.activity.show();\n this.activityWin.show();\n this.activityTrans.show();\n Titanium.App.idleTimerDisabled = true;\n }\n this.activityLabelShown = false;\n this.activityProgressShown = false;\n},\n\nactivityOff: function (keepTrans) {\n if (this.activity) {\n Titanium.App.idleTimerDisabled = false;\n this.activity.hide(); // android\n this.activityWin.hide();\n if (!keepTrans) {\n this.activityTrans.hide();\n }\n if (this.progressBar) {\n this.progressBar.hide();\n }\n }\n}
\n
\n};
\napp.activityOn(\"message 1\");
\nsetTimeout(function () {
\n app.activityOff();\n setTimeout(function () {\n app.activityOn(\"message 2\");\n }, 2000);\n }, 2000);
\n
Mislabeled the bug as #2272 instead of #2172 in\nthe commit. Commit is 7604111. Marking fixed-in-qa.
Hmm, this has resolved the problem with the code above, but my\nwebviews as reported in http://developer.appcelerator.com/helpdesk/view/50571\nare not rendering correctly. I'll try build you a test case tonight\nor tomorrow.
The following code works in 1.4.x but not the current git.
\n~~~ var debug = Ti.API.debug;
\nvar app = {
\n\nsetup: function () {\n this.win = Ti.UI.createWindow({});\n this.web = Ti.UI.createWebView({html:\"<html><body>hello</body></html>\"});\n this.web2 = Ti.UI.createWebView({html:\"<html><body>world</body></html>\"});\n this.win.add(this.web);\n this.win.add(this.web2);\n this.win.open();\n},\n\ntoggle: function () {\n if (this.web2.visible) {\n debug(\"visible\");\n this.web2.hide();\n } else {\n debug(\"invisible\");\n this.web2.show();\n }\n}
\n
\n};
\napp.setup();
\nsetInterval(function () {
\n app.toggle();\n }, 2000);
\n
\n~~~
Sorry, again without the crappy formatting:
\n\nvar debug = Ti.API.debug;\n\nvar app = {\n\nsetup: function () {\n this.win = Ti.UI.createWindow({});\n this.web = Ti.UI.createWebView({html:\"<html><body>hello</body></html>\"});\n this.web2 = Ti.UI.createWebView({html:\"<html><body>world</body></html>\"});\n this.win.add(this.web);\n this.win.add(this.web2);\n this.win.open();\n},\n\ntoggle: function () {\n if (this.web2.visible) {\n debug(\"visible\");\n this.web2.hide();\n } else {\n debug(\"invisible\");\n this.web2.show();\n }\n}\n\n};\n\napp.setup();\nsetInterval(function () {\n\n app.toggle();\n }, 2000);
\n
Reopening.
(from [d62a7e28e9188a95c9fa4993fbfdf33152529b01])\n[#2172 state:fixed-in-qa] zindex now forcefully\nreset (to add view to hierarchy) before reposition when setting\n'visible', if necessary. \nhttp://github.com/appcelerator/titanium_mobile/commit/d62a7e28e9188...
Thanks, this looks fixed now
Sorry, spoke too soon. Various other regressions now. The\nfollowing code works on 1.4.x, not on 1.5. Comments at the bottom\nof file
\n\nvar debug = Ti.API.debug;\n\nvar app = {\n setupActivity: function(message) {\n this.activityTrans = Ti.UI.createWindow(\n {backgroundColor: \"#fff\", opacity: 0.65, zIndex: 1});\n this.activityWin = Ti.UI.createWindow(\n {opacity: 0.9,\n backgroundImage: 'images/gradround.png',\n top: \"40%\", height: 80, left: \"20%\", right: \"20%\", zIndex: 2,\n color:\"#fff\"\n });\n this.activity = Ti.UI.createActivityIndicator(\n {top: 30, height: 25, color:\"#fff\",\n style:Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN});\n this.activity.show();\n this.activityWin.add(this.activity);\n this.activityLabel = Ti.UI.createLabel(\n {left: 5, right: 5, top: 35, height: 35,\n text: \"\", color: \"#fff\", textAlign: \"center\",\n font:{fontSize:16}\n });\n this.activityWin.add(this.activityLabel);\n\n this.activityTrans.open();\n this.activityWin.open();\n this.activity.message = message;\n Titanium.App.idleTimerDisabled = true;\n },\n\n activityOn: function (message) {\n if (!message) {\n message = \"Loading...\";\n }\n if (!this.activityWin) {\n this.setupActivity(message);\n } else {\n this.activityWin.height = 80;\n this.activityWin.left = \"20%\";\n this.activityWin.right = \"20%\";\n this.activityLabel.text = \"\";\n this.activity.message = message;\n this.activity.top = 30;\n this.activity.show();\n this.activityWin.show();\n this.activityTrans.show();\n Titanium.App.idleTimerDisabled = true;\n }\n this.activityLabelShown = false;\n this.activityProgressShown = false;\n },\n\n activityOff: function (keepTrans) {\n if (this.activity) {\n Titanium.App.idleTimerDisabled = false;\n this.activity.hide(); // android\n this.activityWin.hide();\n if (!keepTrans) {\n this.activityTrans.hide();\n }\n if (this.progressBar) {\n this.progressBar.hide();\n }\n }\n },\n\n activityProgress: function (value) {\n this.activity.top = 15;\n if (!this.progressBar) {\n this.progressBar = Ti.UI.createProgressBar(\n {width:150, min:0, max:1, value:0,\n height:15, color:'#88F',\n style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN,\n bottom:15});\n this.progressBar.show();\n this.activityWin.add(this.progressBar);\n this.activityProgressShown = true;\n } else {\n this.progressBar.show();\n if (!this.activityProgressShown) {\n this.activityProgressShown = true;\n }\n }\n this.progressBar.value = value;\n }\n\n};\n\nfunction t1 () {\n // notice the text & spinner don't appear\n debug(\"t1\");\n app.activityOn(\"message 1\");\n setTimeout(t2, 2000);\n}\n\nfunction t2 () {\n // neither does the progress bar\n debug(\"t2\");\n app.activityProgress(0.5);\n setTimeout(t3, 2000);\n}\n\nfunction t3 () {\n debug(\"t3\");\n app.activityOff();\n // spinner appears but message still missing\n app.activityOn(\"message 2\");\n}\n\nt1();
\n
Reopening again.
(from [8a65922b971cb93c6f6b024362d5016a65c5bee3])\n[#2172 state:fixed-in-qa] show/hide works for\nactivityIndicator and progressBar again. \nhttp://github.com/appcelerator/titanium_mobile/commit/8a65922b971cb...
Thanks, looks good after a quick test.
1.5.0.3ee6a97, 4th gen ipod touch, 3g iphone