Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. Glide.with(getApplicationContext())
  2. .load(user.getImageURL())
  3. .thumbnail(Glide.with(getApplicationContext()).load(R.drawable.loading))
  4. .listener(new RequestListener<Drawable>() {
  5. @Override
  6. public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
  7. return false;
  8. }
  9.  
  10. @Override
  11. public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
  12. profilePicture.setBackground(null);
  13. return false;
  14. }
  15. })
  16. .into(profilePicture);
  17.  
  18.  
  19.  
  20. <android.support.v7.widget.CardView
  21. android:id="@+id/cardView"
  22. android:layout_width="wrap_content"
  23. android:layout_height="wrap_content">
  24.  
  25. <ImageView
  26. android:id="@+id/profilePicture"
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent"
  29. android:adjustViewBounds="false"
  30. android:background="@drawable/loadingsmaller"
  31. android:cropToPadding="false"
  32. android:scaleType="centerInside"
  33. android:visibility="visible" />
  34.  
  35. </android.support.v7.widget.CardView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement