8

I'm facing very similar issue as here:

Resizing layouts programmatically (as animation)

and the solution there is great but I need one more feature.

I'd like to animate the resizing from height = 0 to height = WRAP_CONTEN. But have no idea how to measure the wrap content size. So I need somehow detect that I've reached this value or calculate it before resizing. Do you have idea how to do it?

Community
  • 1
  • 1
obrien
  • 476
  • 1
  • 7
  • 14

1 Answers1

7

Not sure if this is exactly what you're looking for, but you could define the layout_ width and height as WRAP_CONTENT in the xml, measure it in your constructor or onCreate, and then resize the layout to your desired size. Holding on to those values, you could return it to the WRAP_CONTENT size in your animation.

Tom Quinn
  • 593
  • 3
  • 14