UltimateRecyclerView icon indicating copy to clipboard operation
UltimateRecyclerView copied to clipboard

StickyHeader Views are unaccessible

Open zelin opened this issue 10 years ago • 5 comments

I am trying to add a StickyHeaderView along with Parallex header using item decorator,

The Layout is added and it works fine however no views inside headerView are accessible

Here is the standard code

@Override public long generateHeaderId(int position) { if (getItem(position) != null) return getItem(position).id; else return -1; }

@Override public HeaderViewHolder onCreateHeaderViewHolder(ViewGroup viewGroup) { View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.listview_header_profile, viewGroup, false); // initializing views and then let's say setting onClicks, setText to textViews nothing seems to work strangly. LinearLayout nationLayout = (LinearLayout) view.findViewById(R.id.nationsLayout);

nationLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { moodLayoutClick.moodLayoutClicked(Constants.MOOD_TYPE_NATION); } });

    return new HeaderViewHolder(view);
}

@Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder viewHolder, int position) {

}

public class HeaderViewHolder extends RecyclerView.ViewHolder { protected TextViewWithFont nationBtn; //

    HeaderViewHolder(View view)
    {
        super(view);

Tried initializing here too. Doesn't work } }

What actually is going on? 

zelin avatar Jul 19 '15 19:07 zelin

Do you mean you want to set a click method on it ? Maybe you can try #68 as this issue said.

cymcsg avatar Jul 20 '15 01:07 cymcsg

@cymcsg StickeryHeader attached view "R.layout.listview_header_profile" has multiple Views that needs to be clicked and a couple of TextViews. I can't access any. I don't want to put click on just entire headerView.

zelin avatar Jul 20 '15 04:07 zelin

Any fix to this issue?

zelin avatar Jul 23 '15 11:07 zelin

@zelin Not any update on this right now.

cymcsg avatar Jul 24 '15 06:07 cymcsg

Struggling with this too

tajoumal avatar May 08 '19 10:05 tajoumal