Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Glide.with(getApplicationContext())
- .load(user.getImageURL())
- .thumbnail(Glide.with(getApplicationContext()).load(R.drawable.loading))
- .listener(new RequestListener<Drawable>() {
- @Override
- public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
- return false;
- }
- @Override
- public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
- profilePicture.setBackground(null);
- return false;
- }
- })
- .into(profilePicture);
- <android.support.v7.widget.CardView
- android:id="@+id/cardView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <ImageView
- android:id="@+id/profilePicture"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:adjustViewBounds="false"
- android:background="@drawable/loadingsmaller"
- android:cropToPadding="false"
- android:scaleType="centerInside"
- android:visibility="visible" />
- </android.support.v7.widget.CardView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement