@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    final ImageView imageWebPStatic = view.findViewById(R.id.image_view_webp_static);
    VitoView.show(sampleUris().createWebpStaticUri(), CALLER_CONTEXT, imageWebPStatic);

    final ImageView imageWebPTranslucent = view.findViewById(R.id.image_view_webp_translucent);
    VitoView.show(sampleUris().createWebpTranslucentUri(), CALLER_CONTEXT, imageWebPTranslucent);

    final SwitchCompat switchBackground = view.findViewById(R.id.switch_background);
    switchBackground.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            imageWebPTranslucent.setBackground(
                isChecked ? new CheckerBoardDrawable(getResources()) : null);
          }
        });

    final ImageView imageWebpAnimated = view.findViewById(R.id.image_view_webp_animated);
    VitoView.show(
        sampleUris().createWebpAnimatedUri(), IMAGE_OPTIONS, CALLER_CONTEXT, imageWebpAnimated);

    final TextView supportStatusTextView = view.findViewById(R.id.text_webp_support_status);
    final StringBuilder sb = new StringBuilder();
    sb.append("WebpSupportStatus.sIsSimpleWebpSupported = ")
        .append(WebpSupportStatus.sIsSimpleWebpSupported)
        .append('\n');
    sb.append("WebpSupportStatus.sIsExtendedWebpSupported = ")
        .append(WebpSupportStatus.sIsExtendedWebpSupported)
        .append('\n');
    supportStatusTextView.setText(sb.toString());
  }
This fragment displays different WebP images.

<p>For being able to do this in your applications, you need to add the following dependencies to
your build.gradle file (where X.X.X matches the used Fresco version): - implementation
'com.facebook.fresco:animated-webp:X.X.X' - implementation
'com.facebook.fresco:webpsupport:X.X.X'
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/webp/ImageFormatWebpFragment.java