Created
November 17, 2016 17:57
-
-
Save muthuraj57/063a52534277cad75511896fe51b7395 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