Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2776] Android: Animation callback is called multiple times.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M07
ComponentsAndroid
Labelsandroid, defect, enterprise, release-1.6.0, rplist
ReporterFred Spencer
AssigneeDon Thorp
Created2011-04-15T03:29:16.000+0000
Updated2011-04-17T02:00:03.000+0000

Description

See log.

var win = Ti.UI.createWindow({
    navBarHidden: true,
    exitOnClose: true,
    backgroundColor: '#fff'
});

var view = Ti.UI.createView({
    width: 50,
    height: 50,
    left: 0,
    top: 0,
    backgroundColor:'#f00'
});

var animateBtn = Ti.UI.createButton({
    left: 10,
    right: 10,
    height: 50,
    title: 'Animate'
});

animateBtn.addEventListener('click', function(e) {
    view.animate({
        top: Ti.Platform.displayCaps.platformHeight - view.height,
        left: Ti.Platform.displayCaps.platformWidth - view.width,
        duration: 1000
    },
    function(e) {
        Ti.API.info('This is called multiple times.');
    });
});

win.add(animateBtn);
win.add(view);
win.open();

Comments

  1. Marshall Culpepper 2011-04-15

    (from [aa8eb0af3564cca62e04fd8e561a019a57bf6c11]) don't allow clearAnimation to cause our animation listener to be re-entrant [#2776 state:fixed-in-qa milestone:"Release 1.6.0 M04"]
    https://github.com/appcelerator/titanium_mobile/commit/aa8eb0af3564cca62e04fd8e561a019a57bf6c11"> https://github.com/appcelerator/titanium_mobile/commit/aa8eb0af3564...

  2. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06), I only see the fix on 2.2 (droid 1 -2.2.1 and sim 2.2) while on 2.1 sim and 1.6 device, I see:

    I/TiAPI ( 4931): (kroll$4) [3458,20554] This is called multiple times.
    I/TiAPI ( 4931): (kroll$4) [4,20558] This is called multiple times.

  3. Don Thorp 2011-04-15

    Moving to M07 so it can get worked.

  4. Marshall Culpepper 2011-04-15

    (from [133d37e7f4d02329bb4a91ca71b90225210430c1]) only fire animation complete when the completion comes from the parent AnimationSet [#2776 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/133d37e7f4d02329bb4a91ca71b90225210430c1"> https://github.com/appcelerator/titanium_mobile/commit/133d37e7f4d0...

  5. Opie Cyrus 2011-04-15

    verified emulator 2.2 with test case from Fred. animate callback is invoked only once.

JSON Source