There is a TextView (instead of Buttons ) that are animated - they change position when you click on them, but when you redraw the activity (rotation), everything of course returns to its place. How to save post-animating condition?
Now, after the rotation, the performClick() method with a zero animation duration is called, but this is more like a crutch.
- the variant get and then the set of the X axis came to mind, at least not a crutch, but a cane just - Oleg Kotenko
|
1 answer
To save the position when the screen rotates, you need to save the state to the savedInstanseState, because the activation is simply recreated when you rotate. Briefly about this you can read here http://startandroid.ru/ru/uroki/vse-uroki-spiskom/133-urok-70-onsaveinstancestate-sohranenie-dannyh-activity-pri-povorote-ekrana.html
- all this is already there, in a state with the button state (animated / in the initial position) I call (or not) the performClick () method, well, I ask if there is a way to save the state of the animation itself. Given that this is an ObjectAnimator, then you can record the current (at the time of turning over) time, but this is unnecessary, because it doesn’t visually differ from the lack of such manipulations, especially since it does not solve the problem - you still need to call performClick, and I'm looking for more An elegant way to preserve condition - Oleg Kotenko
|