Is there a way to format all text elements, buttons or something else with a theme? Like in CSS, when I want to format all tags
and {/ some css here /}
I want to do this in android via xml when I apply a theme to my application. Any ideas? thank
http://bartinger.at/
Update 1.0:
I want to create a theme that formats text in all TextViews green, and in all EditTexts - red. So I just apply the theme and I never have to worry about the style attribute!
Update 1.1:
So I found some of this code, and I think a good start
<item name="android:textViewStyle">@style/MyTextView</item>
<item name="android:buttonStyle">@style/MyButton</item>
I think this is the answer to my question. But I have one more. I want to write my own ActionBar and would like to know how I can apply the default style or default attributes (again without adding the style attribute to the xml: P layout)
I have a class
public class ActionBar extends LinearLayout{ }
and I will use it in my application
<at.bartinger.uil.ActionBar>....</at.bartinger.uil.ActionBar>
The ActionBar should have some default attributes (e.g. height and width) and then add some custom style attributes that can change from application to application (e.g. background)
source
share