[TIMOB-2172] Window show/hide methods not working in latest git
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | iOS |
Labels | defect, ios, iphone, rplist, window |
Reporter | ctredway |
Assignee | Blain Hamon |
Created | 2011-04-15T03:12:37.000+0000 |
Updated | 2011-04-17T01:58:18.000+0000 |
Description
On the iphone, using the hide/show methods will hide a window but will not show it again. However, manually setting the visible property does work.
Below code shows this:
var app = {
setupActivity: function(message) {
this.activityTrans = Ti.UI.createWindow(
{backgroundColor: "#fff", opacity: 0.65, zIndex: 1});
this.activityWin = Ti.UI.createWindow(
{opacity: 0.9,
backgroundImage: 'images/gradround.png',
top: "40%", height: 80, left: "20%", right: "20%", zIndex: 2,
color:"#fff"
});
this.activity = Ti.UI.createActivityIndicator(
{top: 30, height: 25, color:"#fff",
style:Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN});
this.activity.show();
this.activityWin.add(this.activity);
this.activityLabel = Ti.UI.createLabel(
{left: 5, right: 5, top: 35, height: 35,
text: "", color: "#fff", textAlign: "center",
font:{fontSize:16}
});
this.activityWin.add(this.activityLabel);
this.activityTrans.open();
this.activityWin.open();
this.activity.message = message;
Titanium.App.idleTimerDisabled = true;
},
activityOn: function (message) {
if (!message) {
message = "Loading...";
}
if (!this.activityWin) {
this.setupActivity(message);
} else {
this.activityWin.height = 80;
this.activityWin.left = "20%";
this.activityWin.right = "20%";
this.activityLabel.text = "";
this.activity.message = message;
this.activity.top = 30;
this.activity.show();
this.activityWin.show();
this.activityTrans.show();
Titanium.App.idleTimerDisabled = true;
}
this.activityLabelShown = false;
this.activityProgressShown = false;
},
activityOff: function (keepTrans) {
if (this.activity) {
Titanium.App.idleTimerDisabled = false;
this.activity.hide(); // android
this.activityWin.hide();
if (!keepTrans) {
this.activityTrans.hide();
}
if (this.progressBar) {
this.progressBar.hide();
}
}
}
};
app.activityOn("message 1");
setTimeout(function () {
app.activityOff();
setTimeout(function () {
app.activityOn("message 2");
}, 2000);
}, 2000);
Mislabeled the bug as #2272 instead of #2172 in the commit. Commit is 7604111. Marking fixed-in-qa.
Hmm, this has resolved the problem with the code above, but my webviews as reported in http://developer.appcelerator.com/helpdesk/view/50571">http://developer.appcelerator.com/helpdesk/view/50571 are not rendering correctly. I'll try build you a test case tonight or tomorrow.
The following code works in 1.4.x but not the current git.
~~~ var debug = Ti.API.debug;
var app = {
};
app.setup();
setInterval(function () {
~~~
Sorry, again without the crappy formatting:
Reopening.
(from [d62a7e28e9188a95c9fa4993fbfdf33152529b01]) [#2172 state:fixed-in-qa] zindex now forcefully reset (to add view to hierarchy) before reposition when setting 'visible', if necessary. http://github.com/appcelerator/titanium_mobile/commit/d62a7e28e9188a95c9fa4993fbfdf33152529b01"> http://github.com/appcelerator/titanium_mobile/commit/d62a7e28e9188...
Thanks, this looks fixed now
Sorry, spoke too soon. Various other regressions now. The following code works on 1.4.x, not on 1.5. Comments at the bottom of file
Reopening again.
(from [8a65922b971cb93c6f6b024362d5016a65c5bee3]) [#2172 state:fixed-in-qa] show/hide works for activityIndicator and progressBar again. http://github.com/appcelerator/titanium_mobile/commit/8a65922b971cb93c6f6b024362d5016a65c5bee3"> http://github.com/appcelerator/titanium_mobile/commit/8a65922b971cb...
Thanks, looks good after a quick test.
1.5.0.3ee6a97, 4th gen ipod touch, 3g iphone