Facebook图片加载框架Fresco【2 Gif图片】

//facebook图片加载框架
compile 'com.facebook.fresco:fresco:0.12.0'
//需要用到显示gif图片
compile 'com.facebook.fresco:animated-gif:0.12.0'

public class MainActivity extends AppCompatActivity {    
    @Override    
    protected void onCreate(Bundle savedInstanceState) {        
        super.onCreate(savedInstanceState);        
        setContentView(R.layout.activity_main);        
        init();   
    }    
    private void init() {       
       Uri uriGif = Uri.parse("http://img.hb.aicdn.com/3d0f381c5017acc6a90d8e056fee35f28bcc3db087f09-QucLwn_fw658");        
       DraweeController controller = Fresco.newDraweeControllerBuilder()
                       .setUri(uriGif)
                       .setAutoPlayAnimations(true).build();       
       SimpleDraweeView imageView = (SimpleDraweeView) findViewById(R.id.image_view);        
       imageView.setController(controller);    
    }
}```

![GIF.gif](http://upload-images.jianshu.io/upload_images/1503465-82ef1b36028b162b.gif?imageMogr2/auto-orient/strip)

你可能感兴趣的:(Facebook图片加载框架Fresco【2 Gif图片】)