fresco docs have a problem? 'hierarchy.setPlaceholderImage(R.drawable.placeholderId);' can't find it
I can't find this method. 'hierarchy.setPlaceholderImage(R.drawable.placeholderId);
It is in the GenericDraweeHierarchy class.
mSimpleDraweeView.getHierarchy().setPlaceholderImage(...)
ok!I use GenericDraweeHierarchyBuilder and just find this method setPlaceholderImage(Drawable).
You can specify the placeholder image while building hierarchy:
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(resources)
.setPlaceholderImage(...)
.build()
mDraweeView.setHierarchy(hierarchy);
But, you can also change the placeholder view of the existing hierarchy:
hierarchy.setPlaceholderImage(...);
OR
mDraweeView.getHierarchy().setPlaceholderImage(...);
Note: I suggest that you always use SimpleDraweeView. However, if you are using DraweeView, rather than SimpleDraweeView, make sure that you parametrize your DraweeView.
DraweeView<GenericDraweeHierarchy>
otherwise getHierarchy() won't return GenericDraweeHierarchy, but a more restricted interface DraweeHierarchy. In that case you would have to cast.
// don't do that, this is not safe. parametrize your view instead
((GenericDraweeHierarchy) mDraweeView.getHierarchy()).setPlaceholderImage(...)
@plamenko ok! I get it!