1

I am trying to make the rows of my listview such that clicking on any one expands that row in place and shows extra options. I use an extra layout (let's call it expandView) contained with the row layout (call it rowView) with height set to zero initially and use a valueanimator to expand it to the final height when rowView is clicked.

Problem is, I have no idea what the final height is going to take until the user actually clicks the rowView. So I cannot specify some fixed end value for the animation, nor can I sum up the heights of expandView's children on rowView click since they too return zero when expandView's height is zero.

I really want to avoid hardcoding the height values for expandView or it's children here. Any pointers?

iTwenty
  • 953
  • 8
  • 19

1 Answers1

1

Figured it out. This answer given here helped. I have to call call measure() followed by getMeasuredHeight() to get the final height of my expandView.

Community
  • 1
  • 1
iTwenty
  • 953
  • 8
  • 19