• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CircleCrop类的典型用法和代码示例

java 1次浏览

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

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

示例1: testApplyMultiTransform

点赞 2

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
@Test
@SuppressWarnings({"unchecked", "varargs"})
public void testApplyMultiTransform() {
  options.transforms(new CircleCrop(), new CenterCrop());
  assertThat(options.isTransformationRequired()).isTrue();
  assertThat(options.getTransformations()).containsKey(Bitmap.class);
  assertThat(options.getTransformations().get(Bitmap.class))
    .isInstanceOf(MultiTransformation.class);
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:10,
代码来源:RequestOptionsTest.java

示例2: bindView

点赞 2

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
@Override
public void bindView(@NonNull final ForkModel model, @NonNull final ForkViewHolder holder) {
	holder.name.setText(model.getName());

	final RequestOptions options = new RequestOptions();
	options.transform(new MultiTransformation(new BlurTransformation(25), new CircleCrop()));

	Glide.with(getContext())
			.asBitmap()
			.load(model.getAvatarUrl())
			.apply(options)
			.into(holder.avatar);
	holder.itemView.setOnClickListener(view -> mListener.onForkItemClicked(model));
}
 

开发者ID:vivchar,
项目名称:RendererRecyclerViewAdapter,
代码行数:15,
代码来源:ForkViewRenderer.java

示例3: bindView

点赞 2

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
@Override
public void bindView(@NonNull final StargazerModel model, @NonNull final UserViewHolder holder) {
	holder.name.setText(model.getName());

	final RequestOptions options = new RequestOptions();
	options.transform(new MultiTransformation(new BlurTransformation(25), new CircleCrop()));

	Glide.with(getContext())
			.asBitmap()
			.load(model.getAvatarUrl())
			.apply(options)
			.into(holder.avatar);
}
 

开发者ID:vivchar,
项目名称:RendererRecyclerViewAdapter,
代码行数:14,
代码来源:UserViewRenderer.java

示例4: loadCircleImg

点赞 2

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
/**
 * 加载圆形图片
 *
 * @param obj
 * @param iv
 * @param placeholderResource 占位图
 */
public static void loadCircleImg(Object obj, ImageView iv, int placeholderResource) {
    Glide.with(iv.getContext()).load(obj).apply(getRequestOptions()
            .error(placeholderResource)
            .placeholder(placeholderResource)
            .fallback(placeholderResource)
            .dontAnimate()
            .transform(new CircleCrop())).into(iv);
}
 

开发者ID:AriesHoo,
项目名称:TitleBarView,
代码行数:16,
代码来源:GlideManager.java

示例5: loadCircleImg

点赞 2

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
/**
 * 加载圆形图片
 *
 * @param obj
 * @param iv
 * @param placeholder 占位图
 */
public static void loadCircleImg(Object obj, ImageView iv, Drawable placeholder) {
    Glide.with(iv.getContext()).load(obj).apply(getRequestOptions()
            .error(placeholder)
            .placeholder(placeholder)
            .fallback(placeholder)
            .dontAnimate()
            .transform(new CircleCrop())).into(iv);
}
 

开发者ID:AriesHoo,
项目名称:FastLib,
代码行数:16,
代码来源:GlideManager.java

示例6: initUpperInfo

点赞 2

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
private void initUpperInfo(Summary.DataBean data) {
    Summary.DataBean.OwnerBean owner = data.getOwner();
    if (owner != null) {
        ArmsUtils.obtainAppComponentFromContext(_mActivity).imageLoader().loadImage(_mActivity, ImageConfigImpl.builder().url(owner.getFace()).imageView(mIvHeader).transformation(new CircleCrop()).build());
        mTvUpperName.setText(owner.getName());
    }
    Summary.DataBean.OwnerExtBean owner_ext = data.getOwner_ext();
    if (owner_ext != null) {
        mTvFans.setText(TextHandleUtil.handleCount2TenThousand(owner_ext.getFans()) + "人关注");
    }

    // 得到视频相关tag
    tags = data.getTag();
    if (tags != null) {
        // 如果tag数量超过4个,就缩减
        if (tags.size() > 4) {
            newTags = new ArrayList<>();
            Collections.sort(tags);
            for (int i = 0; i < 4; i++) {
                newTags.add(tags.get(i));
            }
            adapter = new MyTagAdapter(newTags);
            isTagShrink = true;
        } else {
            adapter = new MyTagAdapter(tags);
        }
        mTagFlow.setAdapter(adapter);

        // 箭头的点击事件
        changeArrowDown();
        mIvTagShrink.setOnClickListener(v -> {
            if (isTagShrink) {
                // 切换成多的
                if (newTags != null) {
                    adapter = new MyTagAdapter(tags);
                }
                changeArrowUp();
            } else {
                // 切换成少的
                if (newTags != null) {
                    adapter = new MyTagAdapter(newTags);
                }
                changeArrowDown();
            }
            isTagShrink = !isTagShrink;
            if (newTags != null) {
                mTagFlow.setAdapter(adapter);
            }
        });
    }
}
 

开发者ID:GitLqr,
项目名称:LQRBiliBlili,
代码行数:52,
代码来源:SummaryFragment.java

示例7: optionalCircleCrop

点赞 1

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
/**
 * Applies {@link CircleCrop} to all default types, and ignores unknown types.
 *
 * <p>This will override previous calls to {@link #dontTransform()}.
 *
 * @see #optionalTransform(Transformation)
 * @see #circleCrop()
 */
public RequestOptions optionalCircleCrop() {
  return optionalTransform(DownsampleStrategy.CENTER_OUTSIDE, new CircleCrop());
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:12,
代码来源:RequestOptions.java

示例8: circleCrop

点赞 1

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
/**
 * Applies {@link CircleCrop} to all default types and throws an exception if asked to transform
 * an unknown type.
 *
 * <p>This will override previous calls to {@link #dontTransform()}.
 *
 * @see #transform(Class, Transformation)
 * @see #optionalCenterCrop()
 */
public RequestOptions circleCrop() {
  return transform(DownsampleStrategy.CENTER_INSIDE, new CircleCrop());
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:13,
代码来源:RequestOptions.java

示例9: optionalCircleCrop

点赞 1

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
/**
 * Applies {@link CircleCrop} to all default types, and ignores unknown types.
 *
 * <p>This will override previous calls to {@link #dontTransform()}.
 *
 * @see #optionalTransform(Transformation)
 * @see #circleCrop()
 */
@CheckResult
public RequestOptions optionalCircleCrop() {
  return optionalTransform(DownsampleStrategy.CENTER_OUTSIDE, new CircleCrop());
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:13,
代码来源:RequestOptions.java

示例10: circleCrop

点赞 1

import com.bumptech.glide.load.resource.bitmap.CircleCrop; //导入依赖的package包/类
/**
 * Applies {@link CircleCrop} to all default types and throws an exception if asked to transform
 * an unknown type.
 *
 * <p>This will override previous calls to {@link #dontTransform()}.
 *
 * @see #transform(Class, Transformation)
 * @see #optionalCenterCrop()
 */
@CheckResult
public RequestOptions circleCrop() {
  return transform(DownsampleStrategy.CENTER_INSIDE, new CircleCrop());
}
 

开发者ID:weiwenqiang,
项目名称:GitHub,
代码行数:14,
代码来源:RequestOptions.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)