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

Java GifBitmapWrapper类代码示例

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

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



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

示例1: transcode

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
@Override
public Resource<Drawable> transcode(Resource<GifBitmapWrapper> toTranscode) {
    GifBitmapWrapper gifBitmap = toTranscode.get();
    Resource<Bitmap> bitmapResource = gifBitmap.getBitmapResource();

    final Resource resource;
    final Drawable drawable;
    if (bitmapResource != null) {
        resource = bitmapResource;
        drawable = new BitmapDrawable(resources, bitmapResource.get());
    } else {
        resource = gifBitmap.getGifResource();
        drawable = gifBitmap.getGifResource().get().getDrawable();
    }
    return new DrawableResource(drawable, resource);
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:17,代码来源:GifBitmapDrawableTranscoder.java


示例2: decode

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
@Override
public Resource<GifBitmapWrapper> decode(ImageVideoWrapper imageVideoWrapper, int i, int i1) throws IOException {
    InputStream inputStream = imageVideoWrapper.getStream();
    StringBuffer sb = new StringBuffer();
    byte[] b = new byte[4096];
    boolean findData = false;
    for (int n; (n = inputStream.read(b)) != -1; ) {
        String data = new String(b, 0, n);
        sb.append(data);
        if (findData == false && sb.length() > "data:image/jpeg;base64,".length()) {
            findData = true;
            int index = sb.indexOf(",");
            sb = sb.delete(0, index + 1);
        }
    }
    String result = sb.toString();
    Bitmap bmp = convertBitmap(result);
    if (bmp == null) {
        return null;
    }
    setPhotoData(bmp);
    return getGifBitmapWrapperResource();
}
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:24,代码来源:GlidePhotoData.java


示例3: Glide

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
Glide(Engine engine, RequestQueue requestQueue, MemoryCache memoryCache, BitmapPool bitmapPool,
        Context context) {
    this.engine = engine;
    this.requestQueue = requestQueue;
    this.bitmapPool = bitmapPool;
    this.memoryCache = memoryCache;

    dataLoadProviderFactory = new DataLoadProviderFactory();
    dataLoadProviderFactory.register(InputStream.class, Bitmap.class, new StreamBitmapDataLoadProvider(bitmapPool));

    dataLoadProviderFactory.register(ParcelFileDescriptor.class, Bitmap.class,
            new FileDescriptorBitmapDataLoadProvider(bitmapPool));

    ImageVideoDataLoadProvider imageVideoDataLoadProvider = new ImageVideoDataLoadProvider(bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, Bitmap.class, imageVideoDataLoadProvider);

    GifDataLoadProvider gifDataLoadProvider = new GifDataLoadProvider(context, bitmapPool);
    dataLoadProviderFactory.register(ImageVideoWrapper.class, GifBitmapWrapper.class,
            new ImageVideoGifDataLoadProvider(imageVideoDataLoadProvider, gifDataLoadProvider));

    register(File.class, ParcelFileDescriptor.class, new FileDescriptorFileLoader.Factory());
    register(File.class, InputStream.class, new StreamFileLoader.Factory());
    register(Integer.class, ParcelFileDescriptor.class, new FileDescriptorResourceLoader.Factory());
    register(Integer.class, InputStream.class, new StreamResourceLoader.Factory());
    register(String.class, ParcelFileDescriptor.class, new FileDescriptorStringLoader.Factory());
    register(String.class, InputStream.class, new StreamStringLoader.Factory());
    register(Uri.class, ParcelFileDescriptor.class, new FileDescriptorUriLoader.Factory());
    register(Uri.class, InputStream.class, new StreamUriLoader.Factory());
    register(URL.class, InputStream.class, new StreamUrlLoader.Factory());
    register(GlideUrl.class, InputStream.class, new VolleyUrlLoader.Factory(requestQueue));

    transcoderFactory.register(Bitmap.class, BitmapDrawable.class,
            new BitmapDrawableTranscoder(context.getResources(), bitmapPool));
    transcoderFactory.register(GifBitmapWrapper.class, Drawable.class,
            new GifBitmapDrawableTranscoder(context));
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:37,代码来源:Glide.java


示例4: DrawableTypeRequest

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
DrawableTypeRequest(A model, ModelLoader<A, InputStream> streamModelLoader,
        ModelLoader<A, ParcelFileDescriptor> fileDescriptorModelLoader, Context context, Glide glide) {
    super(context, model,
            buildProvider(glide, streamModelLoader, fileDescriptorModelLoader, GifBitmapWrapper.class, Drawable.class,
                    null), glide);
    this.model = model;
    this.streamModelLoader = streamModelLoader;
    this.fileDescriptorModelLoader = fileDescriptorModelLoader;
    this.context = context;
    this.glide = glide;
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:12,代码来源:DrawableTypeRequest.java


示例5: setPhotoData

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
public void setPhotoData(Bitmap bmp) {
    mBmp = bmp;
    mBitmapResource = new Resource<Bitmap>() {
        @Override
        public Bitmap get() {
            return mBmp;
        }

        @Override
        public int getSize() {
            return mBmp.getByteCount();
        }

        @Override
        public void recycle() {
            if (mBmp != null) {
                mBmp.recycle();
            }
            mBmp = null;
        }
    };
    mGifBitmapWrapper = new GifBitmapWrapper(mBitmapResource, null);
    mGifBitmapWrapperResource = new Resource<GifBitmapWrapper>() {
        @Override
        public GifBitmapWrapper get() {
            return mGifBitmapWrapper;
        }

        @Override
        public int getSize() {
            return mGifBitmapWrapper.getSize();
        }

        @Override
        public void recycle() {
            mGifBitmapWrapper.getBitmapResource().recycle();
        }
    };
}
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:40,代码来源:GlidePhotoData.java


示例6: drawable

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
public static ResourceTranscoder<GifBitmapWrapper, GlideDrawable> drawable(int delay, Context context) {
	return new DelayTranscoder<>(delay, new GifBitmapWrapperDrawableTranscoder(
			new GlideBitmapDrawableTranscoder(context.getResources(), Glide.get(context).getBitmapPool())));
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:5,代码来源:DelayTranscoder.java


示例7: DrawableRequestBuilder

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
DrawableRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, GifBitmapWrapper, Drawable> loadProvider, Glide glide) {
    super(context, model, loadProvider, Drawable.class, glide);
    this.context = context;
    this.glide = glide;
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:7,代码来源:DrawableRequestBuilder.java


示例8: thumbnail

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
@Override
public DrawableRequestBuilder<ModelType> thumbnail(
        GenericRequestBuilder<ModelType, ImageVideoWrapper, GifBitmapWrapper, Drawable> thumbnailRequest) {
    super.thumbnail(thumbnailRequest);
    return this;
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:7,代码来源:DrawableRequestBuilder.java


示例9: transform

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
@Override
public DrawableRequestBuilder<ModelType> transform(
        Transformation<GifBitmapWrapper> transformation) {
    super.transform(transformation);
    return this;
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:7,代码来源:DrawableRequestBuilder.java


示例10: getGifBitmapWrapperResource

import com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapper; //导入依赖的package包/类
public Resource<GifBitmapWrapper> getGifBitmapWrapperResource() {
    return mGifBitmapWrapperResource;
}
 
开发者ID:BioStar2,项目名称:BioStar2Android,代码行数:4,代码来源:GlidePhotoData.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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