use of com.looklook.xinghongfei.looklook.bean.news.NewsDetailBean in project LookLook by xinghongfei.
the class NewsJsonUtils method readJsonNewsDetailBeans.
public static NewsDetailBean readJsonNewsDetailBeans(String res, String docId) {
NewsDetailBean newsDetailBean = null;
try {
JsonParser parser = new JsonParser();
JsonObject jsonObj = parser.parse(res).getAsJsonObject();
JsonElement jsonElement = jsonObj.get(docId);
if (jsonElement == null) {
return null;
}
newsDetailBean = JsonUtils.deserialize(jsonElement.getAsJsonObject(), NewsDetailBean.class);
} catch (Exception e) {
}
return newsDetailBean;
}
use of com.looklook.xinghongfei.looklook.bean.news.NewsDetailBean in project LookLook by xinghongfei.
the class TopNewsDesPresenterImpl method getDescrible.
@Override
public void getDescrible(final String docid) {
mITopNewsFragment.showProgressDialog();
String url = getDetailUrl(docid);
OkHttpUtils.ResultCallback<String> loadNewsCallback = new OkHttpUtils.ResultCallback<String>() {
@Override
public void onSuccess(String response) {
NewsDetailBean newsDetailBean = NewsJsonUtils.readJsonNewsDetailBeans(response, docid);
mITopNewsFragment.upListItem(newsDetailBean);
}
@Override
public void onFailure(Exception e) {
mITopNewsFragment.showError(e.toString());
}
};
OkHttpUtils.get(url, loadNewsCallback);
}
Aggregations