Skip to content

Commit d871a5d

Browse files
committed
Handle active dialogs when returning to host
1 parent 986bf02 commit d871a5d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/demos/common/src/test/java/com/codenameone/developerguide/animations/AnimationDemosScreenshotTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ private void returnToHost(Form demoForm, Form host) {
176176
}
177177

178178
while (System.currentTimeMillis() <= deadline) {
179+
Dialog activeDialog = Dialog.getActiveDialog();
180+
if (activeDialog != null) {
181+
activeDialog.dispose();
182+
animateCurrentForm();
183+
TestUtils.waitFor(120);
184+
continue;
185+
}
186+
179187
Form active = currentForm();
180188
if (active == host) {
181189
break;
@@ -224,6 +232,12 @@ private void animateCurrentForm() {
224232
Form current = currentForm();
225233
if (current != null) {
226234
current.animate();
235+
return;
236+
}
237+
238+
Dialog dialog = Dialog.getActiveDialog();
239+
if (dialog != null) {
240+
dialog.animate();
227241
}
228242
}
229243

0 commit comments

Comments
 (0)