use of org.qii.weiciyuan.bean.CommentBean in project weiciyuan by qii.
the class BrowserWeiboMsgCommentAndRepostAdapter method bindCommentData.
private void bindCommentData(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 CommentBean comment = (CommentBean) getItem(position);
UserBean user = comment.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);
}
holder.avatar.checkVerified(user);
holder.content.setText(comment.getListViewSpannableString());
holder.time.setTime(comment.getMills());
holder.reply.setVisibility(View.VISIBLE);
holder.reply.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), WriteReplyToCommentActivity.class);
intent.putExtra("token", GlobalContext.getInstance().getSpecialToken());
intent.putExtra("msg", comment);
getActivity().startActivity(intent);
}
});
}
use of org.qii.weiciyuan.bean.CommentBean in project weiciyuan by qii.
the class CommentListAdapter method bindViewData.
@Override
protected void bindViewData(final 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 + 1) {
holder.listview_root.setBackgroundColor(checkedBG);
}
final CommentBean comment = getList().get(position);
UserBean user = comment.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 (!showOriStatus && !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);
}
holder.content.setText(comment.getListViewSpannableString());
holder.time.setTime(comment.getMills());
if (holder.source != null) {
holder.source.setText(comment.getSourceString());
}
holder.repost_content.setVisibility(View.GONE);
holder.repost_content_pic.setVisibility(View.GONE);
CommentBean reply = comment.getReply_comment();
if (holder.replyIV != null) {
holder.replyIV.setVisibility(View.GONE);
}
if (reply != null && showOriStatus) {
if (holder.repost_layout != null) {
holder.repost_layout.setVisibility(View.VISIBLE);
}
holder.repost_flag.setVisibility(View.VISIBLE);
holder.repost_content.setVisibility(View.VISIBLE);
holder.repost_content.setText(reply.getListViewSpannableString());
holder.repost_content.setTag(reply.getId());
} else {
MessageBean repost_msg = comment.getStatus();
if (repost_msg != null && showOriStatus) {
buildOriWeiboContent(repost_msg, holder, position);
} else {
if (holder.repost_layout != null) {
holder.repost_layout.setVisibility(View.GONE);
}
holder.repost_flag.setVisibility(View.GONE);
if (holder.replyIV != null) {
holder.replyIV.setVisibility(View.VISIBLE);
holder.replyIV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), WriteReplyToCommentActivity.class);
intent.putExtra("token", GlobalContext.getInstance().getSpecialToken());
intent.putExtra("msg", comment);
getActivity().startActivity(intent);
}
});
}
}
}
}
use of org.qii.weiciyuan.bean.CommentBean in project weiciyuan by qii.
the class CommentsToMeTimeLineFragment method addUnreadMessage.
private void addUnreadMessage(CommentListBean data) {
if (data != null && data.getSize() > 0) {
CommentBean last = data.getItem(data.getSize() - 1);
boolean dup = getList().getItemList().contains(last);
if (!dup) {
addNewDataAndRememberPosition(data, true);
}
}
}
use of org.qii.weiciyuan.bean.CommentBean in project weiciyuan by qii.
the class MentionsCommentTimeLineFragment method addUnreadMessage.
private void addUnreadMessage(CommentListBean data) {
if (data != null && data.getSize() > 0) {
CommentBean last = data.getItem(data.getSize() - 1);
boolean dup = getList().getItemList().contains(last);
if (!dup) {
addNewDataAndRememberPosition(data);
}
}
}
use of org.qii.weiciyuan.bean.CommentBean in project weiciyuan by qii.
the class SendReplyToCommentService method onStartCommand.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
int lastNotificationId = intent.getIntExtra("lastNotificationId", -1);
if (lastNotificationId != -1) {
NotificationUtility.cancel(lastNotificationId);
}
String token = intent.getStringExtra("token");
AccountBean account = (AccountBean) intent.getParcelableExtra("account");
String content = intent.getStringExtra("content");
String repostContent = intent.getStringExtra("repostContent");
CommentBean oriMsg = (CommentBean) intent.getParcelableExtra("oriMsg");
ReplyDraftBean replyDraftBean = (ReplyDraftBean) intent.getParcelableExtra("draft");
WeiboSendTask task = new WeiboSendTask(account, token, content, repostContent, oriMsg, replyDraftBean);
task.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
tasksResult.put(task, false);
return START_REDELIVER_INTENT;
}
Aggregations