code: static int getAnimationResource(int gravity, boolean isInAnimation) {
      if ((gravity & Gravity.TOP) == Gravity.TOP) {
        return isInAnimation ? R.anim.slide_in_top : R.anim.slide_out_top;
      }
      if ((gravity & Gravity.BOTTOM) == Gravity.BOTTOM) {
        return isInAnimation ? R.anim.slide_in_bottom : R.anim.slide_out_bottom;
      }
      if ((gravity & Gravity.CENTER) == Gravity.CENTER) {
        return isInAnimation ? R.anim.fade_in_center : R.anim.fade_out_center;
      }
      return INVALID;
    }
docs: Get default animation resource when not defined by the user
  
  @param gravity       the gravity of the dialog
  @param isInAnimation determine if is in or out animation. true when is is
  @return the id of the animation resource