I have some problem about apply colors to my app. I want to achieve to get some json from the web, like this:
{
"colorPrimary": "#45a02c",
"colorAccent": "#a02c2c",
"backgroundColor": "#FFFFFF"
}
and store it in a object like ThemeColor, i created. Parsing the json to object is no problem, but now i want to create a method in my ThemeColor class, that will apply the colors of the object to my app, so that my toolbar will colored in this primary color or i can use it with ?attr/colorPrimary
.
Is that possible? And what would be a good way to achieve this?