Search in sources :

Example 1 with NodeSectionAdapter

use of com.chad.baserecyclerviewadapterhelper.adapter.node.section.NodeSectionAdapter in project BaseRecyclerViewAdapterHelper by CymChad.

the class NodeSectionUseActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_node_section);
    setBackBtn();
    setTitle("Node Use (Section)");
    mRecyclerView = findViewById(R.id.rv_list);
    mRecyclerView.setLayoutManager(new GridLayoutManager(this, 3));
    // mRecyclerView.addItemDecoration(new GridSectionAverageGapItemDecoration(10, 10, 20, 15));
    final NodeSectionAdapter nodeAdapter = new NodeSectionAdapter();
    // 顶部header
    View view = getLayoutInflater().inflate(R.layout.head_view, mRecyclerView, false);
    view.findViewById(R.id.iv).setVisibility(View.GONE);
    nodeAdapter.addHeaderView(view);
    mRecyclerView.setAdapter(nodeAdapter);
    nodeAdapter.setList(getEntity());
    mRecyclerView.scheduleLayoutAnimation();
}
Also used : GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) NodeSectionAdapter(com.chad.baserecyclerviewadapterhelper.adapter.node.section.NodeSectionAdapter) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Aggregations

View (android.view.View)1 GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 NodeSectionAdapter (com.chad.baserecyclerviewadapterhelper.adapter.node.section.NodeSectionAdapter)1