Android. Using fragments in RecyclerView is it right or wrong?
<p>I have a card which addition to other information can contain an image, image slider (third-party library), or video (YouTubeAPI). Earlier I used to card layout, all three media elements (image, slider, video) and, depending on the needs, modify their visibility, hiding unnecessary elements, leaving visible only the necessary.</p>
<p>Then I decided to try to use the fragments. Did the three fragments, for each item (note that the fragments of a class contain all the logic element, he should just pass parameters to initialize, and the rest he will do himself), and tried to use it in RecyclerView. Earlier in my card had three elements, but now I just wanted to put me right fragment in a special container in the card.</p>
<p>I also read that the use of fragments in RecyclerView is a bad practice. Question - is worth in this case the use of fragments, for the sake of simplicity (these fragments are also used in other Activiti and now all logic of the media elements moved to their classes of fragments).
Or I must use an old scheme - the card directly contains all the media items that I dynamically made visible/invisible and filled as needed?</p>
<p><a href="https://i.stack.imgur.com/471bk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/471bk.jpg" alt="enter image description here" /></a></p>