public void displayDialpad(boolean showDialpad, boolean animate) {
    // If the dialpad is already visible, don't animate in. If it's gone, don't animate out.
    if ((showDialpad && isDialpadVisible()) || (!showDialpad && !isDialpadVisible())) {
      return;
    }
    // We don't do a FragmentTransaction on the hide case because it will be dealt with when
    // the listener is fired after an animation finishes.
    if (!animate) {
      showDialpad(showDialpad);
    } else {
      if (showDialpad) {
        showDialpad(true);
        mDialpadFragment.animateShowDialpad();
      }
      mCallCardFragment.onDialpadVisiblityChange(showDialpad);
      mDialpadFragment.getView().startAnimation(showDialpad ? mSlideIn : mSlideOut);
    }

    InCallPresenter.getInstance().getProximitySensor().onDialpadVisible(showDialpad);
  }