views:

22

answers:

1

Currently I'm mixing explicit attributes (layout_width, height, alignment) on my various XML layouts with coded styles in styles.xml, plus outsourcing colors from colors.xml.

From your experience, what's the recommended way to organize an android app's layouts?

A: 

Usings styles is way more organized and makes the xml code easier to read, I think that the visual editor for layouts sucks, so the best way to edit is still to manual edit text the file. Easier reading is a big plus.

I use style anywhere im repeating layouts, something that is very useful is that any explicits attributes will override those of the style, so you can use styles and if what you need is almost the same, you just explicitly redifine the attribute.

Any time you need to fix a layout issue you can update the style and not need to update it a million times.

On the other hand if you are just using that layout "style" once, there is no reason to write an actual style for it, just do it all explicitly.

blindstuff