• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GenericRequestBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: displayImage

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
public void displayImage(final String uri, final ImageView imageView, int defaultIcon, final DisplayListener listener) {
    GenericRequestBuilder req = Glide.with(imageView.getContext().getApplicationContext()).load(uri).asBitmap().diskCacheStrategy(mDiskCacheStrategy);
    if (defaultIcon > 0) {
        req.placeholder(defaultIcon);
    }
    req.into(new BitmapImageViewTarget(imageView) {
        @Override
        public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
            super.onResourceReady(resource, glideAnimation);
            if (listener != null) {
                listener.onLoadCompleted(uri, imageView, resource);
            }
        }

        @Override
        public void onLoadFailed(Exception e, Drawable errorDrawable) {
            super.onLoadFailed(e, errorDrawable);
            if (listener != null) {
                listener.onLoadFailed(uri, imageView);
            }
        }
    });
}
 
开发者ID:nickyangjun,项目名称:EasyEmoji,代码行数:24,代码来源:ImageLoader.java


示例2: getRequestBuilder

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private static GenericRequestBuilder<GifDecoder, GifDecoder, Bitmap, Bitmap> getRequestBuilder(Context context,
                                                                                               GifDecoder gifDecoder, int width, int height, BitmapPool bitmapPool) {
	GifFrameResourceDecoder frameResourceDecoder = new GifFrameResourceDecoder(bitmapPool);
	GifFrameModelLoader frameLoader = new GifFrameModelLoader();
	Encoder<GifDecoder> sourceEncoder = NullEncoder.get();
	return Glide.with(context)
			.using(frameLoader, GifDecoder.class)
			.load(gifDecoder)
			.as(Bitmap.class)
			.sourceEncoder(sourceEncoder)
			.decoder(frameResourceDecoder)
			.skipMemoryCache(true)
			.diskCacheStrategy(DiskCacheStrategy.NONE)
			.override(width, height);

}
 
开发者ID:ericleong,项目名称:tumblr3d,代码行数:17,代码来源:GifFrameLoader.java


示例3: buildThumbnailGlideRequest

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder buildThumbnailGlideRequest(@NonNull Slide slide, @NonNull MasterSecret masterSecret) {
  @SuppressWarnings("ConstantConditions")
  DrawableRequestBuilder<DecryptableUri> builder = Glide.with(getContext())
                                                        .load(new DecryptableUri(masterSecret, slide.getThumbnailUri()))
                                                        .diskCacheStrategy(DiskCacheStrategy.NONE)
                                                        .crossFade()
                                                        .transform(new RoundedCorners(getContext(), true, radius, backgroundColorHint));

  if (slide.isInProgress()) return builder;
  else                      return builder.error(R.drawable.ic_missing_thumbnail_picture);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:12,代码来源:ThumbnailView.java


示例4: buildPlaceholderGlideRequest

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder buildPlaceholderGlideRequest(Slide slide) {
  return Glide.with(getContext())
              .load(slide.getPlaceholderRes(getContext().getTheme()))
              .asBitmap()
              .diskCacheStrategy(DiskCacheStrategy.NONE)
              .fitCenter();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:8,代码来源:ThumbnailView.java


示例5: applyDimens

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
public static GenericRequestBuilder applyDimens(@NonNull GenericRequestBuilder requestBuilder,
                                                @NonNull GlideTaskParams payload) {
    final Media media = payload.getMedia();
    if (media != null) {
        requestBuilder.override(media.getWidth(), media.getHeight());
    }
    return requestBuilder;
}
 
开发者ID:Tenor-Inc,项目名称:tenor-android-core,代码行数:9,代码来源:GlideLoader.java


示例6: load

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
public static <T extends ImageView> void load(@NonNull final GenericRequestBuilder requestBuilder,
                                              @NonNull final GlideTaskParams<T> payload) {

    if (payload.isThumbnail()) {
        requestBuilder.thumbnail(payload.getThumbnailMultiplier());
    }

    requestBuilder.placeholder(payload.getPlaceholder())
            .into(new GlideDrawableImageViewTarget(payload.getTarget()) {
                @Override
                public void onLoadFailed(Exception e, Drawable errorDrawable) {
                    if (payload.getCurrentRetry() < payload.getMaxRetry()) {
                        payload.incrementCurrentRetry();
                        load(requestBuilder, payload);
                    } else {
                        super.onLoadFailed(e, errorDrawable);
                        payload.getListener().failure(payload.getTarget(), errorDrawable);
                    }
                }

                @Override
                public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
                    super.onResourceReady(resource, animation);
                    payload.getListener().success(payload.getTarget(), resource);
                }
            });
}
 
开发者ID:Tenor-Inc,项目名称:tenor-android-core,代码行数:28,代码来源:GlideLoader.java


示例7: getDrawable

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
@Override public Drawable getDrawable(@NonNull String url) {
    final UrlDrawable urlDrawable = new UrlDrawable();
    if (container != null && container.get() != null) {
        Context context = container.get().getContext();
        final GenericRequestBuilder load = Glide.with(context)
                .load(url)
                .dontAnimate();
        final GlideDrawableTarget target = new GlideDrawableTarget(urlDrawable, container, width);
        load.into(target);
        cachedTargets.add(target);
    }
    return urlDrawable;
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:14,代码来源:DrawableGetter.java


示例8: provideGifRequestBuilder

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
@Singleton
@Provides
GenericRequestBuilder<Media, InputStream, byte[], GifDrawable> provideGifRequestBuilder(
        RequestManager requestManager) {

    return requestManager.using(new MediaLoader(mView), InputStream.class)
            .from(Media.class)
            .as(byte[].class)
            .transcode(new GifDrawableBytesTranscoder(), GifDrawable.class)
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .decoder(new StreamByteArrayResourceDecoder())
            .sourceEncoder(new StreamEncoder())
            .cacheDecoder(new FileToStreamDecoder<>(new StreamByteArrayResourceDecoder()));
}
 
开发者ID:xdtianyu,项目名称:Gallery,代码行数:15,代码来源:ViewerModule.java


示例9: create

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
public static GenericRequestBuilder<Uri, InputStream, SVG, PictureDrawable> create(Context context, Drawable placeholder) {
    return Glide.with(context.getApplicationContext())
            .using(Glide.buildStreamModelLoader(Uri.class, context), InputStream.class)
            .from(Uri.class)
            .as(SVG.class)
            .transcode(new SvgDrawableTranscoder(), PictureDrawable.class)
            .sourceEncoder(new StreamEncoder())
            .cacheDecoder(new FileToStreamDecoder<>(new SvgDecoder()))
            .decoder(new SvgDecoder())
            .placeholder(placeholder)
            .listener(new SvgSoftwareLayerSetter());
}
 
开发者ID:StepicOrg,项目名称:stepik-android,代码行数:13,代码来源:GlideSvgRequestFactory.java


示例10: buildGlideRequest

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder buildGlideRequest(@NonNull Slide slide,
                                                @Nullable MasterSecret masterSecret)
{
  final GenericRequestBuilder builder;
  if (slide.getPart().isPendingPush()) {
    builder = buildPendingGlideRequest(slide);
  } else if (slide.getThumbnailUri() != null) {
    builder = buildThumbnailGlideRequest(slide, masterSecret);
  } else {
    builder = buildPlaceholderGlideRequest(slide);
  }

  return builder.error(R.drawable.ic_missing_thumbnail_picture);
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:15,代码来源:ThumbnailView.java


示例11: buildThumbnailGlideRequest

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder buildThumbnailGlideRequest(Slide slide, MasterSecret masterSecret) {

    final GenericRequestBuilder builder;
    if (slide.isDraft()) builder = buildDraftGlideRequest(slide);
    else                 builder = buildEncryptedPartGlideRequest(slide, masterSecret);
    return builder;
  }
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:8,代码来源:ThumbnailView.java


示例12: buildEncryptedPartGlideRequest

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder buildEncryptedPartGlideRequest(Slide slide, MasterSecret masterSecret) {
  if (masterSecret == null) {
    throw new IllegalStateException("null MasterSecret when loading non-draft thumbnail");
  }

  return  Glide.with(getContext()).load(new DecryptableUri(masterSecret, slide.getThumbnailUri()))
               .transform(new ThumbnailTransform(getContext()));
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:9,代码来源:ThumbnailView.java


示例13: buildThumbnailGlideRequest

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder buildThumbnailGlideRequest(@NonNull Slide slide, @NonNull MasterSecret masterSecret) {
  @SuppressWarnings("ConstantConditions")
  DrawableRequestBuilder<DecryptableUri> builder = Glide.with(getContext()).load(new DecryptableUri(masterSecret, slide.getThumbnailUri()))
                                                                           .crossFade()
                                                                           .transform(new RoundedCorners(getContext(), true, radius, backgroundColorHint));

  if (slide.isInProgress()) return builder;
  else                      return builder.error(R.drawable.ic_missing_thumbnail_picture);
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:10,代码来源:ThumbnailView.java


示例14: provideGifRequestBuilder

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
@Singleton
@Provides
GenericRequestBuilder<GlideUrl, InputStream, byte[], GifDrawable> provideGifRequestBuilder(
        RequestManager requestManager, OkHttpClient okHttpClient) {

    return requestManager.using(new OkHttpUrlLoader(okHttpClient), InputStream.class)
            .from(GlideUrl.class)
            .as(byte[].class)
            .transcode(new GifDrawableBytesTranscoder(), GifDrawable.class)
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .decoder(new StreamByteArrayResourceDecoder())
            .sourceEncoder(new StreamEncoder())
            .cacheDecoder(new FileToStreamDecoder<>(new StreamByteArrayResourceDecoder()));
}
 
开发者ID:kurumi-moe,项目名称:MoeGallery,代码行数:15,代码来源:MainModule.java


示例15: getHeroImage

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
@Bindable
public GenericRequestBuilder getHeroImage() {
    if (mLfmReference != null) {
        Image hero = mLfmReference.getImageBySize(Image.Size.MEGA);

        if (hero != null) {
            return Glide.with(getContext())
                    .load(hero.getUrl())
                    .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                    .centerCrop()
                    .animate(android.R.anim.fade_in);
        }
    }
    return null;
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:16,代码来源:ArtistViewModel.java


示例16: GifFrameLoader

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
GifFrameLoader(FrameCallback callback, GifDecoder gifDecoder, Handler handler,
               GenericRequestBuilder<GifDecoder, GifDecoder, Bitmap, Bitmap>  requestBuilder) {
	if (handler == null) {
		handler = new Handler(Looper.getMainLooper(), new FrameLoaderCallback());
	}
	this.callback = callback;
	this.gifDecoder = gifDecoder;
	this.handler = handler;
	this.requestBuilder = requestBuilder;
}
 
开发者ID:ericleong,项目名称:tumblr3d,代码行数:11,代码来源:GifFrameLoader.java


示例17: glide

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
public GenericRequestBuilder<String, InputStream, ImageWrapper, Drawable> glide() {
    return mRequestBuilder;
}
 
开发者ID:dengyuhan,项目名称:GlidePlus,代码行数:4,代码来源:GlidePlus.java


示例18: LoadCycler

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
public LoadCycler(GenericRequestBuilder<M, ?, ?, T> request, ImageView imageView) {
	this(request, new DrawableImageViewTarget(imageView));
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:4,代码来源:LoadCycler.java


示例19: copy

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private GenericRequestBuilder<M, ?, ?, T> copy(GenericRequestBuilder<M, ?, ?, T> request) {
	return request.clone().dontAnimate().thumbnail(null).listener(null).load(null);
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:4,代码来源:LoadCycler.java


示例20: rotate

import com.bumptech.glide.GenericRequestBuilder; //导入依赖的package包/类
private void rotate() {
	GenericRequestBuilder<M, ?, ?, T> temp = prev;
	prev = curr;
	curr = next;
	next = temp;
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:7,代码来源:LoadCycler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Symbol类代码示例发布时间:2022-05-21
下一篇:
Java BarAPI类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap