I am currently trying to get the look of my app right. But I am having problems figuring out how to even set up a way to change themes. For one thing, is there even a way to change styles through code? I checked the method list and I saw nothing. This leads me to my actual question; is there a way that, like CSS, in which you style the parent, and then have it trickle down but also changed depending on the View? I looked at the Android docs, and they did not show any examples of this. Hopefully someone can give me an idea as to how to accomplish this, or if its not possible, to let me know that as well. Thanks in advance.
Asked
Active
Viewed 468 times
1
-
Maybe this question can help you: http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view – 0gravity Jul 26 '12 at 00:47
-
I guess that kind of answers my question. You can't add styles through code. But thats a start. Thanks @0gravity – Andy Jul 26 '12 at 01:06
1 Answers
0
You should be able to do this using styles and themes. I've implemented this using Jake whartons Sherlock action bar. (I'm not certain if it's necessary) It involves using the comparability library which gives you the ability to use fragments and loaders as well. Look at his democode at http://actionbarsherlock.com/download.html. Look for where themes are mentioned and you will find the information you need. In the demo app you can change the theme in the top right corner and see how it affects the activities look and feel. It also shows many of the features available and the code to write them. I have found this an invaluable resource and it should show you how to theme your app.

Zachary Moshansky
- 1,673
- 18
- 32