Java Code Examples for com.facebook.drawee.view.DraweeView#setHierarchy()

The following examples show how to use com.facebook.drawee.view.DraweeView#setHierarchy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FrescoUtils.java    From materialup with Apache License 2.0 5 votes vote down vote up
public static final void setShotHierarchy(Context context, DraweeView view, ScalingUtils.ScaleType type, int bg) {
    final Resources res = context.getResources();
    final int color = ThemeUtil.getThemeColor(context, R.attr.colorAccent);
    final ProgressBarDrawable progress = new ProgressBarDrawable();
    progress.setBackgroundColor(Color.parseColor("#33000000"));
    progress.setColor(color);
    GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder(res)
            .setPlaceholderImage(res.getDrawable(R.drawable.ic_holder))
            .setProgressBarImage(progress)
            .setBackground(new ColorDrawable(bg))
            .setActualImageScaleType(type)
            .build();
    view.setHierarchy(gdh);
}
 
Example 2
Source File: FrescoUtils.java    From droidddle with Apache License 2.0 5 votes vote down vote up
public static final void setShotHierarchy(Context context, DraweeView view, ScalingUtils.ScaleType type) {
    final Resources res = context.getResources();
    final int color = ThemeUtil.getThemeColor(context, R.attr.colorAccent);
    final ProgressBarDrawable progress = new ProgressBarDrawable();
    progress.setBackgroundColor(Color.parseColor("#33000000"));
    progress.setColor(color);
    GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder(res)
            .setPlaceholderImage(res.getDrawable(R.drawable.placeholder))
            .setProgressBarImage(progress)
            .setActualImageScaleType(type)
            .build();
    view.setHierarchy(gdh);
}