use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class RelativeAdapter method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView userPicture = (ImageView) view.findViewById(R.id.picture);
TextView userName = (TextView) view.findViewById(R.id.primary_text);
TextView userBirthday = (TextView) view.findViewById(R.id.secondary_text);
RelativeLayout shadow = (RelativeLayout) view.findViewById(R.id.item_shadow);
setHolder(view, new PicturePrimarySecondaryTextHolder(userPicture, userName, userBirthday, shadow));
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class GroupAdapter2 method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
PicturePrimarySecondaryTextHolder holder = (PicturePrimarySecondaryTextHolder) getHolder(view);
//holder.getPicture().setImageDrawable(null);
Group group = (Group) data;
holder.getPrimaryText().setText(group.getName());
holder.getSecondaryText().setText(group.getDescription());
if (placeHolder == -1)
placeHolder = AttrUtil.getResourceId(getContext(holder.getPicture()), R.attr.squarePlaceHolderIcon);
String url = FacebookUtil.getImageURLForId(group.getGid());
loadImage(holder.getPicture(), url, placeHolder, data);
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class MemberAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
PicturePrimarySecondaryTextHolder holder = (PicturePrimarySecondaryTextHolder) getHolder(view);
//holder.getPicture().setImageDrawable(null);
Friend friend = (Friend) data;
holder.getPrimaryText().setText(friend.getName());
if (friend.getWork().size() > 0) {
Work work = friend.getWork().get(0);
StringBuilder str = new StringBuilder(work.getEmployer().getName());
if (work.getPosition().getName().length() > 0)
str.append(", ").append(work.getPosition().getName());
holder.getSecondaryText().setText(str);
holder.getSecondaryText().setVisibility(View.VISIBLE);
} else if (friend.getEducation().size() > 0) {
Education education = friend.getEducation().get(0);
StringBuilder str = new StringBuilder(education.getSchool().getName());
if (education.getYear().getName().length() > 0)
str.append(", ").append(education.getYear().getName());
if (education.getConcentration().getName().length() > 0)
str.append(", ").append(education.getConcentration().getName());
holder.getSecondaryText().setText(str);
holder.getSecondaryText().setVisibility(View.VISIBLE);
} else {
holder.getSecondaryText().setVisibility(View.GONE);
}
//FacebookUtil.getProfilePictureURLForId(friend.getUid());
String url = friend.getPic();
loadImage(holder.getPicture(), url, AttrUtil.getResourceId(getContext(view), R.attr.squarePlaceHolderIcon), data);
}
use of com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder in project Klyph by jonathangerbaud.
the class NotificationAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
PicturePrimarySecondaryTextHolder holder = (PicturePrimarySecondaryTextHolder) getHolder(view);
//holder.getPicture().setImageDrawable(null);
Notification notification = (Notification) data;
holder.getPrimaryText().setText(Html.fromHtml(getFormattedHtmlTitle(notification.getTitle_html())));
holder.getSecondaryText().setText(DateUtil.timeAgoInWords(getContext(view), notification.getUpdated_time()));
((ProfileImageView) holder.getPicture()).disableBorder();
loadImage(holder.getPicture(), notification.getSender_pic(), KlyphUtil.getProfilePlaceHolder(view.getContext()), data);
holder.getDivider().setVisibility(notification.mustShowDivider() ? View.VISIBLE : View.GONE);
}
Aggregations