本文整理汇总了Java中net.oschina.app.bean.BlogList.getBloglist方法的典型用法代码示例。如果您正苦于以下问题:Java BlogList.getBloglist方法的具体用法?Java BlogList.getBloglist怎么用?Java BlogList.getBloglist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.oschina.app.bean.BlogList
的用法示例。
在下文中一共展示了BlogList.getBloglist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lvBlogHandleMessage
import net.oschina.app.bean.BlogList; //导入方法依赖的package包/类
private void lvBlogHandleMessage(Message msg){
if(msg.what >= 0){
BlogList bloglist = (BlogList)msg.obj;
Notice notice = bloglist.getNotice();
//显示用户博客数量
String tabBlogText = String.format("博客(%d)", bloglist.getBlogsCount());
mTabBlog.setText(tabBlogText);
//处理listview数据
switch (msg.arg1) {
case UIHelper.LISTVIEW_ACTION_INIT:
case UIHelper.LISTVIEW_ACTION_REFRESH:
case UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG:
lvBlogSumData = msg.what;
lvBlogData.clear();//先清除原有数据
lvBlogData.addAll(bloglist.getBloglist());
break;
case UIHelper.LISTVIEW_ACTION_SCROLL:
lvBlogSumData += msg.what;
if(lvBlogData.size() > 0){
for(Blog blog1 : bloglist.getBloglist()){
boolean b = false;
for(Blog blog2 : lvBlogData){
if(blog1.getId() == blog2.getId()){
b = true;
break;
}
}
if(!b) lvBlogData.add(blog1);
}
}else{
lvBlogData.addAll(bloglist.getBloglist());
}
break;
}
if(msg.what<_pageSize){
curLvBlogDataState = UIHelper.LISTVIEW_DATA_FULL;
lvBlogAdapter.notifyDataSetChanged();
lvBlog_foot_more.setText(R.string.load_full);
}
else if(msg.what == _pageSize){
curLvBlogDataState = UIHelper.LISTVIEW_DATA_MORE;
lvBlogAdapter.notifyDataSetChanged();
lvBlog_foot_more.setText(R.string.load_more);
}
//发送通知广播
if(msg.obj != null){
UIHelper.sendBroadCast(UserCenter.this, notice);
}
}
else if(msg.what == -1){
//有异常--显示加载出错 & 弹出错误消息
curLvBlogDataState = UIHelper.LISTVIEW_DATA_MORE;
lvBlog_foot_more.setText(R.string.load_error);
((AppException)msg.obj).makeToast(UserCenter.this);
}
if(lvBlogData.size()==0){
curLvBlogDataState = UIHelper.LISTVIEW_DATA_EMPTY;
lvBlog_foot_more.setText(R.string.load_empty);
}
lvBlog_foot_progress.setVisibility(View.GONE);
if(msg.arg1 == UIHelper.LISTVIEW_ACTION_REFRESH){
mLvBlog.onRefreshComplete(getString(R.string.pull_to_refresh_update) + new Date().toLocaleString());
mLvBlog.setSelection(0);
}else if(msg.arg1 == UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG){
mLvBlog.setSelection(0);
}
}