Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10071] Android: Alpha animation from 0.0 to 1.0 will not respect duration property when run back from 1.0 to 0.0

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-07-24T11:50:20.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-15 Core, Release 3.0.0
ComponentsAndroid
Labelscore, module_animation, qe-manualtest, qe-port
ReporterBill Dawson
AssigneeBill Dawson
Created2012-07-23T06:24:39.000+0000
Updated2014-08-07T17:03:37.000+0000

Description

Fail Case / Testing Notes

If a view's opacity property is set to 0.0, then is animated to 1.0, when you then animate it back to 0.0 it will happen immediately, without respect for any duration property you might set on the animation. * Create an app and use this as the app.js:
Titanium.UI.setBackgroundColor('#444');
var win = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#444',
	exitOnClose: true
});

var v = Ti.UI.createView({
	opacity: 0, backgroundColor: "red",
	top: "20%", bottom: "20%", left: "10%", right: "10%"
});
win.add(v);

var btn = Ti.UI.createButton({
	bottom: "16dp", height: "48dp", left: "16dp", width: "96dp",
	title: "Animate"
});
var current = -1;
btn.addEventListener("click", function() {
	if (current <= 0.0) {
		current = 1.0;
	} else {
		current = 0.0;
	}
	v.animate({opacity: current, duration: 3000});
});
win.add(btn);

win.open();
* After the app loads, click the "Animate" button. A view will appear (its opacity was 0) and, over the course of three seconds, will animate to be fully opaque (opacity = 1.0). * After it is fully opaque, click the "Animate" button again. *Expected Behavior*: The view's opacity will animate to 0.0 (transparency) over a three second period. *Actual Behavior*: The view immediately becomes transparent (i.e., it disappears immediately.)

Comments

  1. Bill Dawson 2012-07-23

    pull request ready https://github.com/appcelerator/titanium_mobile/pull/2625
  2. Shyam Bhadauria 2012-08-15

    Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120815194913 Tested with Titanium  Studio: 2.1.1.201207271312 Device - Samsung GALAXY Note Android 2.3.6 Machine OS - MAC 10.7.3

JSON Source