Here is just a quick reference on what is involved when you want to use different colours based on the selected theme in an Android app:
- In attrs.xml, define an attribute that references an item in a theme. Add a line, i.e.
name="calculator_button_background" format="reference" /> - In themes.xml, add the item
- name="calculator_button_background">@color/color_dialog_number_button
- The colour can be a direct @color or, in this case, can use predefined colour in colors.xml
name="color_dialog_number_button">#474747
No comments:
Post a Comment