I understand that XML templates in Android generally have static elements and that's pretty much the point of them to layout the page, but I am designing an app that has the same elements on every page, except for a varying number of buttons at the bottom depending on what data is being displayed.
Now, I could (and have so far) simply make 5 different XML templates each with one additional button element added so I can display 1 to 5 buttons and call the appropriate template depending on what is required, but that seems terribly inelegant to me. It works though. I just feel like I must be missing something since I am new to this platform and XML templating in general.
To be specific, given the above background: Is there any way I could use a single template and have it use a varying number of buttons at the end? I have been cautioned against implementing layouts both programmatically in java and in XML, but might this be an exception to that rule? And if so how would I go about it?
Please let me know if any more information is needed to answer this question. As it is a fairly general question, I didn't include any code, but will provide it if necessary. Thank you!