2

In my app a user can animate a view (fragment) on another view. A simple ObjectAnimator does its tranlateY trick and after the animation is complete the view is visible with TextViews and EditTexts.

But when pressing an EditText the keyboard shows and for some reason my view, which was animated with ObjectAnimator, returns to its pre animated position. First I thought it was because the view gets redrawn (like orientation change) so I added "setRetainInstance(true);" but that doesn't work either.

How can I fix this problem?

Mark Molina
  • 5,057
  • 8
  • 41
  • 69

1 Answers1

0

Can you essentially reverse the way the animation is done. Instead of initializing the graphic at it's starting location and having it move to a final location. Have it initialize at the the final location and then have the animation key frame it from the beginning to the end. I think this would be a better solution because I don't think that the Animation actually changes the layout but simply animates it.

Hope this helps!

JKuz
  • 23
  • 3
  • Thanks but according to the docs ObjectAnimator does change the position of views so it wouldn't really matter would it? – Mark Molina Jun 18 '14 at 13:11
  • Yeah I think you're right. Whenever I do animations I do it the way I described but I don't animate too much so maybe I should be quiet on the matter. Haha. I'd be interested to see some of your code so I could try it out and see if I get the problem. – JKuz Jun 19 '14 at 14:01