I'm trying to perform a smooth transition (expand/collapse) on my LinearLayout
through Animation
. Here's the code that i'm using for the animation:
Animation anim = new Animation(){
@Override
protected void applyTransformation(float interpolatedTime, Transformation t){
super.applyTransformation(interpolatedTime, t);
layout.getLayoutParams().height = (int)(84*interpolatedTime);
layout.requestLayout();
}
};
The problem is that the expand/collapse animation works fine but the layout itself doesn't appear correctly once the animation is done. That following gray gradient block is how it looks like (instead of a textview and edittext):
Even though i'm calling layout.requestLayout();
but still it doesnt refresh the drawing of layout at each interpolatedTime time. Is there something i'm missing here?
P.S. The reason why i'm using 84 when setting height is because I know the rendered height of my layout and it is statically defined only during the test/debugging process.