Android RecyclerView with GridLayoutManager make item span multiple rows
<p>I have a collection of photos, and I'm using a <code>RecyclerView</code> to display them. I want to have the first element in my <code>RecyclerView</code> span 2 columns AND 2 rows:
<a href="https://i.stack.imgur.com/MrC0k.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MrC0k.png" alt="enter image description here"></a></p>

<p>I know I can span 2 columns with <code>setSpanSizeLookup</code>:</p>

<pre><code>GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
    @Override
    public int getSpanSize(int position) {
        if (position == 0) {
            return 2;
        } else {
            return 1;
        }
    }
});
</code></pre>

<p><strong>but how can I also make the first item span 2 rows as well?</strong></p>

<p>I have tried setting the first item's height to be different by inflating a different layout with double the height of the others, but that resulted in every item on the same row as the first item also being stretched to that height:</p>

<pre><code>@Override
public ProfilePicViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View itemView;
    if (viewType == TYPE_MAIN_PHOTO) {
        itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_view_main_profile_photo, parent, false);
    } else {
        itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_view_profile_photo, parent, false);
    }
    return new ProfilePicViewHolder(itemView);
}
</code></pre>