1

I have been having a lot of trouble lately trying to get my custom ViewGroup to animate (scale/translate animation) independently it's child views. Worth noting is that my custom ViewGroup is visible and not just a container, thus the need to animate it and not only it's children.

I want my ViewGroup to have 2 states, unexpanded and expanded with the former being able to display 1 view and the later being able to display that view in addition to 4 more (total 5).

The animation my ViewGroup uses to enter/exit the expanded state is done and i am very happy with it. Though when adding a View into the ViewGroup it to will expand with the same animation as my ViewGroup which i definitely do not want.

Ok, that was a lot of explaining (hope you understood half of it) but now comes what i want to achieve. I want to control my ViewGroup with one animator and all the child Views with another independent animator.

I have a feeling i am going at this the wrong way so if anyone has something easier/better to suggest than please do.

Thanks!

Emil Sjölander
  • 1,773
  • 4
  • 19
  • 27

1 Answers1

1

I solved my problem by using a ValueAnimator and animating the LayoutParams of my ViewGroup :)

Emil Sjölander
  • 1,773
  • 4
  • 19
  • 27