How to set item to center of Recycler view when selected
<p>I am using a <code>RecyclerView</code> to display items horizontally. I want to set the selected item to center of the view like this</p>

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

<p>This is how I am doing it:</p>

<pre><code>LinearLayoutManager layoutManager
                = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
        recyclerView.setLayoutManager(layoutManager);
</code></pre>