[TIMOB-27309] Android: Cannot re-show "ProgressIndicator" dialog if auto-hidden by closed window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-08-23T04:58:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.1.1 |
Components | Android |
Labels | ProgressIndicator, android, dialog, engSchedule |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-08-06T04:40:00.000+0000 |
Updated | 2019-08-23T04:58:37.000+0000 |
Description
*Summary:*
If a
Ti.UI.Android.ProgressIndicator
dialog was auto-closed by a window (ie: you did not call its hide()
method yourself), then you will not be able to re-show the dialog ever again. The ProgressIndicator
object becomes unusable.
*Note:*
This is more likely to happen if Android developer option "Don't keep activities" is enabled.
*Steps to reproduce:*
Build and run the below code on Android.
Tap on the "Show Progress Dialog" button.
A new window displaying a progress dialog will be shown.
Wait 2 second for the window and dialog to auto-close.
Tap on the "Show Progress Dialog" button again.
Notice that the child window is empty. The progress dialog was not shown. (This is the bug.)
var progressIndicator = Ti.UI.Android.createProgressIndicator({
message: "Progressing...",
location: Ti.UI.Android.PROGRESS_INDICATOR_DIALOG,
type: Ti.UI.Android.PROGRESS_INDICATOR_INDETERMINANT,
});
var window = Ti.UI.createWindow();
var button = Ti.UI.createButton({ title: "Show Progress Dialog" });
button.addEventListener("click", function(e) {
var childWindow = Ti.UI.createWindow({ title: "Child Window" });
childWindow.addEventListener("open", function() {
progressIndicator.show();
setTimeout(function() {
childWindow.close();
}, 2000);
});
childWindow.open();
});
window.add(button);
window.open();
*Work-Around:*
Hide the progress dialog when via its window's "close" event.
window.addEventListener("close", function() {
progressIndicator.hide();
});
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11115 PR (8.1.x): https://github.com/appcelerator/titanium_mobile/pull/11142 PR (8.3.x): https://github.com/appcelerator/titanium_mobile/pull/11143
FR Passed on master, 8_1_X and 8_3_X. The progress indicator works as expected. Waiting for builds to pass.
Verified the fix on sdk 8.3.0.v20190822115908,8.2.0.v20190822114913 and 8.1.1.v20190822103134.Progress indicator works as expected. Closing Test Enviornment: Operating System Name = Mac OS X Version = 10.14.5 Architecture = 64bit Memory = 17179869184 Node.js Node.js Version = 10.16.2 npm Version = 6.9.0 Titanium CLI CLI Version = 5.2.1 Titanium SDK SDK Version = 8.2.0.v20190822114913 Device = One plus 5T android 9,samsung s5 android 6 Emulator= pixel android 9,nexus android 8