当前位置: 首页>>代码示例>>Java>>正文


Java FitCenter类代码示例

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


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

示例1: createScaledBitmapInto

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
private static <T> Bitmap createScaledBitmapInto(Context context, T model, int width, int height)
    throws BitmapDecodingException
{
  final Bitmap rough = Downsampler.AT_LEAST.decode(getInputStreamForModel(context, model),
                                                   Glide.get(context).getBitmapPool(),
                                                   width, height,
                                                   DecodeFormat.PREFER_RGB_565);

  final Resource<Bitmap> resource = BitmapResource.obtain(rough, Glide.get(context).getBitmapPool());
  final Resource<Bitmap> result   = new FitCenter(context).transform(resource, width, height);

  if (result == null) {
    throw new BitmapDecodingException("unable to transform Bitmap");
  }
  return result.get();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:17,代码来源:BitmapUtil.java

示例2: createScaledBitmapInto

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
private static <T> Bitmap createScaledBitmapInto(Context context, T model,
		int width, int height)
		throws BitmapDecodingException {
	final Bitmap rough = Downsampler.AT_LEAST
			.decode(getInputStreamForModel(context, model),
					Glide.get(context).getBitmapPool(),
					width, height, DecodeFormat.PREFER_RGB_565);

	final Resource<Bitmap> resource = BitmapResource
			.obtain(rough, Glide.get(context).getBitmapPool());
	final Resource<Bitmap> result =
			new FitCenter(context).transform(resource, width, height);

	if (result == null) {
		throw new BitmapDecodingException("unable to transform Bitmap");
	}
	return result.get();
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:19,代码来源:BitmapUtil.java

示例3: convert

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
@Override
protected void convert(BaseBindHolder helper, WeatherDailyResponse.DailyResult.Daily item) {
    ViewDataBinding binding = helper.getBinding();
    binding.setVariable(BR.daily, item);
    binding.executePendingBindings();

    SuperTextView superTextView = helper.getView(R.id.super_item_daily);
    ArmsUtils.INSTANCE.obtainArmsComponent(mContext).imageLoader()
            .loadImage(mContext,
                    ImageConfigImpl.builder()
                            .url(String.format(Locale.CHINESE, Api.API_WEATHER_ICON_URL, item.getCodeDay()))
                            .placeholder(R.mipmap.ic_placeholder)
                            .errorPic(R.mipmap.weather_unknown)
                            .transformation(new FitCenter())
                            .imageView(superTextView.getRightIconIV())
                            .build());
}
 
开发者ID:xiaobailong24,项目名称:MVVMArms,代码行数:18,代码来源:WeatherDailyAdapter.java

示例4: load

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
@Override protected void load(Context context) throws Exception {
	String urlString = "http://web.twisterrob.net/glide/1257_changing.php";
	Glide
			.with(this)
			.load(new ForceLoadGlideUrl(urlString))
			.fitCenter()
			.diskCacheStrategy(DiskCacheStrategy.NONE)
			.skipMemoryCache(true)
			//.placeholder(R.drawable.glide_placeholder)
			//.error(R.drawable.glide_error)
			.listener(new LoggingListener<GlideUrl, GlideDrawable>("full"))
			.thumbnail(Glide
					.with(this)
					.load(new CachedGlideUrl(urlString))
					.diskCacheStrategy(DiskCacheStrategy.NONE)
					.skipMemoryCache(true)
					.listener(new LoggingListener<GlideUrl, GlideDrawable>("thumbnail"))
					.bitmapTransform(new FitCenter(context), new GrayscaleTransformation(context))
					.sizeMultiplier(0.25f)
			)
			.into(imageView);
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:23,代码来源:TestFragment.java

示例5: bind

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
void bind(ChatMessage message) {
	nameView.setText(message.getUserName());
	Context context = avatarView.getContext();
	glide.load(message.getAvatarUrl())
	     .bitmapTransform(new FitCenter(context), new CropCircleTransformation(context))
	     .listener(new LoggingListener<String, GlideDrawable>())
	     .into(avatarView);
	bindEmoticonMessage(messageView, message.getMessage());
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:10,代码来源:HtmlChatAdapter.java

示例6: load

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
@Override protected void load(Context context) throws Exception {
	Glide
			.with(context)
			.load(R.drawable.glide)
			.diskCacheStrategy(DiskCacheStrategy.NONE) // necessary only because I'm loading an APK resource
			.skipMemoryCache(true) // remove in production, this is just there so it's reproducible quickly
			.placeholder(R.drawable.glide_placeholder)
			// delay to see what's going on, in normal usage replace this with .fitCenter()
			.transform(new FitCenter(context), new DelayBitmapTransformation(1000))
			.animate(new PaddingAnimationFactory<>(new DrawableCrossFadeFactory<GlideDrawable>(2000)))
			.into(imageView)
	;
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:14,代码来源:TestFragment.java

示例7: fitCenter

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
public DrawableRequestBuilder<ModelType> fitCenter() {
    return bitmapTransform(new FitCenter(glide.getBitmapPool()));
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:4,代码来源:DrawableRequestBuilder.java

示例8: ImageLoader

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
/**
 * Construct a standard ImageLoader object.
 */
public ImageLoader(Context context) {
    requestManager = Glide.with(context);
    mCenterCrop = new CenterCrop(Glide.get(context).getBitmapPool());
    mFitCenter = new FitCenter(Glide.get(context).getBitmapPool());
}
 
开发者ID:taoliuh,项目名称:v2ex,代码行数:9,代码来源:ImageLoader.java

示例9: optionalFitCenter

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
/**
 * Applies {@link com.bumptech.glide.load.resource.bitmap.FitCenter} to all default types, and
 * ignores unknown types.
 *
 * <p>This will override previous calls to {@link #dontTransform()}.
 *
 * @see #optionalTransform(Class, Transformation)
 * @see #fitCenter()
 */
public RequestOptions optionalFitCenter() {
  return optionalTransform(DownsampleStrategy.FIT_CENTER, new FitCenter());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:RequestOptions.java

示例10: fitCenter

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
/**
 * Applies {@link FitCenter} 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 #optionalFitCenter()
 */
public RequestOptions fitCenter() {
  return transform(DownsampleStrategy.FIT_CENTER, new FitCenter());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:RequestOptions.java

示例11: optionalFitCenter

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
/**
 *
 * Applies {@link FitCenter} and to all default types, {@link DownsampleStrategy#FIT_CENTER} to
 * image types, and ignores unknown types.
 *
 * <p>This will override previous calls to {@link #dontTransform()} and previous calls to
 * {@link #downsample(DownsampleStrategy)}.
 *
 * @see #optionalTransform(Class, Transformation)
 * @see #fitCenter()
 */
@CheckResult
public RequestOptions optionalFitCenter() {
  return optionalScaleOnlyTransform(DownsampleStrategy.FIT_CENTER, new FitCenter());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:RequestOptions.java

示例12: fitCenter

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
/**
 * Applies {@link FitCenter} and to all default types, {@link DownsampleStrategy#FIT_CENTER} to
 * image types, and throws an exception if asked to transform an unknown
 * type.
 *
 * <p>This will override previous calls to {@link #dontTransform()} and previous calls to
 * {@link #downsample(DownsampleStrategy)}.
 *
 * @see #transform(Class, Transformation)
 * @see #optionalFitCenter()
 */
@CheckResult
public RequestOptions fitCenter() {
  return scaleOnlyTransform(DownsampleStrategy.FIT_CENTER, new FitCenter());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:RequestOptions.java

示例13: fitCenter

import com.bumptech.glide.load.resource.bitmap.FitCenter; //导入依赖的package包/类
/**
 * Transform images using {@link FitCenter}.
 *
 * @return This RequestBuilder
 */
public BitmapRequestBuilder<ModelType, TranscodeType> fitCenter() {
    return transform(new FitCenter(bitmapPool));
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:9,代码来源:BitmapRequestBuilder.java


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