I will try to explain.
I have a ListView with its adapter which defines the method getView (as usual) for retrieving the appearance of the cells. The final appearance of the ListView is the one shown.
As you can see the first arrow is rotated of 180 degrees. It has been rotated with an animation once I clicked on it. If I'd click on it again it would be rotated to the original position again. The rotation of 180 degrees is maintained with the fillAfter parameter of the animation (then it is not fixed definitively once the animation completed).
The problem is the following: when list view is scrolled and the cell with the rotated arrow is brought out and in again the cell's view is loaded again. At this point I need to rotate the arrow again. I have two ways:
- use arrow.setRotation(180f)
- use the same animation used before with the duration set to 0
Both the ways have a problem:
- The rotation is fixed, then when I call the method for rotating the arrow to its original position the arrow is ALREADY on its original position (because of setRotation)
- The rotation is not immediate, then, when the cell is brought out and in again, for an instant it points right and after a moment left
How can I solve this problem? I need to rotate the arrow before of bringing it in again but without fixing its state as rotated of 180 degrees.