code: public final boolean showAnimated(@Nullable final DialogAnimation animation,
                                        @Nullable final AnimatorListener listener) {
          hidden = false;
  
          if (animation != null) {
              Window window = getWindow();
              View view = getRootView();
  
              if (view != null && window != null) {
                  View animatedView = getDialog().isFullscreen() ? window.getDecorView() : view;
  
                  if (animation instanceof FadeAnimation) {
                      FadeAnimation fadeAnimation = (FadeAnimation) animation;
                      ViewPropertyAnimator animator =
                              createAnimator(animatedView, fadeAnimation, listener, true);
  
                      if (animator != null) {
                          animator.start();
                          return true;
                      }
                  } else if (animation instanceof RectangleRevealAnimation) {
                      RectangleRevealAnimation rectangleRevealAnimation =
                              (RectangleRevealAnimation) animation;
                      ViewPropertyAnimator animator =
                              createAnimator(animatedView, rectangleRevealAnimation, listener);
  
                      if (animator != null) {
                          configureShowAnimator(animatedView, rectangleRevealAnimation, animator);
                          animator.start();
                          return true;
                      }
                  } else if (animation instanceof CircleRevealAnimation) {
                      CircleRevealAnimation circleRevealAnimation = (CircleRevealAnimation) animation;
                      Animator animator = createAnimator(window.getDecorView(), animatedView,
                              circleRevealAnimation, listener, true);
  
                      if (animator != null) {
                          animator.start();
                          return true;
                      }
                  } else {
                      throw new RuntimeException(
                              "Unknown type of animation: " + animation.getClass().getSimpleName());
                  }
              }
          }
  
          return false;
      }
docs: Shows the dialog in an animated manner, according to a specific animation.
  
  @param animation
  The animation, which should be used, as an instance of the class {@link
  DialogAnimation} or null, if no animation should be used
  @param listener
  The listener, which should be notified about the animation's events, as an instance
  of the type {@link AnimatorListener} or null, if no listener should be notified
  @return True, if the dialog has been shown in an animated manner, false otherwise