It led to the unpredictable results, even to the crashes It was very easy to miss to provide some color. If the color should be theme dependent, this color should be provided per every theme in styles.xml.If we wanted to add a new color that should be theme dependent, we needed to change three files: colors.xml, styles.xml, attrs.xml. We didn’t want to recreate the activity. We didn’t want to use default Android themes because: Also, we didn’t like the idea that when we wanted to add one more theme to our application, we would have to change the code in so many places and provide the colors of this theme to every view. We wanted to be able to change the color (or any other resource) from the xml layout without the need to switch to Activity or Fragment and look for the place where mapping from theme to resource and changing view property does actually occur. We were looking for a more elegant solution.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |