コード例 #1
0
  private void hide(final View view) {
    ViewPropertyAnimator animator =
        view.animate()
            .translationY(view.getHeight())
            .setInterpolator(INTERPOLATOR)
            .setDuration(200);
    animator.setListener(
        new Animator.AnimatorListener() {
          @Override
          public void onAnimationStart(Animator animator) {}

          @Override
          public void onAnimationEnd(Animator animator) {
            view.setVisibility(View.GONE);
          }

          @Override
          public void onAnimationCancel(Animator animator) {
            show(view);
          }

          @Override
          public void onAnimationRepeat(Animator animator) {}
        });
    animator.start();
  }
コード例 #2
0
  @Override
  public void hideOverlay(final boolean closeShortcutWindow) {
    ViewPropertyAnimator animator =
        mOverlay
            .animate()
            .setDuration(AppConstant.Anim.ANIM_DURATION_NORMAL)
            .translationX(mInitialOverlayTranslationX)
            .setInterpolator(new AccelerateInterpolator());
    animator.setListener(
        new Animator.AnimatorListener() {
          @Override
          public void onAnimationStart(Animator animation) {}

          @Override
          public void onAnimationEnd(Animator animation) {
            mGestureOverLay.setVisibility(GONE);
            EventBus.getDefault().post(new EventToKnob(EventToKnob.END_STATE_RIGHT));
            if (closeShortcutWindow) {
              startCloseAnim();
            }
          }

          @Override
          public void onAnimationCancel(Animator animation) {}

          @Override
          public void onAnimationRepeat(Animator animation) {}
        });
    animator.start();
  }
コード例 #3
0
  @Override
  public void onBackPressed() {

    for (int i = 0; i < rowContainer.getChildCount(); i++) {

      View rowView = rowContainer.getChildAt(i);
      ViewPropertyAnimator propertyAnimator =
          rowView.animate().setStartDelay(i * SCALE_DELAY).scaleX(0).scaleY(0);

      propertyAnimator.setListener(
          new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animator) {}

            @Override
            public void onAnimationEnd(Animator animator) {

              finishAfterTransition();
            }

            @Override
            public void onAnimationCancel(Animator animator) {}

            @Override
            public void onAnimationRepeat(Animator animator) {}
          });
    }
  }
コード例 #4
0
 public FirstFrameAnimatorHelper(ViewPropertyAnimator vpa, View target) {
   mTarget = target;
   vpa.setListener(this);
 }