// 初始化数据 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(); }
@Override public void onDestroy() { super.onDestroy(); myListAdapter.destroy(); }
// 刷新商品界面 public void refreshView(List<Goods> goods) { myListAdapter.goods(goods); myListAdapter.notifyDataSetChanged(); }