title: Composition or inheritance with fragments?
body: <p>I am trying to write two fragments that share the same layout and a lot of view set-up code. Let's say that the layout has a Title TextView and a RecyclerView. In Fragment A, I want the recycler view to use a custom adapter that will be different from what Fragment B will use, and I want Fragment A to also have a different callback to the parent activity than what Fragment B will have. What is the best way to structure these fragments so that I don't have to copy and paste a lot of code?</p>
  <p>I could opt for something like BaseFragment with FragmentA and FragmentB extending it, and maybe overriding a getAdapter() method, but I've read that composition is favored to inheritance. How would I handle this using composition?</p>