Android View Collapse and Expand Animations
// To animate view slide out public void collapseView(View view) { HeightAnimation heightAnim = new HeightAnimation(view, view.getHeight(), 0 ); heightAnim.setDuration( 500 ); view.startAnimation(heightAnim); } // To animate view slide in public void expandView(View view) { HeightAnimation heightAnim = new HeightAnimation(view, 0 , ( int ) ( 51 * AppDisplayManager. getInstance ().getDeviceDensity())); heightAnim.setDuration( 200 ); view.startAnimation(heightAnim); } public class HeightAnimation extends Animation { protected final int originalHeight ; protected final View view ; protected float perValue ; public HeightAnimation(View view, int fromHeight, int toHeight) { this . view = view; this . originalHeight = fromHeight; this . perValue = (toHeight - fromHeight); } @Override protected void applyTransformation( float interpolatedTime, Transformation t) { view .getLayoutParams(). hei...