What is the most efficient way to change the UI of the items in a RecyclerView?
<p>Suppose I have RecyclerView with hundreds of items. There are a few different view types. When I click on an item it has to change its UI. As I see it there are two options:</p>

<ul>
<li>change the item to a different view type and notify the adapter that it changed so that it can inflate a new view to display the new state.</li>
<li>have both views in a single xml file. only one is visible at any time.  Toggle between them using the setVisibility function when the state changes.</li>
</ul>

<p>there are a lot of articles online about heterogeneous RecyclerViews using lots of view types, but i have yet seen one about the best practices when item views dynamically change and the RecyclerView becomes more heterogeneous over time.
which method is best to change an existing view in a recycler view? what are the tradeoffs? </p>