/RippleJump

Jump to new activity with Android L reveal Effect

Primary LanguageJavaApache License 2.0Apache-2.0

RippleJump

Jump to new activity with Android L reveal Effect

  • 实现效果

请输入图片描述

  • 核心代码

      public void startFromLocation(int[] tapLocationOnScreen) {
      changeState(STATE_FILL_STARTED);
      startLocationX = tapLocationOnScreen[0];
      startLocationY = tapLocationOnScreen[1];
      revealAnimator = ObjectAnimator.ofInt(this, "currentRadius", 0,
              getWidth() + getHeight()).setDuration(FILL_TIME);
      revealAnimator.setInterpolator(INTERPOLATOR);
      revealAnimator.addListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
              changeState(STATE_FINISHED);
          }
      });
      revealAnimator.start();
      }