diff --git a/docs/00-index.md b/docs/00-index.md index ccf7806924..98c4689dec 100644 --- a/docs/00-index.md +++ b/docs/00-index.md @@ -9,7 +9,7 @@ next: concepts.html If you just want to download an image and display it, showing a placeholder until it comes, use a [SimpleDraweeView](../javadoc/reference/com/facebook/drawee/view/SimpleDraweeView.html). -Near your application startup, initialize the classes: +Near your application startup and before ```setContentView()```, initialize the Fresco class: ```java Fresco.initialize(context); @@ -21,16 +21,18 @@ In your XML, add a custom namespace to the top-level element: + xmlns:fresco="http://schemas.android.com/apk/res-auto" + android:layout_height="match_parent" + android:layout_width="match_parent"> ``` -Then add the view itself: +Then add the ```SimpleDraweeView``` to the layout: ```xml ``` @@ -38,11 +40,15 @@ Then add the view itself: To show an image, you need only do this: ```java -draweeView.setImageURI("http://site.com/uri"); +SimpleDraweeView draweeView = (SimpleDraweeView)findViewById(R.id.my_image_view); +draweeView.setImageURI("http://frescolib.org/static/fresco-logo.png"); ``` - -and Fresco does the rest. -The placeholder is shown until the image is ready. The image will be downloaded, cached, displayed, and cleared from memory when your view goes off-screen. +add Android's internet permission to the AndroidManifest.xml +```xml + +``` +and Fresco does the rest. +The placeholder is shown until the image is ready. The image will be downloaded, cached, displayed, and cleared from memory when your view goes off-screen.