You can set the OnClickListener / OnTouchListener all your "holes" to the parent view element behind the RecyclerView and delegate any of the MotionEvent and touch events to this parent ViewGroup touch processing.
Update using TWiStErRob:
class HeaderViewHolder extends RecyclerView.ViewHolder { public HeaderViewHolder(View view) { super(view); view.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) {
There is nothing special, simple in XML (none of the attributes in the question). v.getParent() is a RecyclerView , and this long method stops it from triggering scroll gestures by holding its finger on the hole.
In my view, the βholeβ in the list also has a translucent background, but it does not matter, because we deliver our orders by hand.
source share