use of org.kymjs.blog.domain.OSCBlog in project KJFrameForAndroid by kymjs.
the class OSCBlogListFragment method initWidget.
@Override
protected void initWidget(View parentView) {
super.initWidget(parentView);
mEmptyLayout.setOnLayoutClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mEmptyLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
refresh();
}
});
mListView = mRefreshLayout.getRefreshView();
mListView.setDivider(new ColorDrawable(android.R.color.transparent));
mListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (parent.getAdapter() instanceof OSCBlogAdapter) {
Bundle bundle = new Bundle();
bundle.putInt("oscblog_id", ((OSCBlog) parent.getAdapter().getItem(position)).getId());
SimpleBackActivity.postShowWith(outsideAty, SimpleBackPage.OSC_BLOG_DETAIL, bundle);
}
}
});
mRefreshLayout.setPullLoadEnabled(true);
((FooterLoadingLayout) mRefreshLayout.getFooterLoadingLayout()).setNoMoreDataText("已经没有更多了~");
mRefreshLayout.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
refresh();
}
@Override
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
refresh(mDatas.size() / 20);
}
});
fillUI();
}
Aggregations