Tuesday, 4 January 2011

Android Themes and Styles

Changing the attributes of a UI in code always ends up looking ugly. In HTML I tend to factor out these attributes into stylesheets. In Android you can use styles and themes.

Using CSS always takes a little time, as CSS is not one of my core skills, however it always ends up feeling like a simple design. This was also true of my first stab at using Android styles and Themes.

Again android themes and styles have a hierarchical nature so I can tweak existing styles. I can also using logical names for things like colours which change depending on the theme.

I used this approach as hardcoding the colours would not work with the different themes out there. E.g if you've got a bright theme, then text to white will make it invisible. On a dark theme, setting it to black would do the same.

Now that I'm using styles correctly people with different themes will be able to use my app.

No comments:

Post a Comment