Search in sources :

Example 26 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class ObjectToStringUtility method toString.

public static String toString(DMUserBean dm) {
    UserBean userBean = dm.getUser();
    String username = (userBean != null ? userBean.getScreen_name() : "user is null");
    return String.format("%s @%s:%s", TimeUtility.getListTime(dm.getMills()), username, dm.getText());
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean) SearchUserBean(org.qii.weiciyuan.bean.SearchUserBean) AtUserBean(org.qii.weiciyuan.bean.AtUserBean) DMUserBean(org.qii.weiciyuan.bean.DMUserBean)

Example 27 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class ObjectToStringUtility method toString.

public static String toString(CommentBean comment) {
    UserBean userBean = comment.getUser();
    String username = (userBean != null ? userBean.getScreen_name() : "user is null");
    return String.format("%s @%s:%s", TimeUtility.getListTime(comment.getMills()), username, comment.getText());
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean) SearchUserBean(org.qii.weiciyuan.bean.SearchUserBean) AtUserBean(org.qii.weiciyuan.bean.AtUserBean) DMUserBean(org.qii.weiciyuan.bean.DMUserBean)

Example 28 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class ObjectToStringUtility method toString.

public static String toString(MessageBean msg) {
    UserBean userBean = msg.getUser();
    String username = (userBean != null ? userBean.getScreen_name() : "user is null");
    return String.format("%s @%s:%s", TimeUtility.getListTime(msg.getMills()), username, msg.getText());
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean) SearchUserBean(org.qii.weiciyuan.bean.SearchUserBean) AtUserBean(org.qii.weiciyuan.bean.AtUserBean) DMUserBean(org.qii.weiciyuan.bean.DMUserBean)

Example 29 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class BrowserWeiboMsgCommentAndRepostAdapter method bindRepostData.

private void bindRepostData(ViewHolder holder, int position) {
    Drawable drawable = bg.get(holder);
    if (drawable != null) {
        holder.listview_root.setBackgroundDrawable(drawable);
    } else {
        drawable = holder.listview_root.getBackground();
        bg.put(holder, drawable);
    }
    if (listView.getCheckedItemPosition() == position + listView.getHeaderViewsCount()) {
        holder.listview_root.setBackgroundColor(checkedBG);
    }
    final MessageBean msg = (MessageBean) getItem(position);
    UserBean user = msg.getUser();
    if (user != null) {
        holder.username.setVisibility(View.VISIBLE);
        if (!TextUtils.isEmpty(user.getRemark())) {
            holder.username.setText(new StringBuilder(user.getScreen_name()).append("(").append(user.getRemark()).append(")").toString());
        } else {
            holder.username.setText(user.getScreen_name());
        }
        if (!SettingUtility.getEnableCommentRepostListAvatar()) {
            holder.avatar.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));
        } else {
            buildAvatar(holder.avatar, position, user);
        }
    } else {
        holder.username.setVisibility(View.INVISIBLE);
        holder.avatar.setVisibility(View.INVISIBLE);
    }
    if (!TextUtils.isEmpty(msg.getListViewSpannableString())) {
        holder.content.setText(msg.getListViewSpannableString());
    } else {
        TimeLineUtility.addJustHighLightLinks(msg);
        holder.content.setText(msg.getListViewSpannableString());
    }
    holder.avatar.checkVerified(user);
    holder.time.setTime(msg.getMills());
    holder.reply.setVisibility(View.GONE);
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) UserBean(org.qii.weiciyuan.bean.UserBean) Drawable(android.graphics.drawable.Drawable) RelativeLayout(android.widget.RelativeLayout)

Example 30 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class DMConversationAdapter method bindViewData.

protected void bindViewData(DMViewHolder holder, int position) {
    final DMBean msg = bean.get(position);
    UserBean user = msg.getUser();
    if (user != null) {
        buildAvatar(holder.avatar, position, user);
    } else {
        holder.avatar.setVisibility(View.INVISIBLE);
    }
    if (!TextUtils.isEmpty(msg.getListViewSpannableString())) {
        holder.content.setText(msg.getListViewSpannableString());
    } else {
        TimeLineUtility.addJustHighLightLinks(msg);
        holder.content.setText(msg.getListViewSpannableString());
    }
    String time = msg.getListviewItemShowTime();
    if (!holder.time.getText().toString().equals(time)) {
        holder.time.setText(time);
    }
    holder.time.setTag(msg.getId());
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean) DMBean(org.qii.weiciyuan.bean.DMBean)

Aggregations

UserBean (org.qii.weiciyuan.bean.UserBean)31 Gson (com.google.gson.Gson)9 JsonSyntaxException (com.google.gson.JsonSyntaxException)9 DMUserBean (org.qii.weiciyuan.bean.DMUserBean)8 HashMap (java.util.HashMap)7 MessageBean (org.qii.weiciyuan.bean.MessageBean)6 Drawable (android.graphics.drawable.Drawable)4 RelativeLayout (android.widget.RelativeLayout)4 AtUserBean (org.qii.weiciyuan.bean.AtUserBean)4 SearchUserBean (org.qii.weiciyuan.bean.SearchUserBean)4 Intent (android.content.Intent)3 SpannableString (android.text.SpannableString)3 CommentBean (org.qii.weiciyuan.bean.CommentBean)3 Cursor (android.database.Cursor)2 View (android.view.View)2 ListView (android.widget.ListView)2 ArrayList (java.util.ArrayList)2 AccountBean (org.qii.weiciyuan.bean.AccountBean)2 WriteReplyToCommentActivity (org.qii.weiciyuan.ui.send.WriteReplyToCommentActivity)2 PendingIntent (android.app.PendingIntent)1