Skip to content

Instantly share code, notes, and snippets.

@atsushisakai-gh
Created May 23, 2018 15:54
Show Gist options
  • Save atsushisakai-gh/49490af5232259099ea79004f1b5b756 to your computer and use it in GitHub Desktop.
Save atsushisakai-gh/49490af5232259099ea79004f1b5b756 to your computer and use it in GitHub Desktop.
// v3以前
Glide.with(context)
.loadFromMediaStore(localMedia.getLocalPath())
.asBitmap()
.imageDecoder(new StreamBitmapDecoder(
Downsampler.AT_LEAST,
Glide.get(mContext).getBitmapPool(),
DecodeFormat.PREFER_ARGB_8888
))
.into(imageView);
// v4以降
// optionオブジェクトを構築して…
RequestOptions options = new RequestOptions()
.format(DecodeFormat.PREFER_ARGB_8888)
.downsample(DownsampleStrategy.AT_LEAST);
// applyでoptionsをset
GlideApp.with(context)
.asBitmap()
.load(uri)
.apply(options)
.into(imageView);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment