本文整理汇总了Java中com.facebook.drawee.view.DraweeHolder.create方法的典型用法代码示例。如果您正苦于以下问题:Java DraweeHolder.create方法的具体用法?Java DraweeHolder.create怎么用?Java DraweeHolder.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.drawee.view.DraweeHolder
的用法示例。
在下文中一共展示了DraweeHolder.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setImageSpan
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
public void setImageSpan(
Context context,
DraweeHierarchy draweeHierarchy,
DraweeController draweeController,
int startIndex,
int endIndex,
final int drawableWidthPx,
final int drawableHeightPx,
boolean enableResizing,
@BetterImageSpan.BetterImageSpanAlignment int verticalAlignment) {
DraweeHolder draweeHolder = DraweeHolder.create(draweeHierarchy, context);
draweeHolder.setController(draweeController);
setImageSpan(
draweeHolder,
startIndex,
endIndex,
drawableWidthPx,
drawableHeightPx,
enableResizing,
verticalAlignment);
}
示例2: init
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
protected void init() {
if (null == mAttacher || null == mAttacher.getImageView()) {
mAttacher = new PhotoViewAttacher(this);
}
if (null != mPendingScaleType) {
setScaleType(mPendingScaleType);
mPendingScaleType = null;
}
if (mDraweeHolder == null) {
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(getResources())
.setFadeDuration(500)
.setProgressBarImage(new CustomProgressbarDrawable(this))
.build();
mDraweeHolder = DraweeHolder.create(hierarchy, getContext());
}
}
示例3: init
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
protected void init() {
if (null == mAttacher || null == mAttacher.getImageView()) {
mAttacher = new PhotoViewAttacher(this);
}
if (null != mPendingScaleType) {
setScaleType(mPendingScaleType);
mPendingScaleType = null;
}
if (mDraweeHolder == null) {
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(getResources())
.setFadeDuration(300)
.setProgressBarImage(new CustomProgressbarDrawable(this))
.build();
mDraweeHolder = DraweeHolder.create(hierarchy, getContext());
}
}
示例4: setup
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
private void setup(Context context, AttributeSet attrs, int defStyle) {
if (getScaleType() == ScaleType.FIT_CENTER) {
setScaleType(ScaleType.CENTER_CROP);
}
Drawable placeholder = null;
if (attrs != null) {
TypedArray typedArray =
context.obtainStyledAttributes(attrs, R.styleable.ShapedDrawee, defStyle, 0);
shape = typedArray.getDrawable(R.styleable.ShapedDrawee_maskShape);
placeholder = typedArray.getDrawable(R.styleable.ShapedDrawee_placeholder);
typedArray.recycle();
}
if (shape == null) {
throw new IllegalArgumentException("maskShape must be specified in layout!");
}
GenericDraweeHierarchy hierarchy =
new GenericDraweeHierarchyBuilder(getResources()).setPlaceholderImage(placeholder)
.setPlaceholderImageScaleType(ScalingUtils.ScaleType.CENTER_CROP)
.setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP)
.build();
mDraweeHolder = DraweeHolder.create(hierarchy, getContext());
}
示例5: setMenuItemIcon
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
private void setMenuItemIcon(final MenuItem item, ReadableMap iconSource) {
DraweeHolder<GenericDraweeHierarchy> holder =
DraweeHolder.create(createDraweeHierarchy(), getContext());
ActionIconControllerListener controllerListener =
new ActionIconControllerListener(item, holder);
controllerListener.setIconImageInfo(getIconImageInfo(iconSource));
setIconSource(iconSource, controllerListener, holder);
mActionsHolder.add(holder);
}
示例6: init
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
private void init(Context ctx, Drawable defaultDrawable) {
if (draweeHolder == null) {
Resources resources = ctx.getResources();
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(resources)
.setPlaceholderImage(defaultDrawable)
.setFailureImage(defaultDrawable)
.build();
draweeHolder = DraweeHolder.create(hierarchy, ctx);
}
}
示例7: initDraweeHolder
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
private void initDraweeHolder() {
if (mDraweeHolder == null) {
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(mContext.getResources())
.build();
mDraweeHolder = DraweeHolder.create(hierarchy, mContext);
}
}
示例8: ReactToolbar
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
public ReactToolbar(Context context) {
super(context);
mLogoHolder = DraweeHolder.create(createDraweeHierarchy(), context);
mNavIconHolder = DraweeHolder.create(createDraweeHierarchy(), context);
mOverflowIconHolder = DraweeHolder.create(createDraweeHierarchy(), context);
mLogoControllerListener = new IconControllerListener(mLogoHolder) {
@Override
protected void setDrawable(Drawable d) {
setLogo(d);
}
};
mNavIconControllerListener = new IconControllerListener(mNavIconHolder) {
@Override
protected void setDrawable(Drawable d) {
setNavigationIcon(d);
}
};
mOverflowIconControllerListener = new IconControllerListener(mOverflowIconHolder) {
@Override
protected void setDrawable(Drawable d) {
setOverflowIcon(d);
}
};
}
示例9: ReactToolbar
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
public ReactToolbar(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
mLogoHolder = DraweeHolder.create(createDraweeHierarchy(), context);
mNavIconHolder = DraweeHolder.create(createDraweeHierarchy(), context);
mOverflowIconHolder = DraweeHolder.create(createDraweeHierarchy(), context);
init(context);
}
示例10: setMenuItemIcon
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
public void setMenuItemIcon(final MenuItem item, ReadableMap iconSource) {
DraweeHolder<GenericDraweeHierarchy> holder =
DraweeHolder.create(createDraweeHierarchy(), getContext());
ActionIconControllerListener controllerListener = new ActionIconControllerListener(item, holder);
controllerListener.setIconImageInfo(getIconImageInfo(iconSource));
setIconSource(iconSource, controllerListener, holder);
mItemIconHolders.add(holder);
}
示例11: displayImage
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
@Override
public void displayImage(Activity activity, String path, GFImageView imageView, Drawable defaultDrawable, int width, int height) {
Resources resources = context.getResources();
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(resources)
.setFadeDuration(300)
.setPlaceholderImage(defaultDrawable)
.setFailureImage(defaultDrawable)
.setProgressBarImage(new ProgressBarDrawable())
.build();
final DraweeHolder<GenericDraweeHierarchy> draweeHolder = DraweeHolder.create(hierarchy, context);
imageView.setOnImageViewListener(new GFImageView.OnImageViewListener() {
@Override
public void onDetach() {
draweeHolder.onDetach();
}
@Override
public void onAttach() {
draweeHolder.onAttach();
}
@Override
public boolean verifyDrawable(Drawable dr) {
if (dr == draweeHolder.getHierarchy().getTopLevelDrawable()) {
return true;
}
return false;
}
});
Uri uri = new Uri.Builder()
.scheme(UriUtil.LOCAL_FILE_SCHEME)
.path(path)
.build();
displayImage(uri, new ResizeOptions(width, height), imageView, draweeHolder);
}
示例12: AMapMarker
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
public AMapMarker(Context context) {
super(context);
this.context = context;
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
this.view = inflater.inflate(R.layout.layout_bubble, null);
logoHolder = DraweeHolder.create(createDraweeHierarchy(), context);
logoHolder.onAttach();
}
示例13: selfInit
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
private void selfInit() {
if (mDraweeHolder == null) {
final GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(getResources())
.build();
mDraweeHolder = DraweeHolder.create(hierarchy, getContext());
}
}
示例14: selfInit
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
private void selfInit() {
if (mDraweeHolder == null) {
final GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(getResources()).setProgressBarImage(
new LoadingProgressDrawable(SMTHApplication.getAppContext())).setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER).build();
mDraweeHolder = DraweeHolder.create(hierarchy, getContext());
}
}
示例15: displayImage
import com.facebook.drawee.view.DraweeHolder; //导入方法依赖的package包/类
public void displayImage(Context context, String path, GFImageView imageView, int width, int height) {
Resources resources = context.getResources();
Drawable defaultDrawable = ContextCompat.getDrawable(context, R.drawable.common_crop_image_placeholder);
// imageView.setImageDrawable(defaultDrawable);
imageView.setImageDrawable(null);
GenericDraweeHierarchy hierarchy = new GenericDraweeHierarchyBuilder(resources)
.setFadeDuration(300)
.setPlaceholderImage(defaultDrawable)
.setFailureImage(defaultDrawable)
.setProgressBarImage(new ProgressBarDrawable())
.build();
final DraweeHolder<GenericDraweeHierarchy> draweeHolder = DraweeHolder.create(hierarchy, context);
imageView.setOnImageViewListener(new GFImageView.OnImageViewListener() {
@Override
public void onDetach() {
draweeHolder.onDetach();
}
@Override
public void onAttach() {
draweeHolder.onAttach();
}
@Override
public boolean verifyDrawable(Drawable dr) {
if (dr == draweeHolder.getHierarchy().getTopLevelDrawable()) {
return true;
}
return false;
}
});
Uri uri = new Uri.Builder()
.scheme(UriUtil.LOCAL_FILE_SCHEME)
.path(path)
.build();
displayImage(uri, new ResizeOptions(width, height), imageView, draweeHolder);
}