Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28085] Android: Modal/Translucent window wrongly shows a close animation by default

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, animation, translucent, window
ReporterJoshua Quick
AssigneeJoshua Quick
Created2020-08-15T01:02:24.000+0000
Updated2021-02-22T19:07:37.000+0000

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:*

Build and run the below code on Android.

Tap on the "Show Translucent Window" button.

Notice that translucent suddenly appears without animation. _(This is good.)_

Wait for the window to auto-close itself within 2 seconds.

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 });

Comments

No comments

JSON Source