Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9827] Android: Translate animations of invisible views may be delayed

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-08-01T04:36:21.000+0000
Affected Version/sRelease 2.1.0, Release 2.0.1, Release 1.8.3
Fix Version/sSprint 2012-14 Core, Release 2.1.1, Release 3.0.0
ComponentsAndroid
Labelscore, module_animation, qe-testadded
ReporterMauro Parra-Miranda
AssigneeBill Dawson
Created2012-06-27T17:39:35.000+0000
Updated2013-08-14T18:30:06.000+0000

Description

Problem Description

Views are not animating in Android.

Actual Results

The animation is not happening in the view.

Expected results

If you animate a view, you should see it animated.

Test Case

1. Create Mobile Project 2. Paste this app.js
var win1 = Titanium.UI.createWindow({backgroundColor:'#FFFFFF'});

var ds =[];
expandableView = Ti.UI.createView({top:0,height:60,backgroundColor:'red'});
nextview = Ti.UI.createView({layout:'vertical',top:-60,height:60,backgroundColor:'blue'});
var row1 = Titanium.UI.createTableViewRow({height:100});
row1.add(expandableView);

ds.push(row1);

var row2 = Titanium.UI.createTableViewRow({height:100});
row2.add(nextview);

ds.push(row2);


var btn1 = Ti.UI.createButton({
					title : 'Yes',
					width : '50%',
					height : 30,
					bottom : 0,
					left : 0,
					font : {
						fontSize : 13,
						fontWeight : 'bold',
						fontFamily : 'Helvetica Neue'
					},
					color : '#FFFFFF',
					backgroundImage:'none',
					backgroundColor:'yellow'
				});
		
			var btn2 = Ti.UI.createButton({
					title : 'No',
					width : '50%',
					height : 30,
					bottom : 2,
					right : 0,
					font : {
						fontSize : 13,
						fontWeight : 'bold',
						fontFamily : 'Helvetica Neue'
					},
					color : '#858686',
					backgroundImage:'none',
					backgroundColor:'green'
				});
btn1.addEventListener('click',function(){
	nextview.animate({top:0,duration:500})
});
btn2.addEventListener('click',function(){
	nextview.animate({top:-60,duration:500})
});
var tableView = Titanium.UI.createTableView({
			data : ds,
			scrollable : true,
			separatorColor : 'transparent',
			separatorStyle: 'none',
			top:0
	});


win1.add(tableView);
win1.add(btn1);
win1.add(btn2);
win1.open();

Extra info

When you test this in iOS, works just perfect.

Attachments

FileDateSize
app.js2012-07-13T14:12:44.000+00003360

Comments

  1. Bill Dawson 2012-07-12

    Testing Notes

    * Create a new app. Put...
       <property name="ti.ui.defaultunit">dip</property>
       
    ... in the tiapp.xml. * Replace the app.js with the attached app.js (i.e., the attached file, not the customer's failcase in the JIRA description), which contains the original failcase from the customer and an expanded test case. * Test the app on 2.3 and Honeycomb or higher (ICS would be good.) Behavior should be as described in the following sections. *Note* that in 2.3, when testing the expanded test case, you will see bad artifacts, namely the parent view of the view that is being animated will suddenly become transparent (or parts of it, anyway.) **This is not a regression.** (Feel free to run it in 1.8.2, for example, and you'll see it happens all the way back then.) We have TIMOB-9813 for that problem. For the purposes of this ticket, you should validate that a) the animations appear when they should; and b) their final positions are as expected.

    Original failcase app

    When you run the original failcase *without* my fixes, when you tap the yellow at the bottom of the screen nothing will happen (unless you tap it *very* quickly after its activity loads.) When testing with my fixed branch, when you tap the yellow at the bottom then a blue view should slide into view, and when you press the green area at the bottom then that blue view should slide back up and disappear.

    Expanded Test Case

    When you test the expanded test case *without* my fixes, very herky jerky animations will occur, and the paths that some of the animations take to get to their new location will look ridiculous. When you test *with* my fixes, you will get nice smooth animations (though, as noted above, in 2.3 or lower you will see parent transparency, which is a bug covered by another ticket). This "expanded" test, by the way, does the following: * The red box (upper-left of the blue box) starts at position minus 5 and minus 15, i.e., the box is partially obscured. These negative values are on purpose, because I wanted to make sure it works with negative origin values. * When you click the "animate" button the first time, the red box will slide down to be on top of the white box. * Then, each time you click "animate", it will move to the next edge of the white box in a clockwise direction (top>right>bottom>left). * Then it'll pounce back up to its origin and start all over again.
  2. Bill Dawson 2012-07-12

    Changing title from: "Android: Animate is not working on Tableviews" to: "Android: Translate animations of invisible views may be delayed" The problem is not specific to table views, but is rather something that is happening with views which start out invisible because they have negative boundaries.
  3. Bill Dawson 2012-07-12

    Pull request ready: https://github.com/appcelerator/titanium_mobile/pull/2556
  4. Anshu Mittal 2012-07-17

    Verified On: SDK: 2.1.1.v20120716180600 Studio: 2.1.1.201207161421 Device: Samsung Galaxy tab(V 3.2)
  5. Anshu Mittal 2012-08-01

    Reopening to update labels.

JSON Source