Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18392] Android: ImageView with ImageArray, does not fire 'stop' event after repeatCount value has been reached

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2015-03-05T21:23:52.000+0000
Affected Version/sRelease 3.4.0, Release 3.4.1, Release 3.5.0
Fix Version/sRelease 4.1.0
ComponentsAndroid
Labelsanimation, imageView, images, stop
ReporterMalcolm Hollingsworth
AssigneeHieu Pham
Created2015-01-15T16:53:25.000+0000
Updated2017-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();

Comments

  1. Shuo Liang 2015-01-16

    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();
       
  2. Hieu Pham 2015-03-03

    master PR: https://github.com/appcelerator/titanium_mobile/pull/6683
  3. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source