private void initAnimation(View view) {
    mImageView = view.findViewById(R.id.image);
    mImageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    VitoView.show(sampleUris().createKeyframesUri(), IMAGE_OPTIONS, CALLER_CONTEXT, mImageView);

    final SwitchCompat switchBackground = (SwitchCompat) view.findViewById(R.id.switch_background);
    switchBackground.setOnCheckedChangeListener(
        new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            mImageView.setBackground(isChecked ? new CheckerBoardDrawable(getResources()) : null);
          }
        });
  }
Fragment using a ImageView to display a Keyframes animation
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/keyframes/ImageFormatKeyframesFragment.java