@Override
        public void onFrameDrawn(
            BitmapAnimationBackend backend,
            int frameNumber,
            @BitmapAnimationBackend.FrameType int frameType) {
          FrameInformationHolder previousFrame = mFrameInfoMap.get(mActiveFrameNumber);
          if (previousFrame != null) {
            previousFrame.setFrameType(false, frameType);
          }
          mActiveFrameNumber = frameNumber;
          FrameInformationHolder activeFrame = mFrameInfoMap.get(frameNumber);
          if (activeFrame != null) {
            activeFrame.setFrameType(true, frameType);
          }
        }
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