use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class StatusesByIdTimeLineFragment method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (data == null) {
return;
}
MessageBean msg = (MessageBean) data.getParcelableExtra("msg");
if (msg != null) {
for (int i = 0; i < getList().getSize(); i++) {
if (msg.equals(getList().getItem(i))) {
getList().getItem(i).setReposts_count(msg.getReposts_count());
getList().getItem(i).setComments_count(msg.getComments_count());
break;
}
}
getAdapter().notifyDataSetChanged();
}
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class BrowserWeiboMsgFragment method buildRepostCount.
private void buildRepostCount() {
MessageBean repostBean = msg.getRetweeted_status();
if (repostBean.getComments_count() == 0 && repostBean.getReposts_count() == 0) {
layout.count_layout.setVisibility(View.GONE);
return;
} else {
layout.count_layout.setVisibility(View.VISIBLE);
}
if (repostBean.getComments_count() > 0) {
layout.comment_count.setVisibility(View.VISIBLE);
layout.comment_count.setText(String.valueOf(repostBean.getComments_count()));
} else {
layout.comment_count.setVisibility(View.GONE);
}
if (repostBean.getReposts_count() > 0) {
layout.repost_count.setVisibility(View.VISIBLE);
layout.repost_count.setText(String.valueOf(repostBean.getReposts_count()));
} else {
layout.repost_count.setVisibility(View.GONE);
}
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class FavListDao method getGSONMsgList.
public FavListBean getGSONMsgList() throws WeiboException {
String json = getMsgListJson();
Gson gson = new Gson();
FavListBean value = null;
try {
value = gson.fromJson(json, FavListBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
if (value != null) {
List<MessageBean> msgList = new ArrayList<MessageBean>();
int size = value.getFavorites().size();
for (int i = 0; i < size; i++) {
msgList.add(value.getFavorites().get(i).getStatus());
}
Iterator<FavBean> iterator = value.getFavorites().iterator();
while (iterator.hasNext()) {
FavBean msg = iterator.next();
if (msg.getStatus().getUser() == null) {
iterator.remove();
} else {
msg.getStatus().getListViewSpannableString();
TimeUtility.dealMills(msg.getStatus());
}
}
}
return value;
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class RepostNewMsgDao method sendNewMsg.
public MessageBean sendNewMsg() throws WeiboException {
String url = URLHelper.REPOST_CREATE;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("id", id);
map.put("status", status);
map.put("is_comment", is_comment);
String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, url, map);
Gson gson = new Gson();
MessageBean value = null;
try {
value = gson.fromJson(jsonData, MessageBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
use of org.qii.weiciyuan.bean.MessageBean in project weiciyuan by qii.
the class ShowStatusDao method getMsg.
public MessageBean getMsg() throws WeiboException {
String url = URLHelper.STATUSES_SHOW;
Map<String, String> map = new HashMap<String, String>();
map.put("access_token", access_token);
map.put("id", id);
String json = HttpUtility.getInstance().executeNormalTask(HttpMethod.Get, url, map);
Gson gson = new Gson();
MessageBean value = null;
try {
value = gson.fromJson(json, MessageBean.class);
} catch (JsonSyntaxException e) {
AppLogger.e(e.getMessage());
}
return value;
}
Aggregations