michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.animation; michael@0: michael@0: import android.view.View; michael@0: import android.view.animation.Animation; michael@0: import android.view.animation.Transformation; michael@0: michael@0: public class HeightChangeAnimation extends Animation { michael@0: int mFromHeight; michael@0: int mToHeight; michael@0: View mView; michael@0: michael@0: public HeightChangeAnimation(View view, int fromHeight, int toHeight) { michael@0: mView = view; michael@0: mFromHeight = fromHeight; michael@0: mToHeight = toHeight; michael@0: } michael@0: michael@0: @Override michael@0: protected void applyTransformation(float interpolatedTime, Transformation t) { michael@0: mView.getLayoutParams().height = Math.round((mFromHeight * (1 - interpolatedTime)) + (mToHeight * interpolatedTime)); michael@0: mView.requestLayout(); michael@0: } michael@0: }