Exemplo n.º 1
0
 // 初始化数据
 private void initData() {
   page = new Page();
   mSwipeRefreshWidget.setColorSchemeColors(R.color.white, R.color.background, R.color.black);
   // 初次
   mSwipeRefreshWidget.setRefreshing(true);
   mRecyclerView.setLayoutManager(myLayoutManager);
   // 设置间隔
   mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), 5, 5));
   mRecyclerView.addOnScrollListener(new OnRecyclerScrollListener());
   myListAdapter.onLoadMoreListener(onLoadMoreListener);
   mRecyclerView.setAdapter(myListAdapter);
   refreshAction();
 }
Exemplo n.º 2
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   myListAdapter.destroy();
 }
Exemplo n.º 3
0
 // 刷新商品界面
 public void refreshView(List<Goods> goods) {
   myListAdapter.goods(goods);
   myListAdapter.notifyDataSetChanged();
 }