本文整理汇总了Java中com.zzhoujay.richtext.ImageHolder.isGif方法的典型用法代码示例。如果您正苦于以下问题:Java ImageHolder.isGif方法的具体用法?Java ImageHolder.isGif怎么用?Java ImageHolder.isGif使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.zzhoujay.richtext.ImageHolder
的用法示例。
在下文中一共展示了ImageHolder.isGif方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import com.zzhoujay.richtext.ImageHolder; //导入方法依赖的package包/类
public ImageWrapper decode(ImageHolder holder, T t, BitmapFactory.Options options) {
if (holder.isAutoPlay() && (holder.isGif() || isGif(t, options))) {
holder.setIsGif(true);
return decodeAsGif(t, options);
} else {
return decodeAsBitmap(t, options);
}
}
示例2: decode
import com.zzhoujay.richtext.ImageHolder; //导入方法依赖的package包/类
ImageWrapper decode(ImageHolder holder, T t, BitmapFactory.Options options) {
if (holder.isAutoPlay() && (holder.isGif() || isGif(t, options))) {
holder.setIsGif(true);
return decodeAsGif(t, options);
} else {
return decodeAsBitmap(t, options);
}
}
示例3: getDrawable
import com.zzhoujay.richtext.ImageHolder; //导入方法依赖的package包/类
@Override
public Drawable getDrawable(ImageHolder holder, final RichTextConfig config, TextView textView) {
final ImageTarget target;
final GenericRequestBuilder load;
DrawableTypeRequest dtr;
DrawableWrapper drawableWrapper = new DrawableWrapper();
byte[] src = Base64.decode(holder.getSource());
if (src != null) {
dtr = Glide.with(textView.getContext()).load(src);
} else {
dtr = Glide.with(textView.getContext()).load(holder.getSource());
}
Rect rect = null;
if (config.cacheType >= CacheType.LAYOUT) {
rect = loadCache(holder.getSource());
if (rect != null) {
drawableWrapper.setBounds(rect);
}
} else {
drawableWrapper.setBounds(0, 0, holder.getWidth(), holder.getHeight());
}
if (holder.isGif()) {
target = new ImageTargetGif(textView, drawableWrapper, holder, config, this, rect);
load = dtr.asGif();
} else {
target = new ImageTargetBitmap(textView, drawableWrapper, holder, config, this, rect);
load = dtr.asBitmap().atMost();
}
checkTag(textView);
targets.add(target);
if (!config.resetSize && holder.isInvalidateSize()) {
load.override(holder.getWidth(), holder.getHeight());
}
if (holder.getScaleType() == ImageHolder.ScaleType.CENTER_CROP) {
if (holder.isGif()) {
//noinspection ConstantConditions
((GifTypeRequest) load).centerCrop();
} else {
//noinspection ConstantConditions
((BitmapTypeRequest) load).centerCrop();
}
} else if (holder.getScaleType() == ImageHolder.ScaleType.FIT_CENTER) {
if (holder.isGif()) {
//noinspection ConstantConditions
((GifTypeRequest) load).fitCenter();
} else {
//noinspection ConstantConditions
((BitmapTypeRequest) load).fitCenter();
}
}
textView.post(new Runnable() {
@Override
public void run() {
load.placeholder(config.placeHolder).error(config.errorImage).into(target);
}
});
drawableWrapper.setCallback(textView);
return drawableWrapper;
}