Resources for styling Android apps


Here are some notes I took while looking at styles and themes on Android:

First I read the commonsware pdf section on styles and themes:

Android 3.6.pdf page 319 - 326. I find this set of PDFs very useful. Well worth the money.

Android developer docs:
http://developer.android.com/guide/topics/ui/themes.html

This section is very short for such a complicated topic, but it does give a link to the locations on GIT where the source of theme.xml and style.xml are stored. Looking through these takes a while, but it worth the effort.

For example to find out what styles are available for progress bars go to this URL:
http://developer.android.com/reference/android/R.attr.html
and search for progressbar.
(Possibles are horizontal, title, small and large. Inverse used black on white background.)

Inheritance is a very useful aspect of styles too. Usually you don't want to start from scratch. Just use the parent attribute to point to a style that you want to inherit from (Theme.Light for example) and then override what you need to with code like this:
style="?android:attr/progressBarStyle"
This sets the style to be the value of the android:attr/progressBarStyle style from the parent.
(These are both just pastes from the end of the developer.android.com theme and styles section.

This is handy if you are looking around for a standard icon to use in your app. They all look pretty good and avoid the need for graphic design on an early stage project. 


Comments

Popular posts from this blog

Building a choropleth map for Irish agricultural data

Early Stopping with Keras

AutoCompleteTextView backed with data from SQLite in Android