luizgrp / SectionedRecyclerViewAdapter

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
MIT License
1.68k stars 372 forks source link

Create only one section #106

Closed lazarohick closed 6 years ago

lazarohick commented 6 years ago

Hi, i set text of sections based on name of country of items. however the adapter create only section on top of recyclerview :(

this code used to get country names of a list. this.title = mDataset.get(0).get("paisNome").getAsString();

section adapter

 public SectionedAdapter(CustomActivity context) {
        super(new SectionParameters.Builder(R.layout.card_view_eventos)
                .headerResourceId(R.layout.section_header)
                .build());

        this.inflater = LayoutInflater.from(context);
        this.activity = context;
}
public void onBindHeaderViewHolder(RecyclerView.ViewHolder holder) {

        ((TextView) holder.itemView.findViewById(R.id.header)).setText(this.title);
    }

Thanks.

luizgrp commented 6 years ago

closing as it's not using any of the templates