Permalink
Browse files

Fix layout animations for views with a transform

Summary:
Fixes LayoutAnimation when animating the position of a view that has a transform, the animation would start at the wrong position, offset by the transform translation value. I noticed this bug while working on sticky headers using animated in the UIExplorer <ListView> - Paging example.

**Test plan**
Made a simple repro for the bug https://gist.github.com/janicduplessis/eb985dc3accfd5982c77761be692e395 and tested that it fixed it. Also tested that the UIExplorer <ListView> - Paging example with sticky headers worked properly with this fix.
Closes #12140

Differential Revision: D4494389

Pulled By: mkonicek

fbshipit-source-id: dd49cb2db9dd4950e293596fbc773f7d79e8b10a
  • Loading branch information...
janicduplessis authored and facebook-github-bot committed Feb 2, 2017
1 parent 12c4868 commit ee737e7d1c2b60d2226bc9fcab372ce98b5976f1
@@ -21,8 +21,8 @@
public PositionAndSizeAnimation(View view, int x, int y, int width, int height) {
mView = view;
mStartX = view.getX();
mStartY = view.getY();
mStartX = view.getX() - view.getTranslationX();
mStartY = view.getY() - view.getTranslationY();
mStartWidth = view.getWidth();
mStartHeight = view.getHeight();

0 comments on commit ee737e7

Please sign in to comment.