平移動畫
// ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mTopTx2, View.TRANSLATION_Y,-Measure_Utils.dip2px(getContext(),20),0);
//? ? ? ? ? ? ? ? objectAnimator.setDuration(500);
//? ? ? ? ? ? ? ? objectAnimator.addListener(new AnimatorListenerAdapter() {
//? ? ? ? ? ? ? ? ? ? @Override
//? ? ? ? ? ? ? ? ? ? public void onAnimationEnd(Animator animation) {
//? ? ? ? ? ? ? ? ? ? ? ? super.onAnimationEnd(animation);
//? ? ? ? ? ? ? ? ? ? }
//
//? ? ? ? ? ? ? ? ? ? @Override
//? ? ? ? ? ? ? ? ? ? public void onAnimationStart(Animator animation) {
//? ? ? ? ? ? ? ? ? ? ? ? super.onAnimationStart(animation);
//? ? ? ? ? ? ? ? ? ? ? ? mTopTx2.setVisibility(View.VISIBLE);
//? ? ? ? ? ? ? ? ? ? }
//? ? ? ? ? ? ? ? });
//? ? ? ? ? ? ? ? objectAnimator.start();
//縮放動畫
// 以view中心為縮放點敷钾,由初始狀態(tài)放大兩倍
ScaleAnimation animation =new ScaleAnimation(
1.0f, 1.0f, 0f, 1.0f,
? ? ? ? Animation.ZORDER_BOTTOM, 0.5f, Animation.ZORDER_BOTTOM, 0.5f
);
animation.setDuration(200);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
? ? public void onAnimationStart(Animation animation) {
}
@Override
? ? public void onAnimationEnd(Animation animation) {
mTopTx2.setVisibility(View.VISIBLE);
? ? }
@Override
? ? public void onAnimationRepeat(Animation animation) {
}
});
? ? mTopTx2.startAnimation(animation);