code: private OnPageChangeListener createWizardDialogPageChangeListener(
              @NonNull final WizardDialog wizardDialog) {
          return new OnPageChangeListener() {
  
              @Override
              public void onPageScrolled(final int position, final float positionOffset,
                                         final int positionOffsetPixels) {
  
              }
  
              @Override
              public void onPageSelected(final int position) {
                  int[] colors = getResources().getIntArray(R.array.wizard_dialog_background_colors);
                  BackgroundAnimation backgroundAnimation =
                          new CrossFadeTransitionAnimation.Builder(getActivity()).create();
                  wizardDialog.setBackgroundColor(colors[position], backgroundAnimation);
                  TypedArray backgroundIds =
                          getResources().obtainTypedArray(R.array.wizard_dialog_header_backgrounds);
                  BackgroundAnimation headerBackgroundAnimation =
                          new CircleTransitionAnimation.Builder(getActivity())
                                  .setListener(createHeaderAnimationListener(wizardDialog)).create();
                  wizardDialog.setHeaderBackground(backgroundIds.getResourceId(position, 0),
                          headerBackgroundAnimation);
                  backgroundIds.recycle();
                  TypedArray iconIds =
                          getResources().obtainTypedArray(R.array.wizard_dialog_header_icons);
                  DrawableAnimation headerIconAnimation =
                          new ScaleTransitionAnimation.Builder(getActivity()).create();
                  wizardDialog.setHeaderIcon(iconIds.getResourceId(position, 0), headerIconAnimation);
                  iconIds.recycle();
              }
  
              @Override
              public void onPageScrollStateChanged(final int state) {
  
              }
  
          };
      }
docs: Creates and returns a listener, which allows to change the background color of the wizard
  dialog, when its view pager is scrolled.
  
  @param wizardDialog
  The wizard dialog as an instance of the class {@link WizardDialog}. The wizard dialog
  may not be null
  @return The listener, which has been created, as an instance of the type {@link
  OnPageChangeListener}