Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6852] Android: Transform and color resets after animation

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-07-20T18:26:12.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sRelease 3.2.0
ComponentsAndroid
LabelsParity, dr-list, insight, pathmenu, qe-testadded, tbs-1.9.0
ReporterTony Lukasavage
AssigneeHieu Pham
Created2011-12-22T14:37:13.000+0000
Updated2014-03-11T11:30:54.000+0000

Description

Problem

When animating a view's transform, the transform will disappear, or be reset, after the animation completes on Android. It works fine on iOS.

Code to Reproduce

[http://pastie.org/3059555](http://pastie.org/3059555) Just run the code listed there for both Android and iOS. On iOS, the view will animate to the bottom-right, and rotate 60 degrees. On Android, the same thing will happen, but when the animation completes, the rotation goes back to zero. The same thing happens if you apply a scale. All other properties, like left, top, opacity, etc... work fine, only the transform resets on Android. I attempted to workaround this by setting the view's transform to the animations transform in the animation's complete event, but there is a very noticable flicker when this happens, very ugly.

Comments

  1. Kevin Whinnery 2011-12-23

    Yeah dude, this is totally ruining my Titanium game development efforts. :)
  2. Tony Lukasavage 2011-12-23

    Oh ye of little vision! I've got some pretty outside-the-box data visualization ideas actually. :)
  3. Hieu Pham 2011-12-27

    So apparently android animation does NOT affect layouts. In other words, after the view is animated, its params stay untouched. We'll have to apply the transformation ourselves to the view..
  4. Tony Lukasavage 2011-12-27

    Hieu, I mentioned it above, but just to reiterate, I tried applying the animation's transformation to the view in Javascript inside the animation's complete event. It kinda worked, but there's a _very_ noticeable flicker as it changes transformation.
  5. Ping Wang 2013-04-18

    The color animation also resets after animation. Test case in TIMOB-11993.
  6. Bill Dawson 2013-05-07

    FYI, this occurs because we re-layout the view at the end of translate (left/right/top etc) animations, and so when we re-lay-it-out then it loses its transform. And the reason we re-layout is because of *another* bug, namely TIMOB-10042. So we're in a "6 of one, etc" situation here at the moment.
  7. Allen Yeung 2013-07-20

    Resolved as a part of https://github.com/appcelerator/titanium_mobile/pull/4398
  8. Priya Agarwal 2013-10-21

    Verified the fix with: Appc-Studio: 3.2.0.201310181700 Sdk:3.2.0.v20131018154951 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3,iphone5(v7) Xcode: 5 Transform and color does not resets after animation in both iOS and Android.

JSON Source