385841539 / RecycleviewStaggered

recycleview进阶用法,实现复杂页面,包含瀑布流,同时解决复杂布局嵌套卡顿,内存泄漏情况
543 stars 69 forks source link

您好,您的demo很好,但是我想请问您这个代码是在那里给recycleview赋的值呐? #4

Open hangliVIP opened 6 years ago

hangliVIP commented 6 years ago

您好,您的demo很好,但是我想请问您这个代码是在那里给recycleview赋的值呐? 以OneRecycleFragment为例子 private void initBase() { // lay_fresh = (SwipeRefreshLayout) this.rootView.findViewById(R.id.lay_refresh); // lay_fresh.setColorSchemeResources(R.color.colorPrimary, R.color.colorPrimaryDark); // lay_fresh.setOnRefreshListener(this);

    RecyclerView recyclerView = (RecyclerView) this.rootView.findViewById(R.id.recyclerView);

// recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext(), LinearLayoutManager.VERTICAL, false)); recyclerView.setLayoutManager(new GridLayoutManager(recyclerView.getContext(), 6, GridLayoutManager.VERTICAL, false)); // recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));

    List<Cheese> results = new ArrayList<Cheese>();
    results.add(new Cheese("", "my titles develop by random1"));
    results.add(new Cheese("", "my titles develop by random2"));
    results.add(new Cheese("", "my titles develop by random3"));
    results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random4"));
    results.add(new Cheese("", "my titles develop by random5"));
    results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random6"));
    results.add(new Cheese("", "my titles develop by random7"));
    results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random8"));
    results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random9"));
    results.add(new Cheese("", "my titles develop by random10"));
    results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random11"));
    results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random12"));
    results.add(new Cheese("", "my titles develop by random13"));
    results.add(new Cheese("", "my titles develop by random14"));
    results.add(new Cheese("", "my titles develop by random15"));
    recyclerView.setAdapter(adapter = new OneRecycleAdapter(getActivity()));// 这句可以赋值adapter
}

List的数据,我没有看到对应的赋值, 请问最后的赋值是在哪里,那个文件,谢谢您啦

385841539 commented 4 years ago

赋值是在网络请求来了以后啊