Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7790] Android: UI.Animation - orientation change resets animation to original state

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-26T22:09:26.000+0000
Affected Version/sRelease 1.8.1, Release 3.1.0
Fix Version/sRelease 3.2.0
ComponentsAndroid
Labelsn/a
ReporterKetan Majmudar
AssigneeBill Dawson
Created2012-02-23T09:52:05.000+0000
Updated2013-10-23T06:39:46.000+0000

Description

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

Comments

  1. Paul Dowsett 2012-02-23

    Ket Please state the specific devices tested, or the emulator if you have tested that. Please state the runtime used.
  2. Ketan Majmudar 2012-02-23

    Tested on HTC Wildfire S & Orange San Fransisco (Blade) a WVGA style device
  3. Paul Dowsett 2012-02-23

    Runtime please.
  4. Ketan Majmudar 2012-02-23

    v8 for both.
  5. jithinpv 2013-03-05

    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
  6. Bill Dawson 2013-08-26

    The effort for TIMOB-11811 fixed this.
  7. Priya Agarwal 2013-10-23

    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.

JSON Source