use of com.shizhefei.test.models.datasource.BooksDataSource in project MVCHelper by LuckyJayce.
the class SwipeRefreshActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_swiperefresh);
// PullToRefreshListView refreshListView = (PullToRefreshListView)
// findViewById(R.id.pullToRefreshListView);
ListView listView = (ListView) findViewById(R.id.listView);
SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
mvcHelper = new MVCSwipeRefreshHelper<>(swipeRefreshLayout);
// 设置数据源
mvcHelper.setDataSource(new BooksDataSource());
// 设置适配器
mvcHelper.setAdapter(new BooksAdapter(this));
// 加载数据
mvcHelper.refresh();
listView.setOnItemClickListener(onItemClickListener);
}
use of com.shizhefei.test.models.datasource.BooksDataSource in project MVCHelper by LuckyJayce.
the class PullrefshActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pullrefsh);
PullToRefreshListView refreshListView = (PullToRefreshListView) findViewById(R.id.pullToRefreshListView);
mvcHelper = new MVCPullrefshHelper<>(refreshListView);
// 设置数据源
mvcHelper.setDataSource(DataSources.concatWith(new InitTokenTask(), new BooksDataSource()));
// 设置适配器
mvcHelper.setAdapter(new BooksAdapter(this));
// 加载数据
mvcHelper.refresh();
}
use of com.shizhefei.test.models.datasource.BooksDataSource in project MVCHelper by LuckyJayce.
the class UltraActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ultra);
/*
* 配置PtrClassicFrameLayout的刷新样式
*/
PtrClassicFrameLayout mPtrFrameLayout = (PtrClassicFrameLayout) findViewById(R.id.rotate_header_list_view_frame);
final MaterialHeader header = new MaterialHeader(this);
header.setLayoutParams(new PtrFrameLayout.LayoutParams(-1, -2));
header.setPadding(0, dipToPix(this, 15), 0, dipToPix(this, 10));
header.setPtrFrameLayout(mPtrFrameLayout);
mPtrFrameLayout.setLoadingMinTime(800);
mPtrFrameLayout.setDurationToCloseHeader(800);
mPtrFrameLayout.setHeaderView(header);
mPtrFrameLayout.addPtrUIHandler(header);
mvcHelper = new MVCUltraHelper<List<Book>>(mPtrFrameLayout);
// 设置数据源
mvcHelper.setDataSource(new BooksDataSource());
// 设置适配器
mvcHelper.setAdapter(new BooksAdapter(this));
// 加载数据
mvcHelper.refresh();
}
use of com.shizhefei.test.models.datasource.BooksDataSource in project MVCHelper by LuckyJayce.
the class UltraRecyclerViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ultrarecyclerview);
PtrClassicFrameLayout mPtrFrameLayout = (PtrClassicFrameLayout) findViewById(R.id.rotate_header_list_view_frame);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
mvcHelper = new MVCUltraHelper<>(mPtrFrameLayout);
// 设置数据源
mvcHelper.setDataSource(new BooksDataSource());
// 设置适配器
mvcHelper.setAdapter(new ReBooksAdapter(this));
// 加载数据
mvcHelper.refresh();
}
Aggregations