Animation of a group of children in a viewing group

I am working on a custom ViewGroup.

This viewing group has a group of children. I need to revive several people and change their position. I understand that Android animations only move the bitmap, not the real object. I tried to move them following various resources, but failed.

What am I doing with ViewGroup:

  • Measuring Children and ViewGroup
  • Put kids on onlayout

What i do next

Use custom animations to move a small subset of children. I use a custom Animation object because I need to move a bunch of Views, and I use translationX for all of them together. Another option that I know is to start a separate Animation on all of them, and the thought of what makes me think that it will not be optimized.

Problem

Species revive, but their real position remains unchanged. Therefore, the next time I try to make the same animation, but with the new coordinates, it does not work. Because their positions are not updated.

What i tried

  • Use onAnimationEndto layouteach of the children in the new left, upper, right and lower position. All eyes have disappeared.
  • onAnimationEnd, reset translationX , . view.setTranslationX(0f)

-, , ?

+4
1

()

+1

Source: https://habr.com/ru/post/1528243/


All Articles