Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14619] Android: autoreverse=true works once, then element disappears; callback works fine

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, animation
ReporterTim Poulsen
AssigneeUnknown
Created2013-07-22T20:58:05.000+0000
Updated2018-02-28T20:03:45.000+0000

Description

The following simple app demonstrates the issue with autoreverse: Tap the first label and it will animate to zero opacity and back once. Tap it again and it disappears (goes to opacity=0 instantly). This label is animated using autoreverse=true Tapping the second box, the label correctly animates to zero opacity and back to opacity=1 as many times as you want to tap the label. This label is animated using a callback function with autoreverse unspecified.
<Alloy>
	<Window class="container">
		<Label id="label" onClick="doClick">Click Me</Label>
		<Label id="label2" onClick="doClick2">Click Me</Label>
	</Window>
</Alloy>
".container": {
	backgroundColor:"white",
	layout: 'vertical'
},
"Label": {
	width: 300,
	height: 100,
	top: 50,
	color: "#fff",
	backgroundColor: 'red',
	textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER
},
"#label2": {
	backgroundColor: 'green'
}
function doClick(e) {  
    $.label.animate({
    	opacity: 0,
    	duration: 2000,
    	autoreverse: true
    });
}

function doClick2(e) {  
    $.label2.animate({
    	opacity: 0,
    	duration: 2000
    }, function() {
    	$.label2.animate({
    		opacity: 1,
    		duration: 2000
    	})
    });
}
$.index.open();
Possible regression. See TIMOB-8091

Comments

No comments

JSON Source