@Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            switch (position) {
              case 0:
                mGifDecoder = null;
                break;
              case 1:
                mGifDecoder = new GifDecoder();
                break;
              default:
                throw new IllegalArgumentException("Unknown decoder selected");
            }
            refreshAnimation();
          }
GIF example that illustrates how to display a simple GIF file
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/gif/ImageFormatGifFragment.java