[TIMOB-18392] Android: ImageView with ImageArray, does not fire 'stop' event after repeatCount value has been reached
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2015-03-05T21:23:52.000+0000 |
| Affected Version/s | Release 3.4.0, Release 3.4.1, Release 3.5.0 |
| Fix Version/s | Release 4.1.0 |
| Components | Android |
| Labels | animation, imageView, images, stop |
| Reporter | Malcolm Hollingsworth |
| Assignee | Hieu Pham |
| Created | 2015-01-15T16:53:25.000+0000 |
| Updated | 2017-03-16T22:21:03.000+0000 |
Description
When using the ImageView with an *array* of images using the *images* property and *repeatCount* set to a non-zero value - the event *stop does not fire*.
The event *start* *does* fire upon starting, however the *stop* event does *not*.
<ImageView
id="img"
backgroundColor="purple",
duration="200",
height="50",
repeatCount="20",
width="50"
/>
var handler = function (e) {
var currentdate = new Date();
var datetime = + currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":"
+ currentdate.getSeconds();
Ti.API.info(e.type + ': ' + datetime);
};
$.img.addEventListener('start', handler);
$.img.addEventListener('stop', handler);
$.img.setImages([
"/images/red/red1.png",
"/images/red/red2.png",
"/images/red/red3.png",
"/images/red/red4.png",
]);
$.img.start();
Problem can be reproduced on SDK 3.5.0.GA Here is the test case:
var win = Ti.UI.createWindow({ backgroundColor:'White' }); var imageView = Ti.UI.createImageView({ id:"img", backgroundColor:"purple", duration:"2000", height:"50", repeatCount:"10", width:"50", images:[ "/images/Test/1.png", "/images/Test/2.png", "/images/Test/3.png", "/images/Test/4.png" ] }); imageView.addEventListener('start', function(e) { alert("start animation"); }); imageView.addEventListener('stop', function(e) { alert("stop animation"); }); imageView.start(); win.add(imageView); win.open();master PR: https://github.com/appcelerator/titanium_mobile/pull/6683
Closing ticket as fixed.