use of com.abewy.android.apps.klyph.adapter.holder.ElementTimelineHolder in project Klyph by jonathangerbaud.
the class GroupTimelineAdapter method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView elementCoverImage = (ImageView) view.findViewById(R.id.element_cover_image);
ImageView elementProfileImage = (ImageView) view.findViewById(R.id.element_profile_image);
TextView elementDetail1 = (TextView) view.findViewById(R.id.element_detail_1);
TextView elementDetail2 = (TextView) view.findViewById(R.id.element_detail_2);
TextView elementDetail3 = (TextView) view.findViewById(R.id.element_detail_3);
TextView elementDetail4 = (TextView) view.findViewById(R.id.element_detail_4);
TextView likes = (TextView) view.findViewById(R.id.likes);
TextView talkAbout = (TextView) view.findViewById(R.id.talk_about);
view.setTag(new ElementTimelineHolder(elementCoverImage, elementProfileImage, elementDetail1, elementDetail2, elementDetail3, elementDetail4, likes, talkAbout));
}
use of com.abewy.android.apps.klyph.adapter.holder.ElementTimelineHolder in project Klyph by jonathangerbaud.
the class GroupTimelineAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, final GraphObject data) {
super.mergeViewWithData(view, data);
ElementTimelineHolder holder = (ElementTimelineHolder) view.getTag();
Group group = (Group) data;
if (placeHolder == -1)
placeHolder = AttrUtil.getResourceId(getContext(holder.getElementCoverImage()), R.attr.squarePlaceHolderIcon);
holder.getElementProfileImage().setVisibility(View.GONE);
// group can have no cover image
String source = group.getPic_cover().getSource();
if (source != null && source.length() > 0) {
GroupCoverImageView groupCoverImageView = (GroupCoverImageView) holder.getElementCoverImage();
groupCoverImageView.setOffset(group.getPic_cover().getOffset_y());
loadImage(holder.getElementCoverImage(), source, placeHolder, true);
} else {
holder.getElementCoverImage().setImageResource(placeHolder);
}
holder.getElementDetail1().setText(group.getDescription());
holder.getElementDetail1().setVisibility(View.VISIBLE);
holder.getElementDetail2().setVisibility(View.GONE);
holder.getElementDetail3().setVisibility(View.GONE);
holder.getElementDetail4().setVisibility(View.GONE);
if (group.getEmail().length() > 0) {
holder.getLikes().setText(group.getEmail());
holder.getLikes().setVisibility(View.VISIBLE);
} else {
holder.getLikes().setVisibility(View.GONE);
}
if (group.getWebsite().length() > 0) {
holder.getTalkAbout().setText(group.getWebsite());
holder.getTalkAbout().setVisibility(View.VISIBLE);
} else {
holder.getTalkAbout().setVisibility(View.GONE);
}
}
use of com.abewy.android.apps.klyph.adapter.holder.ElementTimelineHolder in project Klyph by jonathangerbaud.
the class ElementTimelineAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(final View view, final GraphObject data) {
super.mergeViewWithData(view, data);
Log.d("ElementTimeline", "mergeData");
ElementTimelineHolder holder = (ElementTimelineHolder) view.getTag();
holder.getElementCoverImage().setOnClickListener(null);
holder.getElementProfileImage().setOnClickListener(null);
if (placeHolder == -1)
placeHolder = AttrUtil.getResourceId(getContext(holder.getElementCoverImage()), R.attr.squarePlaceHolderIcon);
if (data instanceof User) {
manageUser(view, holder, (User) data);
holder.getElementProfileImage().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(view), ImageActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, ((User) data).getUid());
getContext(view).startActivity(intent);
}
});
} else if (data instanceof Page) {
managePage(view, holder, (Page) data);
holder.getElementProfileImage().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(view), ImageActivity.class);
intent.putExtra(KlyphBundleExtras.USER_ID, ((Page) data).getPage_id());
getContext(view).startActivity(intent);
}
});
}
}
use of com.abewy.android.apps.klyph.adapter.holder.ElementTimelineHolder in project Klyph by jonathangerbaud.
the class ElementTimelineAdapter method attachHolder.
@Override
protected void attachHolder(View view) {
ImageView elementCoverImage = (ImageView) view.findViewById(R.id.element_cover_image);
ImageView elementProfileImage = (ImageView) view.findViewById(R.id.element_profile_image);
TextView elementDetail1 = (TextView) view.findViewById(R.id.element_detail_1);
TextView elementDetail2 = (TextView) view.findViewById(R.id.element_detail_2);
TextView elementDetail3 = (TextView) view.findViewById(R.id.element_detail_3);
TextView elementDetail4 = (TextView) view.findViewById(R.id.element_detail_4);
TextView likes = (TextView) view.findViewById(R.id.likes);
TextView talkAbout = (TextView) view.findViewById(R.id.talk_about);
view.setTag(new ElementTimelineHolder(elementCoverImage, elementProfileImage, elementDetail1, elementDetail2, elementDetail3, elementDetail4, likes, talkAbout));
}
Aggregations