Android新动画棒棒糖

时间:2014-11-21 10:23:14

标签: android animation material-design

为什么不动画?我正在使用Nexus 5 Real Not a Emulator。

我的build.gradle

defaultConfig {
    applicationId "es.canada.victor.pomodoro"
    minSdkVersion 14
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

按钮是不可见的

 if (Build.VERSION.SDK_INT >= 21) {
     Utilities.showView(btAcept);
 }

动画方法

   public static void showView(View myView) {

    // get the center for the clipping circle
    int cx = (myView.getLeft() + myView.getRight()) / 2;
    int cy = (myView.getTop() + myView.getBottom()) / 2;

    // get the final radius for the clipping circle
    int finalRadius = Math.max(myView.getWidth(), myView.getHeight());

    // create the animator for this view (the start radius is zero)
    Animator anim =
            ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);

    // make the view visible and start the animation
    myView.setVisibility(View.VISIBLE);
    anim.start();

}

0 个答案:

没有答案