コード例 #1
0
  private void hideOrDisplayNumpad() {
    if (numpad == null) {
      return;
    }

    if (numpad.getVisibility() == View.VISIBLE) {
      hideNumpad();
    } else {
      dialer.setBackgroundResource(R.drawable.dialer_alt_back);
      if (isAnimationDisabled) {
        numpad.setVisibility(View.VISIBLE);
      } else {
        Animation animation = slideInBottomToTop;
        animation.setAnimationListener(
            new AnimationListener() {
              @Override
              public void onAnimationStart(Animation animation) {}

              @Override
              public void onAnimationRepeat(Animation animation) {}

              @Override
              public void onAnimationEnd(Animation animation) {
                numpad.setVisibility(View.VISIBLE);
                animation.setAnimationListener(null);
              }
            });
        numpad.startAnimation(animation);
      }
    }
  }
コード例 #2
0
  private void hideNumpad() {
    if (numpad == null || numpad.getVisibility() != View.VISIBLE) {
      return;
    }

    dialer.setBackgroundResource(R.drawable.dialer_alt);
    if (isAnimationDisabled) {
      numpad.setVisibility(View.GONE);
    } else {
      Animation animation = slideOutTopToBottom;
      animation.setAnimationListener(
          new AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {}

            @Override
            public void onAnimationRepeat(Animation animation) {}

            @Override
            public void onAnimationEnd(Animation animation) {
              numpad.setVisibility(View.GONE);
              animation.setAnimationListener(null);
            }
          });
      numpad.startAnimation(animation);
    }
  }