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
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.)
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.
Style.xml git location:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;h=d7b654e49809cb97a35682754b1394af5c8bc88b;hb=HEAD
theme.xml git location:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml;h=6b3d7407d1c895a3c297e60d5beac98e2d34c271;hb=HEAD
(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.
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
Post a Comment