use of org.qii.weiciyuan.bean.DMUserBean 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.DMUserBean in project weiciyuan by qii.
the class DMDBTask method get.
public static DMUserListBean get(String accountId) {
Gson gson = new Gson();
DMUserListBean result = new DMUserListBean();
String sql = "select * from " + DMTable.TABLE_NAME + " where " + DMTable.ACCOUNTID + " = " + accountId + " order by " + DMTable.MBLOGID + " desc limit 1";
Cursor c = getRsd().rawQuery(sql, null);
while (c.moveToNext()) {
String json = c.getString(c.getColumnIndex(DMTable.JSONDATA));
try {
DMUserListBean value = gson.fromJson(json, DMUserListBean.class);
for (DMUserBean b : value.getItemList()) {
if (!b.isMiddleUnreadItem()) {
b.getListViewSpannableString();
b.getListviewItemShowTime();
}
}
return value;
} catch (JsonSyntaxException ignored) {
}
}
c.close();
return result;
}
use of org.qii.weiciyuan.bean.DMUserBean in project weiciyuan by qii.
the class DMDao method getUserList.
public DMUserListBean getUserList() throws WeiboException {
String url = URLHelper.DM_USERLIST;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("count", count);
map.put("cursor", cursor);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
DMUserListBean value = null;
try {
value = new Gson().fromJson(jsonData, DMUserListBean.class);
for (DMUserBean b : value.getItemList()) {
if (!b.isMiddleUnreadItem()) {
b.getListViewSpannableString();
b.getListviewItemShowTime();
}
}
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of org.qii.weiciyuan.bean.DMUserBean 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());
}
Aggregations