Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10362] Android: Redraw problem on animation

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-20T17:47:14.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sBacklog
ComponentsAndroid
Labelscore, exalture, insight
ReporterMartin Guillon
AssigneeSunila
Created2012-07-21T03:19:13.000+0000
Updated2017-03-21T21:27:23.000+0000

Description

I have a button that triggers a animation. But each time i press the animation is replayed from the start. The problem is that while replaying you can still see the animated view at its destination position(so you it twice).
var win = Ti.UI.createWindow({ fullscreen: true, backgroundColor: 'white'});

var button = Ti.UI.createButton({
    title:'Translate',
    width:100,
    height:50,
    top:0
});
win.add(button);



//label using localization-ready strings from <app dir>/i18n/en/strings.xml
var view = Ti.UI.createView({
    backgroundColor:'red',
    height:100,
    width:100
});
win.add(view);

//Add behavior for UI
button.addEventListener('click', function(e) {
    if (!view.hasOwnProperty('currentTransform'))
    {
        var transform = Ti.UI.create2DMatrix().translate(0,200);
        view.currentTransform = transform;
        view.animate({transform:transform, duration:400})
        Ti.API.info('first transform')
    }
    else
    {
        view.transform = Ti.UI.create2DMatrix(); //reset!
        view.animate({transform:view.currentTransform, duration:400})
        Ti.API.info('next transform')
    }
    
});
    
win.open();

Comments

  1. Sunila 2013-03-20

    I can't reproduce this. Tried with SDK 3.1.0. I don't see the animation image on the target.
  2. Martin Guillon 2013-03-29

    You are right i dont even see it anymore with the 3.0.2.GA. I guess it s fixed. Great job
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source