本文整理汇总了Java中net.oschina.app.bean.NewsList类的典型用法代码示例。如果您正苦于以下问题:Java NewsList类的具体用法?Java NewsList怎么用?Java NewsList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NewsList类属于net.oschina.app.bean包,在下文中一共展示了NewsList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNewsList
import net.oschina.app.bean.NewsList; //导入依赖的package包/类
/**
* 获取资讯列表
* @param url
* @param catalog
* @param pageIndex
* @param pageSize
* @return
* @throws AppException
*/
public static NewsList getNewsList(AppContext appContext, final int catalog, final int pageIndex, final int pageSize) throws AppException {
String newUrl = _MakeURL(URLs.NEWS_LIST, new HashMap<String, Object>(){{
put("catalog", catalog);
put("pageIndex", pageIndex);
put("pageSize", pageSize);
}});
try{
return NewsList.parse(http_get(appContext, newUrl));
}catch(Exception e){
if(e instanceof AppException)
throw (AppException)e;
throw AppException.network(e);
}
}
示例2: loadLvNewsData
import net.oschina.app.bean.NewsList; //导入依赖的package包/类
/**
* 线程加载新闻数据
* @param catalog 分类
* @param pageIndex 当前页数
* @param handler 处理器
* @param action 动作标识
*/
private void loadLvNewsData(final int catalog,final int pageIndex,final Handler handler,final int action){
mHeadProgress.setVisibility(ProgressBar.VISIBLE);
new Thread(){
public void run() {
Message msg = new Message();
boolean isRefresh = false;
if(action == UIHelper.LISTVIEW_ACTION_REFRESH || action == UIHelper.LISTVIEW_ACTION_SCROLL)
isRefresh = true;
try {
NewsList list = appContext.getNewsList(catalog, pageIndex, isRefresh);
msg.what = list.getPageSize();
msg.obj = list;
} catch (AppException e) {
e.printStackTrace();
msg.what = -1;
msg.obj = e;
}
msg.arg1 = action;
msg.arg2 = UIHelper.LISTVIEW_DATATYPE_NEWS;
if(curNewsCatalog == catalog)
handler.sendMessage(msg);
}
}.start();
}
示例3: loadLvNewsData
import net.oschina.app.bean.NewsList; //导入依赖的package包/类
/**
* 线程加载新闻数据
*
* @param catalog
* 分类
* @param pageIndex
* 当前页数
* @param handler
* 处理器
* @param action
* 动作标识
*/
private void loadLvNewsData(final int catalog, final int pageIndex,
final Handler handler, final int action) {
mHeadProgress.setVisibility(ProgressBar.VISIBLE);
new Thread() {
public void run() {
Message msg = new Message();
boolean isRefresh = false;
if (action == UIHelper.LISTVIEW_ACTION_REFRESH
|| action == UIHelper.LISTVIEW_ACTION_SCROLL)
isRefresh = true;
try {
NewsList list = appContext.getNewsList(catalog, pageIndex,
isRefresh);
msg.what = list.getPageSize();
msg.obj = list;
} catch (AppException e) {
e.printStackTrace();
msg.what = -1;
msg.obj = e;
}
msg.arg1 = action;
msg.arg2 = UIHelper.LISTVIEW_DATATYPE_NEWS;
if (curNewsCatalog == catalog)
handler.sendMessage(msg);
}
}.start();
}
示例4: initFrameButton
import net.oschina.app.bean.NewsList; //导入依赖的package包/类
/**
* 初始化各个主页的按钮(资讯、问答、动弹、动态、留言)
*/
private void initFrameButton()
{
//初始化按钮控件
framebtn_News_lastest = (Button)findViewById(R.id.frame_btn_news_lastest);
framebtn_News_blog = (Button)findViewById(R.id.frame_btn_news_blog);
framebtn_News_recommend = (Button)findViewById(R.id.frame_btn_news_recommend);
framebtn_Question_ask = (Button)findViewById(R.id.frame_btn_question_ask);
framebtn_Question_share = (Button)findViewById(R.id.frame_btn_question_share);
framebtn_Question_other = (Button)findViewById(R.id.frame_btn_question_other);
framebtn_Question_job = (Button)findViewById(R.id.frame_btn_question_job);
framebtn_Question_site = (Button)findViewById(R.id.frame_btn_question_site);
framebtn_Tweet_lastest = (Button)findViewById(R.id.frame_btn_tweet_lastest);
framebtn_Tweet_hot = (Button)findViewById(R.id.frame_btn_tweet_hot);
framebtn_Tweet_my = (Button)findViewById(R.id.frame_btn_tweet_my);
framebtn_Active_lastest = (Button)findViewById(R.id.frame_btn_active_lastest);
framebtn_Active_atme = (Button)findViewById(R.id.frame_btn_active_atme);
framebtn_Active_comment = (Button)findViewById(R.id.frame_btn_active_comment);
framebtn_Active_myself = (Button)findViewById(R.id.frame_btn_active_myself);
framebtn_Active_message = (Button)findViewById(R.id.frame_btn_active_message);
//设置首选择项
framebtn_News_lastest.setEnabled(false);
framebtn_Question_ask.setEnabled(false);
framebtn_Tweet_lastest.setEnabled(false);
framebtn_Active_lastest.setEnabled(false);
//资讯+博客
framebtn_News_lastest.setOnClickListener(frameNewsBtnClick(framebtn_News_lastest,NewsList.CATALOG_ALL));
framebtn_News_blog.setOnClickListener(frameNewsBtnClick(framebtn_News_blog,BlogList.CATALOG_LATEST));
framebtn_News_recommend.setOnClickListener(frameNewsBtnClick(framebtn_News_recommend,BlogList.CATALOG_RECOMMEND));
//问答
framebtn_Question_ask.setOnClickListener(frameQuestionBtnClick(framebtn_Question_ask,PostList.CATALOG_ASK));
framebtn_Question_share.setOnClickListener(frameQuestionBtnClick(framebtn_Question_share,PostList.CATALOG_SHARE));
framebtn_Question_other.setOnClickListener(frameQuestionBtnClick(framebtn_Question_other,PostList.CATALOG_OTHER));
framebtn_Question_job.setOnClickListener(frameQuestionBtnClick(framebtn_Question_job,PostList.CATALOG_JOB));
framebtn_Question_site.setOnClickListener(frameQuestionBtnClick(framebtn_Question_site,PostList.CATALOG_SITE));
//动弹
framebtn_Tweet_lastest.setOnClickListener(frameTweetBtnClick(framebtn_Tweet_lastest,TweetList.CATALOG_LASTEST));
framebtn_Tweet_hot.setOnClickListener(frameTweetBtnClick(framebtn_Tweet_hot,TweetList.CATALOG_HOT));
framebtn_Tweet_my.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//判断登录
int uid = appContext.getLoginUid();
if(uid == 0){
UIHelper.showLoginDialog(Main.this);
return;
}
framebtn_Tweet_lastest.setEnabled(true);
framebtn_Tweet_hot.setEnabled(true);
framebtn_Tweet_my.setEnabled(false);
curTweetCatalog = uid;
loadLvTweetData(curTweetCatalog, 0, lvTweetHandler, UIHelper.LISTVIEW_ACTION_CHANGE_CATALOG);
}
});
//动态+留言
framebtn_Active_lastest.setOnClickListener(frameActiveBtnClick(framebtn_Active_lastest,ActiveList.CATALOG_LASTEST));
framebtn_Active_atme.setOnClickListener(frameActiveBtnClick(framebtn_Active_atme,ActiveList.CATALOG_ATME));
framebtn_Active_comment.setOnClickListener(frameActiveBtnClick(framebtn_Active_comment,ActiveList.CATALOG_COMMENT));
framebtn_Active_myself.setOnClickListener(frameActiveBtnClick(framebtn_Active_myself,ActiveList.CATALOG_MYSELF));
framebtn_Active_message.setOnClickListener(frameActiveBtnClick(framebtn_Active_message,0));
//特殊处理
framebtn_Active_atme.setText("@"+getString(R.string.frame_title_active_atme));
}