Created
March 12, 2017 04:23
-
-
Save raghunandankavi2010/4e7dbd6dfeed3b05c040e5a24eaa2d3b to your computer and use it in GitHub Desktop.
Loading image via glide
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
@Override | |
public View getView(final int position, View convertView, ViewGroup parent) { | |
final ViewHolder viewHolder; | |
if (convertView == null) { | |
viewHolder = new ViewHolder(); | |
convertView = mLayoutInflater.inflate(R.layout.all_noti_item, parent, false); | |
viewHolder.profilePic = (ImageView) convertView.findViewById(R.id.profilePic); | |
convertView.setTag(viewHolder); | |
}else | |
{ | |
viewHolder = (ViewHolder) convertView.getTag(); | |
} | |
if(feedItems.get(position).getUser_details()!=null) { | |
Glide.with(activity).load(feedItems.get(position).getUser_details().getUser_profile_image()) | |
.bitmapTransform(new CropCircleTransformation(activity)) | |
.placeholder(R.drawable.pod_h) | |
.into(viewHolder.profilePic); | |
}else | |
{ | |
// make sure Glide doesn't load anything into this view until told otherwise | |
Glide.clear(viewHolder.profilePic); | |
// remove the placeholder (optional); read comments below | |
//viewHolder.profilePic.setImageDrawable(null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment