Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3122] iOS: ImageView animation ignores repeatCount upon second call to start()

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-08-03T14:44:04.000+0000
Affected Version/sRelease 1.8.0.1, Release 3.0.0
Fix Version/sn/a
ComponentsiOS
Labelscore
Reporterjbwiv
AssigneeIngo Muschenetz
Created2011-04-15T03:37:29.000+0000
Updated2016-08-03T14:44:04.000+0000

Description

If you start() an animation created with an imageView, it will honor the repeatCount setting the first time. However, if you call start() again, the animation will repeat indefinitely. Tested on all versions of supported iOS. Code to demonstrate:
var win1 = Titanium.UI.createWindow({
    backgroundColor: '#fff'
});

var image_list = ["default_app_logo.png", "apple_logo.jpg"];

var animation = Ti.UI.createImageView({
    images: image_list,
    repeatCount: 1,
    duration: 1000
});

win1.addEventListener("singletap", function(e) {
    Ti.API.log("info", "Starting because of single tap.");
    Ti.API.log("info", "repeatCount is: " + animation.repeatCount);
    animation.start();
});

animation.addEventListener("stop", function(e) {
    Ti.API.log("info", "animation shutting down properly");
});

win1.add(animation);
win1.open();

Comments

  1. Mauro Parra-Miranda 2012-01-06

    Tested on 1.8.0.1, still happening. Related to http://developer.appcelerator.com/question/130338/imageview-repeatcount-ignored-on-second-call Best, Mauro
  2. Mauro Parra-Miranda 2012-01-06

    Hello, happening in other community comments, as: http://developer.appcelerator.com/question/4831/imageview-repeatcount-bug http://developer.appcelerator.com/question/110991/imageview-animation-repeats-endlessly Best, Mauro
  3. Junaid Younus 2012-08-30

    Tested on the iOS simulator using TiSDK 2.2.0v20120830102513, issue still valid.
  4. Quang Pham 2014-03-18

    this bug still happend
  5. W. Blaine Price 2014-08-13

    Replicated in iOS simulator using 3.2.3 SDK
  6. Hans Knöchel 2016-04-24

    Ok, so I just tested the issue using the provided code on 5.2.2.GA and 5.4.0 master. When clicking into the window, the animation starts properly, trying to call it again afterwards, it still works. Please test the above mentioned SDK's and provide feedback. Thank you!
  7. Akash Giri 2016-07-26

    I tried on Android 6, Nexus 5 on 5.2.2.GA. The problem I am getting is, if I set the repeatCount to 1, then the animation is not starting at all even after using image.start() (image is the imageView object). Please confirm this behavior. Thanks!
  8. Hans Knöchel 2016-08-03

    [~giriakash123] That's supposed to be the correct behavior, because a count = 0 would not even show it. Closing this (iOS) issue for now, if anyone still runs into it using Titanium 5.4.0+, let me know. Thanks!

JSON Source