Search in sources :

Example 1 with GroupHolder

use of com.abewy.android.apps.klyph.adapter.holder.GroupHolder in project Klyph by jonathangerbaud.

the class GroupAdapter method attachHolder.

protected void attachHolder(View view) {
    ImageView groupCover = (ImageView) view.findViewById(R.id.group_cover);
    TextView groupName = (TextView) view.findViewById(R.id.group_name);
    TextView groupDescription = (TextView) view.findViewById(R.id.group_description);
    setHolder(view, new GroupHolder(groupCover, groupName, groupDescription));
}
Also used : GroupHolder(com.abewy.android.apps.klyph.adapter.holder.GroupHolder) TextView(android.widget.TextView) GroupCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView) ImageView(android.widget.ImageView)

Example 2 with GroupHolder

use of com.abewy.android.apps.klyph.adapter.holder.GroupHolder 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);
    }
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) GroupHolder(com.abewy.android.apps.klyph.adapter.holder.GroupHolder) GroupCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView)

Aggregations

GroupHolder (com.abewy.android.apps.klyph.adapter.holder.GroupHolder)2 GroupCoverImageView (com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView)2 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 Group (com.abewy.android.apps.klyph.core.fql.Group)1