RecyclerView autofit LayoutManager
<p>I am using <code>RecyclerView</code> with <code>StaggeredGridLayoutManager</code>. </p>

<p>I want this <code>StaggeredGridLayoutManager</code> or whichever <code>LayoutManager</code> occupy empty areas if there is. For instance if I set the spanCount=3
it must occupy all screen width even I have 2 items or 1 items. In <code>StaggeredGridLayoutManager</code> I can full span single row by : <code>setFullSpan(true);</code> but can't span 2 items for only one row.</p>

<p>My code for <code>RecyclerView</code> :</p>

<pre><code>StaggeredGridLayoutManager sglm= new StaggeredGridLayoutManager(spanCount,StaggeredGridLayoutManager.VERTICAL);
sglm.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
</code></pre>

<p>I tried <a href="https://github.com/felipecsl/AsymmetricGridView" rel="nofollow noreferrer">AsymmetricGridView</a> and  <a href="https://github.com/lucasr/twoway-view" rel="nofollow noreferrer">twoway-view</a> but there is always an empty area</p>

<p>I collect some screenshots of Facebook App :</p>

<p><a href="https://i.stack.imgur.com/oDgfl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oDgfl.png" alt="enter image description here"></a></p>

<p>And here is the Google Keep App as you can see the row height is fixed for every row but the width of items is flexible and I've never seen any empty area with Google Keep:</p>

<p><a href="https://i.stack.imgur.com/o8khV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o8khV.png" alt="enter image description here"></a></p>

<p>And when I am using it there is always an empty area, as you can see the black part of image is empty. I want the <code>RecyclerView</code> should occupy that area by extending my rows like in Google Keep app:</p>

<p><a href="https://i.stack.imgur.com/1IFop.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1IFop.png" alt="enter image description here"></a></p>

<p>I visited this page : <a href="https://stackoverflow.com/questions/36262303/android-how-to-create-a-facebook-like-images-gallery-grid">android-how-to-create-a-facebook-like-images-gallery-grid</a> but it didn't helped me.</p>

<p>Here is the another page I visited : <a href="https://stackoverflow.com/questions/29382548/grid-of-images-like-facebook-for-android">grid-of-images-like-facebook-for-android</a></p>

<p>Is there anyone uses <code>RecyclerView</code> or any <code>View</code> like that?
Can someone suggest me any way or any idea or guide me to where I must start?</p>