sergejsha / pinned-section-listview

Easy to use ListView with pinned sections for Android.
2.59k stars 808 forks source link

How to use/adapt this with RecyclerView #93

Open aresares opened 7 years ago

aresares commented 7 years ago

Hi is it possiblew to use this with RecyclerView.Adapter, I tried like this but I get an error public class MemoAdapter extends RecyclerView.Adapter<MemoAdapter.MyViewHolder> implements PinnedSectionListView.PinnedSectionListAdapter{

error is here ` @Override public View getView(int position, View convertView, ViewGroup parent) { TextView view = (TextView) super.getView(position, convertView, parent); <--- ERROR view.setTextColor(Color.DKGRAY); view.setTag("" + position);

    Main2Activity.Item item = getItem(position);

    if (item.type == PinnedSectionListActivity.Item.SECTION) {
        //view.setOnClickListener(PinnedSectionListActivity.this);
        view.setBackgroundColor(parent.getResources().getColor(COLORS[item.sectionPosition % COLORS.length]));
    }

    return view;
}`
sebspion commented 4 years ago

3dv ew sk8j 6f