I used Fresco 0.5.2:
dependencies {
compile 'com.facebook.fresco:fresco:0.5.2'
}
I want to use SimpleDraweeView
to load a gif image from drawable
.
Here is my code:
String path = ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ getResources().getResourcePackageName(R.drawable.default_app) + "/"
+ getResources().getResourceTypeName(R.drawable.default_app) + "/"
+ getResources().getResourceEntryName(R.drawable.default_app);
Uri uri = Uri.parse(path);
simpleDraweeView =(SimpleDraweeView)
this.findViewById(R.id.simple_drawee_view);
ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(uri).build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(imageRequest)
.setAutoPlayAnimations(true)
.build();
simpleDraweeView.setController(controller);
The default_app
is just a jpeg image and it doesn't work.
I used this as the Fresco's documentation mentioned. Is there any problem with the path or code?