Slide 1

Slide 1 text

Introduction of the Facebook’s Fresco CyberAgent, Inc. ߱໼ େ஍

Slide 2

Slide 2 text

About Me wasabeef @wasabeef_jp

Slide 3

Slide 3 text

About Fresco • Image Manager • Streaming • Animations • Drawing • Loading

Slide 4

Slide 4 text

Quick Start

Slide 5

Slide 5 text

Adding Fresco to your Project dependencies { // your app's other dependencies compile 'com.facebook.fresco:fresco:0.2.0+' }

Slide 6

Slide 6 text

Adding Fresco to your Project public class MainApplication extends Application { ! @Override public void onCreate() { super.onCreate(); Fresco.initialize(this); } }

Slide 7

Slide 7 text

Adding Fresco to your Project ! !

Slide 8

Slide 8 text

Adding Fresco to your Project public class MainActivity extends ActionBarActivity { ! @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ! SimpleDraweeView drawee = (SimpleDraweeView) findViewById(R.id.image); ! Uri uri = Uri.parse(“http://bit.ly/1PDoTv2"); drawee.setImageURI(uri); } }

Slide 9

Slide 9 text

Supported URIs 5ZQF 4DIFNF 'FUDINFUIPEVTFE 'JMFPOOFUXPSL http://, https:// HttpURLConnection or network layer 'JMFPOEFWJDF pMF 'JMF*OQVU4USFBN $POUFOUQSPWJEFS DPOUFOU $POUFOU3FTPMWFS "TTFUJOBQQ BTTFU "TTFU.BOBHFS 3FTPVSDFJOBQQ SFT 3FTPVSDFTPQFO3BX3FTPVSDF

Slide 10

Slide 10 text

Concepts • DraweeView • DraweeHierarchy • DraweeController • The Image Pipeline

Slide 11

Slide 11 text

Drawee Guide

Slide 12

Slide 12 text

Using Drawees in XML

Slide 13

Slide 13 text

Animated Images • Fresco supports animated GIF and WebP images. • Control of animation

Slide 14

Slide 14 text

Resizing and Rotating public class ResizeOptions { public final int width; public final int height; ! public ResizeOptions(int width, int height) { /** **/ } }

Slide 15

Slide 15 text

Listening to Download Events public interface ControllerListener { void onSubmit(String var1, Object var2); ! void onFinalImageSet(String var1, INFO var2, Animatable var3); ! void onIntermediateImageSet(String var1, INFO var2); ! void onIntermediateImageFailed(String var1, Throwable var2); ! void onFailure(String var1, Throwable var2); ! void onRelease(String var1); }

Slide 16

Slide 16 text

Modifying the Image public interface Postprocessor { void process(Bitmap var1); ! String getName(); } public interface Postprocessor { ! void process(Bitmap var1); ! String getName(); }

Slide 17

Slide 17 text

Image Pipeline Guide

Slide 18

Slide 18 text

Modifying the Image public interface Postprocessor { void process(Bitmap var1); ! String getName(); }

Slide 19

Slide 19 text

Configuring the Image Pipeline • Progressive JPEGs • Configuring the disk cache • Keeping cache stats

Slide 20

Slide 20 text

Third Party Libraries

Slide 21

Slide 21 text

Using Other Network Layers public interface Postprocessor { void process(Bitmap var1); ! String getName(); } dependencies { // your app's other dependencies compile ‘com.facebook.fresco:fresco:0.2.0+’ compile ‘com.facebook.fresco:imagepipeline-okhttp:0.2.0+' }

Slide 22

Slide 22 text

Using Other Image Loaders public interface Postprocessor { void process(Bitmap var1); ! String getName(); } dependencies { // your app's other dependencies compile ‘com.facebook.fresco:fresco:0.2.0+’ compile ‘com.facebook.fresco:drawee-volley:0.2.0+' }

Slide 23

Slide 23 text

Thanks.