code: private DialogAnimation createRectangularRevealAnimation(@NonNull final Preference preference) {
          if (shouldUseAnimations()) {
              RecyclerView recyclerView = getListView();
              View view = recyclerView.getChildAt(preference.getOrder() + 1);
              int[] viewLocation = new int[2];
              view.getLocationOnScreen(viewLocation);
              View rootView = getActivity().findViewById(android.R.id.content);
              int[] rootViewLocation = new int[2];
              rootView.getLocationOnScreen(rootViewLocation);
              ActionBar toolbar = ((AppCompatActivity) getActivity()).getSupportActionBar();
              int y = viewLocation[1];
  
              if (!shouldUseFullscreen()) {
                  y -= (rootViewLocation[1] - (toolbar != null ? toolbar.getHeight() : 0));
              }
  
              return new RectangleRevealAnimation.Builder(getActivity()).setWidth(view.getWidth())
                      .setHeight(view.getHeight()).setX(viewLocation[0]).setY(y).create();
          }
  
          return null;
      }
docs: Creates and returns the rectangular reveal animation, which should be used to show or hide
  dialogs.
  
  @param preference
  The preference, which is used to show the dialog, as an instance of the class {@link
  Preference}
  @return The animation, which has been created, as an instance of the type {@link
  DialogAnimation}