0
に私は今、私はこのクラスを作成しました、Xから0に、右から左にアニメーションで表示サイズを変更したい:右左リサイズアニメーション
public class ResizeAnimationRightToLeft extends Animation {
private View mView;
private float mToHeight;
private float mFromHeight;
private float mToWidth;
private float mFromWidth;
public ResizeAnimationRightToLeft(View v, float fromWidth, float fromHeight, float toWidth, float toHeight) {
mToHeight = toHeight;
mToWidth = toWidth;
mFromHeight = fromHeight;
mFromWidth = fromWidth;
mView = v;
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float height =
(mToHeight - mFromHeight) * interpolatedTime + mFromHeight;
float width = (mToWidth - mFromWidth) * interpolatedTime + mFromWidth;
ViewGroup.LayoutParams p = mView.getLayoutParams();
p.height = (int) height;
p.width = (int) width;
mView.requestLayout();
}
}
私が使用より:
ResizeAnimationRightToLeft scale = new ResizeAnimationRightToLeft(layout, 0, DIM_HEIGHT, DIM_WIDTH, DIM_HEIGHT);
しかし、これは左から右へのビューのサイズを変更する、今私はこれを逆転する方法を理解していない、誰かが私の方法を表示することができますか?
ありがとうございました。