<resources> <style name="CodeFont"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources>which can then be used in a layout, e.g., ...
<TextView style="@style/CodeFont" android:text="@string/hello" </TextView>
<style name="GreenText" parent="@android:style/TextAppearance"> <item name="android:textColor">#00FF00</item> </style>inherits from the standard Android text style, but sets the font to be green.
<style name="CodeFont.BigRed"> <item name="android:textSize">60sp</item> <item name="android:textColor">#FF0000</item> </style>