I want to add a view to a view group using an expanding animation, so the added view starts very small and takes more and more space until it reaches its full size (probably
This might be a little simpler:
public void expand(final View view) {
view.getLayoutParams().height = 0;
Animation a = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t)
{
view.getLayoutParams().height = (int)(mTargetHeight * interpolatedTime);
view.requestLayout();
}
@Override
public boolean willChangeBounds() {
return true;
}
};
a.setDuration(1000);
view.startAnimation(a);
}