Created
April 20, 2016 20:34
-
-
Save madeleine-chercover-hs/f551193fd99d5e65f5c53a581a007b2e to your computer and use it in GitHub Desktop.
Blog Post Code Snippets
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
dependencies { | |
// Your app's other dependencies | |
compile 'com.github.bumptech.glide:glide.3.7.0' | |
compile 'com.android.support:support-v4:23.2.1' | |
} |
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
Imageview imageView = (ImageView) findViewById(R.id.image_view); | |
Glide.with(this).load("https://an-awesome-image.com").into(imageView); |
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
DrawableRequestBuilder drawableRequestBuilder = Glide.with(This | |
.load(url) | |
.fitCenter() | |
.animate(android.R.anim.fade_in); | |
if (mMediaFragmentListener.getLocalVideoUri() != null) { | |
MediaMetadataRetriever retriever = new MediaMetadataRetriever(); | |
Context context = getContext(); | |
retriever.setDataSource(context, mMediaFragmentListener.getLocalVideoUri()); | |
Bitmap frame = retriever.getFrameAtTime(); | |
drawableRequestBuilder.placeholder(new BitmapDrawable(context.getResources(), frame)); | |
} | |
drawableRequestBuilder.into(mThumbnailView); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment