Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28085

Android: Modal/Translucent window wrongly shows a close animation by default

    Details

      Description

      Summary:
      Opening a modal/translucent window does not show an open animation by default, but closing the window does show a close animation. This behavior is inconsistent.

      A modal/translucent window should NOT show an open/close animation by default. This was the intended behavior and would match iOS' behavior.

      Steps to reproduce:

      1. Build and run the below code on Android.
      2. Tap on the "Show Translucent Window" button.
      3. Notice that translucent suddenly appears without animation. (This is good.)
      4. Wait for the window to auto-close itself within 2 seconds.
      5. Notice that the window closed with an animation. (This is the bug.)

      var parentWindow = Ti.UI.createWindow({
      	title: "Parent Window",
      	backgroundColor: "white",
      });
      var openButton = Ti.UI.createButton({
      	title: "Show Translucent Window",
      	bottom: "15dp",
      });
      openButton.addEventListener("click", function() {
      	var childWindow = Ti.UI.createWindow({
      		title: "Translucent Window",
      		backgroundColor: "black",
      		opacity: 0.5,
      	});
      	childWindow.add(Ti.UI.createLabel({
      		text: "This is the translucent window.",
      		color: "white",
      	}));
      	childWindow.addEventListener("open", function() {
      		setTimeout(function() {
      			childWindow.close();
      		}, 1500);
      	});
      	childWindow.addEventListener("androidback", function() {
      		childWindow.close();
      		parentWindow.close();
      	});
      	childWindow.open();
      });
      parentWindow.add(openButton);
      parentWindow.open();
      

      Work-Around:
      When closing the translucent window, set the "animated" property to false.

      window.close({ animated: false });
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration