doAnimationClose(mItemButton1, 0, 5, 300);
doAnimationClose(mItemButton2, 1, 5, 300);
doAnimationClose(mItemButton3, 2, 5, 300);
doAnimationClose(mItemButton4, 3, 5, 300);
doAnimationClose(mItemButton5, 4, 5, 300);
}
private void doAnimationClose(View v, int index, int total, int radius) {
if (v.getVisibility() != View.VISIBLE) {
v.setVisibility(View.VISIBLE);
}
double degree = Math.PI * index / ((total - 1) * 2);
int translationX = (int) -(radius * Math.sin(degree));
int translationY = (int) -(radius * Math.cos(degree));
AnimatorSet set = new AnimatorSet();
set.playTogether(ObjectAnimator.ofFloat(v, “translationX”, translationX, 0),
ObjectAnimator.ofFloat(v, “translationY”, translationY, 0),
ObjectAnimator.ofFloat(v, “scaleX”, 1f, 0f),
ObjectAnimator.ofFloat(v, “scaleY”, 1f, 0f),
ObjectAnimator.ofFloat(v,