com.bumptech.glide.load.MultiTransformation Java Examples
The following examples show how to use
com.bumptech.glide.load.MultiTransformation.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ScheduleNewAdapter.java From AcgClub with MIT License | 6 votes |
@Override protected void convert(BaseViewHolder helper, ScheduleNewItem item) { helper.setText(R.id.schedule_new_title, item.getTitle()) .setText(R.id.schedule_new_spot, item.getSpot()) .setText(R.id.schedule_new_type, item.getType()) .setText(R.id.schedule_new_desc, item.getDesc()); mImageLoader.loadImage(getContext(), GlideImageConfig .builder() .url(item.getImgUrl()) .transformation( new MultiTransformation<>(new CenterCrop(), new RoundedCornersTransformation(DimenUtils.dpToPx(getContext(), 4), 0))) .imageView((ImageView) helper.getView(R.id.schedule_new_img)) .build() ); }
Example #2
Source File: ImageLoadUtils.java From Tok-Android with GNU General Public License v3.0 | 5 votes |
public static void loadVideoMask(Context context, String path, ImageView imgView, int maskResId) { LogUtil.i(TAG, "loadMask video path:" + path); Glide.with(context) .setDefaultRequestOptions(getVideoOptions()) .load(path) .apply(RequestOptions.bitmapTransform( new MultiTransformation<>(new CenterCrop(), new MaskTransformation(maskResId)))) .thumbnail(THUMB_NAIL) .into(imgView); }
Example #3
Source File: ImageLoadUtils.java From Tok-Android with GNU General Public License v3.0 | 5 votes |
public static void loadMask(Context context, String path, ImageView imgView, int maskResId) { LogUtil.i(TAG, "loadMask path:" + path); Glide.with(context) .setDefaultRequestOptions(getOptions()) .load(path) .apply(RequestOptions.bitmapTransform( new MultiTransformation<>(new CenterCrop(), new MaskTransformation(maskResId)))) .thumbnail(THUMB_NAIL) .into(imgView); }
Example #4
Source File: ImageLoadUtils.java From Tok-Android with GNU General Public License v3.0 | 5 votes |
public static void loadRoundImg(Context context, int imgResId, ImageView imgView) { LogUtil.i(TAG, "loadMask imgResId:"); Glide.with(context) .setDefaultRequestOptions(getPortraitOptions()) .load(imgResId) .apply(RequestOptions.bitmapTransform(new MultiTransformation<>(new CenterCrop(), new RoundedCornersTransformation(ScreenUtils.dp2px(context, 4), 0)))) .thumbnail(THUMB_NAIL) .into(imgView); }
Example #5
Source File: Camera1Fragment.java From mollyim-android with GNU General Public License v3.0 | 5 votes |
private void onCaptureClicked() { orderEnforcer.reset(); Stopwatch fastCaptureTimer = new Stopwatch("Capture"); camera.capture((jpegData, frontFacing) -> { fastCaptureTimer.split("captured"); Transformation<Bitmap> transformation = frontFacing ? new MultiTransformation<>(new CenterCrop(), new FlipTransformation()) : new CenterCrop(); GlideApp.with(this) .asBitmap() .load(jpegData) .transform(transformation) .override(cameraPreview.getWidth(), cameraPreview.getHeight()) .into(new SimpleTarget<Bitmap>() { @Override public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) { fastCaptureTimer.split("transform"); ByteArrayOutputStream stream = new ByteArrayOutputStream(); resource.compress(Bitmap.CompressFormat.JPEG, 80, stream); fastCaptureTimer.split("compressed"); byte[] data = stream.toByteArray(); fastCaptureTimer.split("bytes"); fastCaptureTimer.stop(TAG); controller.onImageCaptured(data, resource.getWidth(), resource.getHeight()); } @Override public void onLoadFailed(@Nullable Drawable errorDrawable) { controller.onCameraError(); } }); }); }
Example #6
Source File: GenericRequestBuilder.java From giffun with Apache License 2.0 | 5 votes |
/** * Transform resources with the given {@link Transformation}s. Replaces any existing transformation or * transformations. * * @param transformations the transformations to apply in order. * @return This request builder. */ public GenericRequestBuilder<ModelType, DataType, ResourceType, TranscodeType> transform( Transformation<ResourceType>... transformations) { isTransformationSet = true; if (transformations.length == 1) { transformation = transformations[0]; } else { transformation = new MultiTransformation<ResourceType>(transformations); } return this; }
Example #7
Source File: ScheduleRecommandAdapter.java From AcgClub with MIT License | 5 votes |
@Override protected void convert(BaseViewHolder helper, ScheduleRecommend item) { helper.setText(R.id.tv_schedule_recommand, item.getName()); mImageLoader.loadImage(getContext(), GlideImageConfig .builder() .url(item.getImgUrl()) .transformation( new MultiTransformation<>(new CenterCrop(), new RoundedCornersTransformation(20, 0))) .imageView((ImageView) helper.getView(R.id.img_schedule_recommand)) .build() ); }
Example #8
Source File: ScheduleCollectionAdapter.java From AcgClub with MIT License | 5 votes |
@Override protected void convert(BaseViewHolder helper, ScheduleCache item) { helper.setText(R.id.tv_schedule_collection_name, item.getName()); mImageLoader.loadImage(getContext(), GlideImageConfig .builder() .url(item.getImgUrl()) .transformation( new MultiTransformation<>(new CenterCrop(), new RoundedCornersTransformation(DimenUtils.dpToPx(getContext(), 4), 0))) .imageView((ImageView) helper.getView(R.id.img_schedule_collection)) .build() ); }
Example #9
Source File: PickerLoader.java From VMLibrary with Apache License 2.0 | 5 votes |
/** * 通过上下文对象加载图片 * * @param context 上下文对象 * @param options 加载配置 * @param imageView 目标控件 */ @Override public void load(Context context, Options options, ImageView imageView) { RequestOptions requestOptions = new RequestOptions(); if (options.isCircle) { requestOptions.circleCrop(); } else if (options.isRadius) { requestOptions.transform(new MultiTransformation<>(new CenterCrop(), new RoundedCorners(options.radiusSize))); } GlideApp.with(context).load(options.url).apply(requestOptions).into(imageView); }
Example #10
Source File: GlideUtil.java From Android-IM with Apache License 2.0 | 5 votes |
/** * 加载圆角封面,默认4dp */ public static void loadCornerPicture(Context context, String imgUrl, ImageView imageView) { Glide.with(context) .load(imgUrl) .apply(new RequestOptions().error(R.drawable.icon_user)) .apply(RequestOptions.bitmapTransform(new MultiTransformation<Bitmap>(new CenterCrop(), new RoundedCornersTransformation(ConvertUtils.dp2px(4), 0)))) .into(imageView); }
Example #11
Source File: GlideUtil.java From Android-IM with Apache License 2.0 | 5 votes |
public static void loadCornerPicture(Context context, String imgUrl, ImageView imageView, int resourceId) { Glide.with(context) .load(imgUrl) .apply(new RequestOptions().error(resourceId)) .apply(RequestOptions.bitmapTransform(new MultiTransformation<Bitmap>(new CenterCrop(), new RoundedCornersTransformation(ConvertUtils.dp2px(4), 0)))) .into(imageView); }
Example #12
Source File: GlideUtil.java From Android-IM with Apache License 2.0 | 5 votes |
public static void loadCornerPicture(Context context, String imgUrl, int cornerRadius, int errorResourceId, ImageView imageView) { Glide.with(context) .load(imgUrl) .apply(new RequestOptions().error(errorResourceId)) .apply(RequestOptions.bitmapTransform(new MultiTransformation<Bitmap>(new CenterCrop(), new RoundedCornersTransformation(ConvertUtils.dp2px(cornerRadius), 0)))) .into(imageView); }
Example #13
Source File: GlideUtil.java From Android-IM with Apache License 2.0 | 5 votes |
/** * 加载自定义封面带圆角 * * @param context 上下文 * @param imgUrl 图片链接 * @param cornerRadius 圆角弧度 * @param imageView view */ public static void loadCornerPicture(Context context, String imgUrl, int cornerRadius, ImageView imageView) { Glide.with(context) .load(imgUrl) .apply(new RequestOptions().error(R.drawable.icon_user)) .apply(RequestOptions.bitmapTransform(new MultiTransformation<Bitmap>(new CenterCrop(), new RoundedCornersTransformation(ConvertUtils.dp2px(cornerRadius), 0)))) .into(imageView); }
Example #14
Source File: GlideLoader.java From XDroidMvp with MIT License | 5 votes |
@Override public void loadCorner(String url, final ImageView target, int radius, Options options) { RequestOptions requestOptions = wrapScaleType(options); //设置图片圆角角度 MultiTransformation multiTransformation = new MultiTransformation<Bitmap>(new CenterCrop(), new RoundedCorners(radius)); requestOptions.transform(multiTransformation); getRequestManager(target.getContext()) .load(url) .apply(requestOptions) .transition(withCrossFade()) .into(target); }
Example #15
Source File: TinderCard.java From Tutorials with Apache License 2.0 | 5 votes |
@Resolve private void onResolved(){ MultiTransformation multi = new MultiTransformation( new BlurTransformation(mContext, 30), new RoundedCornersTransformation( mContext, Utils.dpToPx(7), 0, RoundedCornersTransformation.CornerType.TOP)); Glide.with(mContext).load(mProfile.getImageUrl()) .bitmapTransform(multi) .into(profileImageView); nameAgeTxt.setText(mProfile.getName() + ", " + mProfile.getAge()); locationNameTxt.setText(mProfile.getLocation()); }