use of com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView 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.widget.coverImage.GroupCoverImageView in project Klyph by jonathangerbaud.
the class GroupAdapter method mergeViewWithData.
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
GroupHolder holder = (GroupHolder) getHolder(view);
Group group = (Group) data;
holder.getGroupName().setText(group.getName());
if (group.getDescription().length() > 0) {
holder.getGroupDescription().setText(group.getDescription());
holder.getGroupDescription().setVisibility(View.VISIBLE);
} else {
holder.getGroupDescription().setVisibility(View.GONE);
}
int placeHolder = AttrUtil.getResourceId(getContext(holder.getGroupCover()), R.attr.squarePlaceHolderIcon);
if (group.getPic_cover() != null && group.getPic_cover().getSource() != null && group.getPic_cover().getSource().length() > 0) {
GroupCoverImageView groupCoverImageView = (GroupCoverImageView) holder.getGroupCover();
groupCoverImageView.setOffset(group.getPic_cover().getOffset_y());
loadImage(holder.getGroupCover(), group.getPic_cover().getSource(), placeHolder, true);
} else {
loadImage(holder.getGroupCover(), group.getPic_big(), placeHolder, true);
}
}
use of com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView in project Klyph by jonathangerbaud.
the class GroupActivity method initComponentsOnRequestSucces.
@Override
protected void initComponentsOnRequestSucces(List<GraphObject> result) {
group = (Group) result.get(0);
headerName.setText(group.getName());
// ImageLoader.display((ImageView) mHeaderPicture, ImageLoader.FAKE_URI, true, KlyphUtil.getPlaceHolder(this));
ImageLoader.display(getHeaderPicture(), group.getPic_cover().getSource(), true, R.drawable.cover_place_holder, new SimpleListener() {
@Override
public void onSuccess() {
super.onSuccess();
// that would destroy the view
if (getHeaderPicture() != null)
((GroupCoverImageView) getHeaderPicture()).setOffset(group.getPic_cover().getOffset_y());
}
});
((TabsAdapter) getPagerAdapter()).setGroup(group);
((TabsAdapter) getPagerAdapter()).init(listGridHeaderHeight);
((TabsAdapter) getPagerAdapter()).setInitialPositionAndShow();
}
Aggregations