I've got a handful of configuration dialogs in my app, and they all have Cancel/OK buttons at the bottom. Now, in API level 11 and up, I want to show Cancel on the left and OK on the right, and also use the ButtonBar style. In API levels 10 and lower I want to show floating buttons, with OK on the left.
Presently I have copies of the XML layouts in both my layout and my layout-v11 folder, with nothing different between them but the button area. However these layouts are fairly complex and I'm trying to save some space, so it would really be better to just have one copy of each layout, and just snap the layouts into a template with the correct button style on the bottom. What would be the best way to go about this? Fragments?