@Nullable
  @Override
  public View onCreateView(
      LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_vito_scale_type, container, false);

    final ImageUriProvider imageUriProvider = sampleUris();
    final Uri uri1 =
        imageUriProvider.createSampleUri(
            ImageUriProvider.ImageSize.M, ImageUriProvider.Orientation.LANDSCAPE);
    final Uri uri2 =
        imageUriProvider.createSampleUri(
            ImageUriProvider.ImageSize.M, ImageUriProvider.Orientation.PORTRAIT);

    mVitoTop1 = view.findViewById(R.id.image_top_1);
    mVitoTop2 = view.findViewById(R.id.image_top_2);
    mVitoMain = view.findViewById(R.id.image);
    mSpinner = view.findViewById(R.id.spinner);

    VitoView.show(uri1, TOP_IMAGE_OPTIONS, CALLER_CONTEXT, mVitoTop1);
    mVitoTop1.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            changeMainVitoUri(uri1);
          }
        });

    VitoView.show(uri2, TOP_IMAGE_OPTIONS, CALLER_CONTEXT, mVitoTop2);
    mVitoTop2.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            changeMainVitoUri(uri2);
          }
        });

    changeMainVitoUri(uri1);

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

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });
    mSpinner.setSelection(0);

    return view;
  }
Simple Vito fragment that illustrates different scale types
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/vito/VitoScaleTypeFragment.java