public void setFrameType(boolean active, @BitmapAnimationBackend.FrameType int frameType) {
      if (!active) {
        mFrameType.setText("");
        mFrameType.setBackgroundColor(mDisabledColor);
        return;
      }
      @ColorInt int frameColor;
      String text;
      switch (frameType) {
        case BitmapAnimationBackend.FRAME_TYPE_CACHED:
          frameColor = mFrameCachedColor;
          text = "cached bitmap";
          break;
        case BitmapAnimationBackend.FRAME_TYPE_CREATED:
          frameColor = mFrameCreatedColor;
          text = "created bitmap";
          break;
        case BitmapAnimationBackend.FRAME_TYPE_REUSED:
          frameColor = mFrameReusedColor;
          text = "reused bitmap";
          break;
        case BitmapAnimationBackend.FRAME_TYPE_FALLBACK:
          frameColor = mFrameFallbackColor;
          text = "fallback frame";
          break;
        case BitmapAnimationBackend.FRAME_TYPE_UNKNOWN:
        default:
          text = "unknown";
          frameColor = mFrameUnknownColor;
      }
      mFrameType.setText(text);
      mFrameType.setBackgroundColor(frameColor);
    }
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