-
-
Save virendersran01/eaa76b95d3aacb47956a4ff820634ff7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if(circleTheme){ | |
Drawable drawable = ContextCompat.getDrawable(context, R.drawable.circle); | |
placeholder.setBackground(drawable); | |
} else { | |
Drawable drawable = ContextCompat.getDrawable(context, R.drawable.square); | |
placeholder.setBackground(drawable); | |
} | |
placeholder.setText(getInitials()); | |
ViewUtil.setVisibility(avatar, View.GONE); | |
ViewUtil.setVisibility(squareAvatar, View.GONE); | |
Glide.with(context) | |
.load(member.getAvatar()) | |
.asBitmap() | |
.into(new SimpleTarget<Bitmap>() { | |
@Override | |
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) { | |
if(circleTheme){ | |
avatar.setImageBitmap(resource); | |
ViewUtil.setVisibility(avatar, View.VISIBLE); | |
} else { | |
squareAvatar.setImageBitmap(resource); | |
ViewUtil.setVisibility(squareAvatar, View.VISIBLE); | |
} | |
ViewUtil.setVisibility(placeholder, View.GONE); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment