本文整理汇总了Java中com.facebook.drawee.view.DraweeView.setHierarchy方法的典型用法代码示例。如果您正苦于以下问题:Java DraweeView.setHierarchy方法的具体用法?Java DraweeView.setHierarchy怎么用?Java DraweeView.setHierarchy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.drawee.view.DraweeView
的用法示例。
在下文中一共展示了DraweeView.setHierarchy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDefaultHierarchy
import com.facebook.drawee.view.DraweeView; //导入方法依赖的package包/类
public void setDefaultHierarchy(DraweeView draweeView, Drawable defaultDrawable, ScalingUtils.ScaleType defaultScaleType, ScalingUtils.ScaleType targerScaleType, boolean isCircle) {
GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder( mContext.getResources())
.setPlaceholderImage(defaultDrawable, defaultScaleType)
.setFailureImage(defaultDrawable, ScalingUtils.ScaleType.CENTER_CROP)
// .setProgressBarImage(new ProgressBarDrawable())
.setActualImageScaleType(targerScaleType)
.build();
if ( isCircle ) {
gdh.setRoundingParams(RoundingParams.asCircle());
}
draweeView.setHierarchy(gdh);
}
示例2: setShotHierarchy
import com.facebook.drawee.view.DraweeView; //导入方法依赖的package包/类
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);
}
示例3: setShotHierarchy
import com.facebook.drawee.view.DraweeView; //导入方法依赖的package包/类
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);
}