Exemplo n.º 1
0
  private void startCloseAnim() {
    int[] wndLoc = FloatWindowManager.parseLocationFromPrefs(getContext());
    mGestureListView.setPivotX(wndLoc[0]);
    mGestureListView.setPivotY(wndLoc[1]);
    mGestureListView
        .animate()
        .scaleY(0.1f)
        .scaleX(0.1f)
        .alpha(0f)
        .setDuration(AppConstant.Anim.ANIM_DURATION_NORMAL)
        .setInterpolator(new DecelerateInterpolator())
        .setListener(
            new Animator.AnimatorListener() {
              @Override
              public void onAnimationStart(Animator animation) {}

              @Override
              public void onAnimationEnd(Animator animation) {
                mOverlayKnobPresenter.onShortcutWindowClosed();
                EventBus.getDefault()
                    .post(new IShortcutWindow.EventToKnob(IShortcutWindow.EventToKnob.WND_CLOSING));
                FloatWindowManager.closeWindow(getContext(), ShortcutWindow.this);
              }

              @Override
              public void onAnimationCancel(Animator animation) {}

              @Override
              public void onAnimationRepeat(Animator animation) {}
            })
        .start();
  }
Exemplo n.º 2
0
  private void startShowAnim() {
    int[] wndLoc = FloatWindowManager.parseLocationFromPrefs(getContext());
    mGestureListView.setScaleY(0.3f);
    mGestureListView.setScaleX(0.3f);
    mGestureListView.setAlpha(0f);

    mGestureListView.setPivotX(wndLoc[0]);
    mGestureListView.setPivotY(wndLoc[1]);
    mGestureListView
        .animate()
        .scaleY(1)
        .scaleX(1)
        .alpha(1f)
        .setDuration(AppConstant.Anim.ANIM_DURATION_NORMAL)
        .setInterpolator(new DecelerateInterpolator())
        .setListener(
            new SimpleAnimatorListener() {
              @Override
              public void onAnimationEnd(Animator animation) {
                mGestureListView.refresh();
              }
            })
        .start();
  }