Created
May 23, 2018 15:54
-
-
Save atsushisakai-gh/49490af5232259099ea79004f1b5b756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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