Android ViewAnimationUtils-不发生动画

Android ViewAnimationUtils-不发生动画,android,animation,android-animation,android-5.0-lollipop,viewanimator,Android,Animation,Android Animation,Android 5.0 Lollipop,Viewanimator,我正试图使用一个圆形的展示,在点击一个晶圆厂时,以线性布局的方式制作动画 单击后,视图会在一段时间延迟后变为可见,但不会运行可见动画?此外,当功能作为退出动画反转时,视图在动画期间不可见 守则: //Rest of method triggered onClick Above if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ circleReveal(formcontainer,addnewbut

我正试图使用一个圆形的展示,在点击一个晶圆厂时,以线性布局的方式制作动画

单击后,视图会在一段时间延迟后变为可见,但不会运行可见动画?此外,当功能作为退出动画反转时,视图在动画期间不可见

守则:

//Rest of method triggered onClick Above
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
        circleReveal(formcontainer,addnewbutton);
        ObjectAnimator.ofFloat(addnewbutton, "translationY", -heightbutton).start();
    }
}

public void circleReveal(LinearLayout formLayout, FloatingActionButton fab) {

    int cx = (fab.getLeft() + fab.getRight()) / 2;
    int cy = (fab.getTop() + fab.getBottom()) / 2;

    int radius = Math.max(formLayout.getWidth(), formLayout.getHeight());

    Animator reveal = createCircularReveal(formLayout, cx, cy, 0, radius);

    formLayout.setVisibility(View.VISIBLE);
    reveal.setDuration(2000);
    reveal.start();
}
非常感谢您的帮助

[编辑]测试后,我注意到它只是在这个视图上失败了?我尝试过的布局中的所有其他视图都可以正常工作

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/formcontainer"
              android:background="@android:color/white"
              android:layout_width="match_parent"
              android:layout_height="65dp"
              android:orientation="vertical"
              android:baselineAligned="false"
              android:paddingLeft="@dimen/activity_horizontal_margin"
              android:paddingRight="@dimen/activity_horizontal_margin"
              android:gravity="bottom"
              android:layout_marginBottom="0dp"
              android:elevation="4dp"
              android:layout_alignParentBottom="true">


[编辑2]因此,我已经部分解决了这个问题,因为动画现在可以工作了,但只有当中心不是从晶圆厂计算出来时,圆形动画才会相对于视图本身运行。因此,您的中心应该是:

int cx = fab.getWidth() / 2;
int cy = fab.getHeight() / 2;