Problem
When running an intro animation or creating a window animation fade with opacity from 0 to 1, a change in orientation resets the animation state of the window to its original created state and the animated end state.
Test case
Here is a use case followed by a code example of this problem.
I have an app with 2 different splash screens based on portrait and landscape orientation. My app consists of a single window that has a few UI elements, labels such like within, the window is created with an opacity of 0. When the app loads, it triggers an animate function to take the opacity to 1. As the window has 2 orientation states, when the user flips the device in either direction, the original window state is restored and, thus, the opacity of the window becomes transparent (reverts to 0), which causes the splash screen to show through.
Ti.UI.setBackgroundColor('#fff');
var win1 = Ti.UI.createWindow({
title : 'Anim Test',
backgroundColor : '#fff',
exitOnClose : true,
navBarHidden : false,
opacity : 0
});
win1.orientationModes = [Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT];
var label1 = Ti.UI.createLabel({
color : '#000',
text : 'Main Application Window, after fade.',
font : {
fontSize : 20,
fontFamily : 'Helvetica Neue'
},
textAlign : 'center',
width : 'auto'
});
win1.add(label1);
win1.animate({
opacity : 1,
duration : 3000
});
win1.open();
Ket Please state the specific devices tested, or the emulator if you have tested that. Please state the runtime used.
Tested on HTC Wildfire S & Orange San Fransisco (Blade) a WVGA style device
Runtime please.
v8 for both.
Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4
The effort for TIMOB-11811 fixed this.
Verified the fix: Appc-Studio: 3.2.0.201310181700 Sdk:3.2.0.v20131022171645 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3), iPhone5(v7.0) Xcode: 5 OS: Mac OSX 10.8 Orientation does not change back animation to its original state now. Code working fine.