Exemplo n.º 1
0
  @Override
  public void onExpanded() {
    AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
    alphaAnimation.setDuration(200);
    alphaAnimation.setAnimationListener(
        new Animation.AnimationListener() {
          @Override
          public void onAnimationStart(Animation animation) {}

          @Override
          public void onAnimationEnd(Animation animation) {
            mStartScanView.setVisibility(View.VISIBLE);
            shouldStartAnim = true;
          }

          @Override
          public void onAnimationRepeat(Animation animation) {}
        });
    mStartScanView.startAnimation(alphaAnimation);
  }
Exemplo n.º 2
0
  @Override
  public void onPullChange(int cur, int max) {
    if (shouldStartAnim) {
      shouldStartAnim = false;
      AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
      alphaAnimation.setDuration(200);
      alphaAnimation.setAnimationListener(
          new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
              mStartScanView.setVisibility(View.INVISIBLE);
            }

            @Override
            public void onAnimationEnd(Animation animation) {}

            @Override
            public void onAnimationRepeat(Animation animation) {}
          });
      mStartScanView.startAnimation(alphaAnimation);
    }
  }