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


Java DraweeHolder类代码示例

本文整理汇总了Java中com.facebook.drawee.view.DraweeHolder的典型用法代码示例。如果您正苦于以下问题:Java DraweeHolder类的具体用法?Java DraweeHolder怎么用?Java DraweeHolder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DraweeHolder类属于com.facebook.drawee.view包,在下文中一共展示了DraweeHolder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setImageSpan

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
public void setImageSpan(
    DraweeHolder draweeHolder,
    int index,
    final int drawableWidthPx,
    final int drawableHeightPx,
    boolean enableResizing,
    @BetterImageSpan.BetterImageSpanAlignment int verticalAlignment) {
  setImageSpan(
      draweeHolder,
      index,
      index,
      drawableWidthPx,
      drawableHeightPx,
      enableResizing,
      verticalAlignment);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:DraweeSpanStringBuilder.java

示例2: setIconSource

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
private void setIconSource(ReadableMap source, IconControllerListener controllerListener,
                           DraweeHolder holder) {
    String uri = source != null ? source.getString("uri") : null;

    if (uri == null) {
        controllerListener.setIconImageInfo(null);
        controllerListener.setDrawable(null);
    } else if (uri.startsWith("http://") || uri.startsWith("https://") ||
            uri.startsWith("file://")) {
        controllerListener.setIconImageInfo(getIconImageInfo(source));
        DraweeController controller = Fresco.newDraweeControllerBuilder()
                .setUri(Uri.parse(uri))
                .setControllerListener(controllerListener)
                .setOldController(holder.getController())
                .build();
        holder.setController(controller);
        holder.getTopLevelDrawable().setVisible(true, true);
    } else {
        controllerListener.setDrawable(getDrawableByName(uri));
    }
}
 
开发者ID:timomeh,项目名称:react-native-android-bottom-navigation,代码行数:22,代码来源:RNBottomNavigation.java

示例3: FrescoBasedReactTextInlineImageSpan

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
public FrescoBasedReactTextInlineImageSpan(
    Resources resources,
    int height,
    int width,
    @Nullable Uri uri,
    ReadableMap headers,
    AbstractDraweeControllerBuilder draweeControllerBuilder,
    @Nullable Object callerContext) {
  mDraweeHolder = new DraweeHolder(
      GenericDraweeHierarchyBuilder.newInstance(resources)
          .build()
  );
  mDraweeControllerBuilder = draweeControllerBuilder;
  mCallerContext = callerContext;

  mHeight = height;
  mWidth = width;
  mUri = (uri != null) ? uri : Uri.EMPTY;
  mHeaders = headers;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:21,代码来源:FrescoBasedReactTextInlineImageSpan.java

示例4: setIconSource

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
/**
 * Sets an icon for a specific icon source. If the uri indicates an icon
 * to be somewhere remote (http/https) or on the local filesystem, it uses fresco to load it.
 * Otherwise it loads the Drawable from the Resources and directly returns it via a callback
 */
private void setIconSource(ReadableMap source, IconControllerListener controllerListener, DraweeHolder holder) {

  String uri = source != null ? source.getString(PROP_ICON_URI) : null;

  if (uri == null) {
    controllerListener.setIconImageInfo(null);
    controllerListener.setDrawable(null);
  } else if (uri.startsWith("http://") || uri.startsWith("https://") || uri.startsWith("file://")) {
    controllerListener.setIconImageInfo(getIconImageInfo(source));
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setUri(Uri.parse(uri))
            .setControllerListener(controllerListener)
            .setOldController(holder.getController())
            .build();
    holder.setController(controller);
    holder.getTopLevelDrawable().setVisible(true, true);
  } else {
    controllerListener.setDrawable(getDrawableByName(uri));
  }

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

示例5: FrescoBasedReactTextInlineImageSpan

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
public FrescoBasedReactTextInlineImageSpan(
    Resources resources,
    int height,
    int width,
    @Nullable Uri uri,
    AbstractDraweeControllerBuilder draweeControllerBuilder,
    @Nullable Object callerContext) {
  mDraweeHolder = new DraweeHolder(
      GenericDraweeHierarchyBuilder.newInstance(resources)
          .build()
  );
  mDraweeControllerBuilder = draweeControllerBuilder;
  mCallerContext = callerContext;

  mHeight = height;
  mWidth = width;
  mUri = (uri != null) ? uri : Uri.EMPTY;
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:19,代码来源:FrescoBasedReactTextInlineImageSpan.java

示例6: setIconSource

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
/**
 * Sets an icon for a specific icon source. If the uri indicates an icon
 * to be somewhere remote (http/https) or on the local filesystem, it uses fresco to load it.
 * Otherwise it loads the Drawable from the Resources and directly returns it via a callback
 */
private void setIconSource(ReadableMap source, IconControllerListener controllerListener, DraweeHolder holder) {

  String uri = source != null ? source.getString(PROP_ICON_URI) : null;

  if (uri == null) {
    controllerListener.setIconImageInfo(null);
    controllerListener.setDrawable(null);
  } else if (uri.startsWith("http://") || uri.startsWith("https://") || uri.startsWith("file://")) {
    controllerListener.setIconImageInfo(getIconImageInfo(source));
    DraweeController controller = Fresco.newDraweeControllerBuilder()
            .setUri(Uri.parse(uri))
            .setControllerListener(controllerListener)
            .setOldController(holder.getController())
            .build();
    holder.setController(controller);
  } else {
    controllerListener.setDrawable(getDrawableByName(uri));
  }

}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:26,代码来源:ReactToolbar.java

示例7: setIconSource

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
/**
 * Sets an icon for a specific icon source. If the uri indicates an icon
 * to be somewhere remote (http/https) or on the local filesystem, it uses fresco to load it.
 * Otherwise it loads the Drawable from the Resources and directly returns it via a callback
 */
private void setIconSource(ReadableMap source, IconControllerListener controllerListener, DraweeHolder holder) {

  String uri = source != null ? source.getString(PROP_ICON_URI) : null;

  if (uri == null) {
    controllerListener.setIconImageInfo(null);
    controllerListener.setDrawable(null);
  } else if (uri.startsWith("http://") || uri.startsWith("https://") || uri.startsWith("file://")) {
    controllerListener.setIconImageInfo(getIconImageInfo(source));
    DraweeController controller = Fresco.newDraweeControllerBuilder()
        .setUri(Uri.parse(uri))
        .setControllerListener(controllerListener)
        .setOldController(holder.getController())
        .build();
    holder.setController(controller);
    holder.getTopLevelDrawable().setVisible(true, true);
  } else {
    controllerListener.setDrawable(getDrawableByName(uri));
  }

}
 
开发者ID:airbnb,项目名称:native-navigation,代码行数:27,代码来源:ReactToolbar.java

示例8: setIconSource

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
/**
 * Sets an icon for a specific icon source. If the uri indicates an icon
 * to be somewhere remote (http/https) or on the local filesystem, it uses fresco to load it.
 * Otherwise it loads the Drawable from the Resources and directly returns it via a callback
 */
private void setIconSource(ReadableMap source, IconControllerListener controllerListener, DraweeHolder holder) {

  String uri = source != null ? source.getString(PROP_ICON_URI) : null;

  if (uri == null) {
    controllerListener.setIconImageInfo(null);
    controllerListener.setDrawable(null);
  } else if (uri.startsWith("http://") || uri.startsWith("https://") || uri.startsWith("file://")) {
    controllerListener.setIconImageInfo(getIconImageInfo(source));
    DraweeController controller = Fresco.newDraweeControllerBuilder()
        .setUri(Uri.parse(uri))
        .setControllerListener(controllerListener)
        .setOldController(holder.getController())
        .build();
    holder.setController(controller);
    holder.getTopLevelDrawable().setVisible(true, true);
  } else {
    controllerListener.setDrawable(getDrawableByName(uri));
  }
}
 
开发者ID:airbnb,项目名称:native-navigation,代码行数:26,代码来源:ReactBottomNavigation.java

示例9: 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

示例10: 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

示例11: 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

示例12: addDraweeSpan

import com.facebook.drawee.view.DraweeHolder; //导入依赖的package包/类
private static void addDraweeSpan(
    DraweeSpanStringBuilder draweeSpanStringBuilder,
    DraweeHolder draweeHolder,
    int index,
    int spanLength) {
  draweeSpanStringBuilder.setImageSpan(
      draweeHolder, /* draweeHolder */
      index, /* startIndex */
      index + spanLength, /* endIndex */
      DRAWABLE_WIDTH, /* drawableWidthPx */
      DRAWABLE_HEIGHT, /* drawableHeightPx */
      false, /* enableResizing */
      BetterImageSpan.ALIGN_CENTER); /* verticalAlignment */
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:DraweeSpanStringBuilderTest.java

示例13: 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

示例14: 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

示例15: 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


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