use of org.qii.weiciyuan.bean.UserBean 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.UserBean in project weiciyuan by qii.
the class DMUserListAdapter method bindViewData.
protected void bindViewData(DMViewHolder holder, int position) {
final DMUserBean msg = bean.get(position);
UserBean user = msg.getUser();
if (user != null) {
holder.username.setVisibility(View.VISIBLE);
buildUsername(holder, user);
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());
}
bindOnTouchListener(holder);
String time = msg.getListviewItemShowTime();
if (!holder.time.getText().toString().equals(time)) {
holder.time.setText(time);
}
holder.time.setTag(msg.getId());
}
use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.
the class TimeLineUtility method filterHomeTimeLineSinaWeiboAd.
public static void filterHomeTimeLineSinaWeiboAd(MessageListBean value) {
if (!SettingUtility.isFilterSinaAd()) {
return;
}
List<MessageBean> msgList = value.getItemList();
Iterator<MessageBean> iterator = msgList.iterator();
final List<AdBean> adBeanList = value.getAd();
if (adBeanList.size() > 0) {
AppLogger.i("filter " + adBeanList.size() + " sina weibo ads");
List<String> adIdList = new ArrayList<String>();
for (AdBean adBean : adBeanList) {
adIdList.add(adBean.getId());
}
while (iterator.hasNext()) {
MessageBean msg = iterator.next();
UserBean user = msg.getUser();
if (user == null) {
continue;
}
if (adIdList.contains(msg.getId())) {
iterator.remove();
value.removedCountPlus();
}
}
}
}
use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.
the class TimeLineUtility method buildOriWeiboSpannalString.
private static SpannableString buildOriWeiboSpannalString(MessageBean oriMsg) {
String name = "";
UserBean oriUser = oriMsg.getUser();
if (oriUser != null) {
name = oriUser.getScreen_name();
if (TextUtils.isEmpty(name)) {
name = oriUser.getId();
}
}
SpannableString value;
if (!TextUtils.isEmpty(name)) {
value = TimeLineUtility.convertNormalStringToSpannableString("@" + name + ":" + oriMsg.getText());
} else {
value = TimeLineUtility.convertNormalStringToSpannableString(oriMsg.getText());
}
return value;
}
use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.
the class UserTopicListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UserBean userBean = (UserBean) getIntent().getParcelableExtra("userBean");
ArrayList<String> topicList = getIntent().getStringArrayListExtra("topicList");
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setTitle(getString(R.string.topic));
if (savedInstanceState == null) {
UserTopicListFragment fragment;
if (topicList != null) {
fragment = new UserTopicListFragment(userBean, topicList);
} else {
fragment = new UserTopicListFragment(userBean);
}
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
}
}
Aggregations