Themes are Android's mechanism for applying a consistent style to an app or activity. A style specifies the visual properties of the elements that make up your user interface, such as color, height, padding, and font size.
We can create styles for views using the various attributes:
<TextView style="@android:style/TextAppearance.Medium" android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="#7F3300" android:typeface="monospace" android:gravity="center" android:text="Inline Styles" />
These styles can be extracted into a separate file so that they can be reused across views, as with string resources. In this case, we inherit from the Android style
TextAppearance.Medium
, but this is not always necessary. Let's take a look at the following code snippet:<?xml version="1.0" encoding="UTF-8"?> <resources> <style name="MyStyle" parent="@android:style/TextAppearance.Medium...