@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    final Uri uriSuccess =
        sampleUris()
            .createSampleUri(
                ImageUriProvider.ImageSize.XL,
                ImageUriProvider.Orientation.ANY,
                ImageUriProvider.UriModification.CACHE_BREAKER);
    final Uri uriFailure = sampleUris().getNonExistingUri();

    final ImageView imageView = view.findViewById(R.id.image);

    //noinspection deprecation
    final Drawable failureDrawable = getResources().getDrawable(R.drawable.ic_error_black_96dp);
    DrawableCompat.setTint(failureDrawable, Color.RED);

    final ProgressBarDrawable progressBarDrawable = new ProgressBarDrawable();
    progressBarDrawable.setColor(getResources().getColor(R.color.accent));
    progressBarDrawable.setBackgroundColor(getResources().getColor(R.color.primary));
    progressBarDrawable.setRadius(
        getResources().getDimensionPixelSize(R.dimen.drawee_hierarchy_progress_radius));

    mImageOptions =
        mImageOptions
            .extend()
            .progress(progressBarDrawable)
            .errorDrawable(failureDrawable)
            .errorScaleType(ScaleType.CENTER_INSIDE)
            .build();

    view.findViewById(R.id.load_success)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                setUri(imageView, uriSuccess);
              }
            });

    view.findViewById(R.id.load_fail)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                setUri(imageView, uriFailure);
              }
            });

    view.findViewById(R.id.clear)
        .setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                VitoView.release(imageView);
                Fresco.getImagePipeline().evictFromCache(uriSuccess);
              }
            });

    final SwitchCompat roundCorners = view.findViewById(R.id.switch_rounded);
    roundCorners.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            RoundingOptions roundingOptions = null;
            if (isChecked) {
              roundingOptions =
                  RoundingOptions.forCornerRadiusPx(
                      buttonView
                          .getResources()
                          .getDimensionPixelSize(R.dimen.drawee_hierarchy_corner_radius));
            }
            mImageOptions = mImageOptions.extend().round(roundingOptions).build();
          }
        });

    final SwitchCompat useNinePatch = view.findViewById(R.id.switch_ninepatch);
    useNinePatch.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            mImageOptions =
                mImageOptions
                    .extend()
                    .placeholderRes(isChecked ? R.drawable.ninepatch : R.drawable.logo)
                    .placeholderScaleType(isChecked ? ScaleType.FIT_XY : ScaleType.CENTER_INSIDE)
                    .build();
          }
        });
  }
A {@link Fragment} that illustrates the different drawables one can set for ImageOptions.
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/vito/ImageLayersFragment.java