Search in sources :

Example 1 with FrescoHolder

use of com.facebook.samples.comparison.holders.FrescoHolder in project fresco by facebook.

the class FrescoAdapter method onCreateViewHolder.

@Override
public FrescoHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder(getContext().getResources()).setPlaceholderImage(Drawables.sPlaceholderDrawable).setFailureImage(Drawables.sErrorDrawable).setProgressBarImage(new ProgressBarDrawable()).setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER).build();
    final InstrumentedDraweeView instrView = new InstrumentedDraweeView(getContext(), gdh);
    return new FrescoHolder(getContext(), parent, instrView, getPerfListener());
}
Also used : ProgressBarDrawable(com.facebook.drawee.drawable.ProgressBarDrawable) FrescoHolder(com.facebook.samples.comparison.holders.FrescoHolder) GenericDraweeHierarchy(com.facebook.drawee.generic.GenericDraweeHierarchy) GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) InstrumentedDraweeView(com.facebook.samples.comparison.instrumentation.InstrumentedDraweeView)

Aggregations

ProgressBarDrawable (com.facebook.drawee.drawable.ProgressBarDrawable)1 GenericDraweeHierarchy (com.facebook.drawee.generic.GenericDraweeHierarchy)1 GenericDraweeHierarchyBuilder (com.facebook.drawee.generic.GenericDraweeHierarchyBuilder)1 FrescoHolder (com.facebook.samples.comparison.holders.FrescoHolder)1 InstrumentedDraweeView (com.facebook.samples.comparison.instrumentation.InstrumentedDraweeView)1