当前位置: 首页>>代码示例>>Java>>正文


Java DraweeHolder.create方法代码示例

本文整理汇总了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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:DraweeSpanStringBuilder.java

示例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());
    }
}
 
开发者ID:lizubing1992,项目名称:Li-MVPArms,代码行数:19,代码来源:PhotoView.java

示例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());
    }
}
 
开发者ID:haoyunbang,项目名称:HaoCommon,代码行数:19,代码来源:PhotoView.java

示例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());
}
 
开发者ID:Piasy,项目名称:AndroidPlayground,代码行数:25,代码来源:ShapedDraweeView.java

示例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);
}
 
开发者ID:timomeh,项目名称:react-native-android-bottom-navigation,代码行数:12,代码来源:RNBottomNavigation.java

示例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);
    }
}
 
开发者ID:Loofer,项目名称:Watermark,代码行数:11,代码来源:FrescoImageLoader.java

示例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);
    }
}
 
开发者ID:Bleoo,项目名称:WindowImageView,代码行数:8,代码来源:DrawableController.java

示例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);
    }
  };

}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:30,代码来源:ReactToolbar.java

示例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);
}
 
开发者ID:airbnb,项目名称:native-navigation,代码行数:8,代码来源:ReactToolbar.java

示例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);
}
 
开发者ID:airbnb,项目名称:native-navigation,代码行数:11,代码来源:ReactBottomNavigation.java

示例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);
}
 
开发者ID:YuanPengandy,项目名称:GalleryFinal-master,代码行数:36,代码来源:FrescoImageLoader.java

示例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();
}
 
开发者ID:laoqiu,项目名称:react-native-amap,代码行数:9,代码来源:AMapMarker.java

示例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());
	}
}
 
开发者ID:iflove,项目名称:gank-examples,代码行数:9,代码来源:MyPhotoView.java

示例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());
  }
}
 
开发者ID:zfdang,项目名称:zSMTH-Android,代码行数:9,代码来源:MyPhotoView.java

示例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);
    }
 
开发者ID:yangxlei,项目名称:wechat-gallery,代码行数:38,代码来源:FrescoImageLoader.java


注:本文中的com.facebook.drawee.view.DraweeHolder.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。