@Override
	protected void applyTransformation(float interpolatedTime, Transformation t) {

		super.applyTransformation(interpolatedTime, t);
		if (interpolatedTime < 1.0f) {
			if(mType == EXPAND) {
				mLayoutParams.bottomMargin =  -mEndHeight + (int) (mEndHeight * interpolatedTime);
			} else {
				mLayoutParams.bottomMargin = - (int) (mEndHeight * interpolatedTime);
			}
			Log.d("ExpandCollapseAnimation", "anim height " + mLayoutParams.bottomMargin);
			mAnimatedView.requestLayout();
		} else {
			if(mType == EXPAND) {
				mLayoutParams.bottomMargin = 0;
				mAnimatedView.requestLayout();
			} else {
				mLayoutParams.bottomMargin = -mEndHeight;
				mAnimatedView.setVisibility(View.GONE);
				mAnimatedView.requestLayout();
			}
		}
	}
Initializes expand collapse animation, has two types, collapse (1) and expand (0).
@param view The view to animate
@param type The type of animation: 0 will expand from gone and 0 size to visible and layout size defined in xml.
1 will collapse view and set to gone
library/src/main/java/com/tjerkw/slideexpandable/library/ExpandCollapseAnimation.java