private void setupFrameInformationContainer(BitmapAnimationBackend bitmapAnimationBackend) {
    mFrameInformationContainer.removeAllViews();
    LayoutInflater layoutInflater = LayoutInflater.from(getContext());
    for (int i = 0; i < bitmapAnimationBackend.getFrameCount(); i++) {
      FrameInformationHolder frameInformation = createFrameInformation(layoutInflater, i);
      mFrameInfoMap.put(i, frameInformation);
      mFrameInformationContainer.addView(frameInformation.getView());
    }
    bitmapAnimationBackend.setFrameListener(mFrameListener);
  }
Fragment that creates a new {@link AnimatedDrawable2} and a custom bitmap animation backend. In
addition, it displays useful debug information, like cached frames.
samples/animation2/src/main/java/com/facebook/samples/animation2/bitmap/BitmapAnimationDebugFragment.java