code: private void adaptPreviewView() {
          if (previewView != null) {
              if (isPreviewShown()) {
                  previewView.setVisibility(View.VISIBLE);
                  previewView.setLayoutParams(createPreviewLayoutParams());
                  previewLoader.load(getColor(), previewView);
              } else {
                  previewView.setVisibility(View.INVISIBLE);
                  previewView.setImageBitmap(null);
              }
          }
      }
docs: Adapts the view, which is used to show a preview of the preference's color, depending on the
  preference's properties and the currently persisted color.