I have a ViewPager with 3 different pages that all have their own fragment XML file. These fragments are basically the same for all 3 pages, they only differ in the content: Page 1 displays a RadioGroup, Page 2 shows a checkbox and Page 3 simply shows text.
On every page, there is a title and a description on the top and a button on the bottom. The content is displayed between the description and the button.
Currently I have copied the fragment file and just changed the content part. But this solution does not seem to be the best because I have to change 3 files when there is a layout change.
What is the recommended way to do this? Extend the LinearLayout class? Put all elements in one file and dynamically show/hide the elements I need? Any better suggestions?