Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7521] Android: UI.Animation fails silently if properties set on creation

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-03-23T21:11:51.000+0000
Affected Version/sRelease 1.8.1
Fix Version/sn/a
ComponentsAndroid
Labelsapi, parity
ReporterKetan Majmudar
AssigneePing Wang
Created2012-02-02T13:31:31.000+0000
Updated2017-03-31T17:24:32.000+0000

Description

Problem

If you try an create an animation, it will silently fail if you use an animation object with properties that are created when the animation object is instantiated. The test case works correctly on iOS 5.0 Simulator.

Test case

// WORKS ON IOS
Titanium.UI.setBackgroundColor('#000');

var win1 = Titanium.UI.createWindow({
	title : 'Tab 1',
	backgroundColor : '#fff'
});

win1.open();

// First transform to minimize object
var transform1 = Titanium.UI.create2DMatrix();
transform1 = transform1.scale(0)

// With properties:
var animation1 = Titanium.UI.createAnimation({
	transform: transform1,
	duration: 750
});
// animation1.transform = transform1;
// animation1.duration = 750;

// Modal View
var mapView = Ti.UI.createView({
	top : 40,
	bottom : 40,
	left : 10,
	right : 10,
	zIndex : 10,
	backgroundColor : '#000', // should be app wide style colour setting
	borderRadius : 12,
	borderWidth : 6,
	borderColor : 'blue',
	opacity : 1 // ensure its not showing
});

win1.add(mapView);

mapView.animate(animation1);

Workaround

Create the animation object, then assign the properties to it.
// WORKS ON ANDROID & IOS

Titanium.UI.setBackgroundColor('#000');

var win1 = Titanium.UI.createWindow({
	title : 'Tab 1',
	backgroundColor : '#fff'
});

win1.open();

// First transform to minimize object
var transform1 = Titanium.UI.create2DMatrix();
transform1 = transform1.scale(0);

// Without properties:
var animation1 = Titanium.UI.createAnimation();
animation1.transform = transform1;
animation1.duration = 750;

// Modal View
var mapView = Ti.UI.createView({
	top : 40,
	bottom : 40,
	left : 10,
	right : 10,
	zIndex : 10,
	backgroundColor : '#000', // should be app wide style colour setting
	borderRadius : 12,
	borderWidth : 6,
	borderColor : 'blue',
	opacity : 1 // ensure its not showing
});

win1.add(mapView);

mapView.animate(animation1);

Comments

  1. Ketan Majmudar 2012-02-10

  2. Ping Wang 2012-06-04

    Can not reproduce with latest master.
  3. Lee Morris 2017-03-31

    Closing ticket as it has been over 5 years since the last update. Please open a new ticket if you have a problem.

JSON Source