Search in sources :

Example 11 with PicturePrimarySecondaryTextHolder

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));
}
Also used : RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) PicturePrimarySecondaryTextHolder(com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)

Example 12 with PicturePrimarySecondaryTextHolder

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);
}
Also used : Group(com.abewy.android.apps.klyph.core.fql.Group) PicturePrimarySecondaryTextHolder(com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)

Example 13 with PicturePrimarySecondaryTextHolder

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);
}
Also used : Friend(com.abewy.android.apps.klyph.core.fql.Friend) Education(com.abewy.android.apps.klyph.core.fql.User.Education) Work(com.abewy.android.apps.klyph.core.fql.User.Work) PicturePrimarySecondaryTextHolder(com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)

Example 14 with PicturePrimarySecondaryTextHolder

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);
}
Also used : ProfileImageView(com.abewy.android.apps.klyph.widget.ProfileImageView) Notification(com.abewy.android.apps.klyph.core.fql.Notification) PicturePrimarySecondaryTextHolder(com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)

Aggregations

PicturePrimarySecondaryTextHolder (com.abewy.android.apps.klyph.adapter.holder.PicturePrimarySecondaryTextHolder)14 ImageView (android.widget.ImageView)7 TextView (android.widget.TextView)7 Friend (com.abewy.android.apps.klyph.core.fql.Friend)2 ProfileImageView (com.abewy.android.apps.klyph.widget.ProfileImageView)2 View (android.view.View)1 RelativeLayout (android.widget.RelativeLayout)1 FriendRequest (com.abewy.android.apps.klyph.core.fql.FriendRequest)1 Group (com.abewy.android.apps.klyph.core.fql.Group)1 Notification (com.abewy.android.apps.klyph.core.fql.Notification)1 Page (com.abewy.android.apps.klyph.core.fql.Page)1 Education (com.abewy.android.apps.klyph.core.fql.User.Education)1 Relative (com.abewy.android.apps.klyph.core.fql.User.Relative)1 Work (com.abewy.android.apps.klyph.core.fql.User.Work)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1