I have a RecyclerView
with a LinearLayoutManager
and an Adapter
:
@Override public int getItemViewType(int position) {
return position == 0? R.layout.header : R.layout.item;
}
Here's header.xml
:
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
/>
What I want to achieve is to have a hole in the RecyclerView
where I can click through to anything behind the RecyclerView
. I tried a lot of combinations the following attributes to no avail:
android:background="@android:color/transparent"
android:background="@null"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:longClickable="false"
How could I make the first item transparent (allowing touch events to anything behind it) in the list, but let it still occupy the space?