用ObjectorAnimator实现的,但点击实现子view的动画效果消失后,再点击主Button就不能显示了
设置了点击子view后的setAlpha和Visibility都不行,怎么点主button都不能在显示子view了,请教是怎么回事:
case R.id.id_imgb://点击子view,让其放大消失,其它view缩小消失
setSelected(arg0.getId());
//让被点击的view放大消失,其它view缩小消失
private void setSelected(int viewId)
{
ObjectAnimator animator;
ObjectAnimator animator1;
for (int i = 1; i < childs.size(); i++)
{
if ((childs.get(i)).getId() == viewId)
{
animator = ObjectAnimator.ofFloat(childs.get(i), View.SCALE_X,
1.0f, 3.0f).setDuration(300);
animator1 = ObjectAnimator.ofFloat(childs.get(i), View.SCALE_Y,
1.0f, 3.0f).setDuration(300);
} else
{
animator = ObjectAnimator.ofFloat(childs.get(i), View.SCALE_X,
1.0f, 0).setDuration(300);
animator1 = ObjectAnimator.ofFloat(childs.get(i), View.SCALE_Y,
1.0f, 0).setDuration(300);
}
ObjectAnimator animator2 = ObjectAnimator.ofFloat(childs.get(i),
View.ALPHA, 1.0f, 0).setDuration(300);
AnimatorSet set = new AnimatorSet();
set.playTogether(animator, animator1, animator2);
set.start();