@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    findImages(view);
    initColors();

    final Spinner scaleType = view.findViewById(R.id.scaleType);
    final SimpleScaleTypeAdapter scaleTypeAdapter = SimpleScaleTypeAdapter.createForAllScaleTypes();
    scaleType.setAdapter(scaleTypeAdapter);
    scaleType.setOnItemSelectedListener(
        new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            final SimpleScaleTypeAdapter.Entry spinnerEntry =
                (SimpleScaleTypeAdapter.Entry) scaleTypeAdapter.getItem(position);
            changeImageScaleType(spinnerEntry.scaleType, spinnerEntry.focusPoint);
          }

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });

    mShowBordersCheck = view.findViewById(R.id.borders);
    mShowBordersCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            updateRounding();
          }
        });

    mScaleInsideBordersCheck = view.findViewById(R.id.scaleInside);
    mScaleInsideBordersCheck.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            updateRounding();
          }
        });

    final ImageUriProvider imageUriProvider = sampleUris();
    mImageSource = ImageSourceProvider.forUri(imageUriProvider.createSampleUri(ImageSize.L));

    int radius =
        (int)
            TypedValue.applyDimension(
                TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());

    mImageRoundOptions = mImageRoundOptions.extend().round(RoundingOptions.asCircle()).build();
    mImageRadiusOptions =
        mImageRadiusOptions.extend().round(RoundingOptions.forCornerRadiusPx(radius)).build();
    mImageSomeOptions =
        mImageSomeOptions
            .extend()
            .round(RoundingOptions.forCornerRadii(radius, 0, radius, 0))
            .build();
    mImageFancyOptions =
        mImageFancyOptions
            .extend()
            .round(
                RoundingOptions.forCornerRadii(
                    getResources()
                        .getDimensionPixelSize(R.dimen.image_rounded_corners_fancy_top_left),
                    getResources()
                        .getDimensionPixelSize(R.dimen.image_rounded_corners_fancy_top_right),
                    getResources()
                        .getDimensionPixelSize(R.dimen.image_rounded_corners_fancy_bottom_right),
                    getResources()
                        .getDimensionPixelSize(R.dimen.image_rounded_corners_fancy_bottom_left)))
            .build();

    loadImages();
  }
A {@link Fragment} that illustrates using rounded corners with Fresco.
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/vito/VitoRoundedCornersFragment.java