Assume that, If we not pre-defined a theme, some style, some color in XML resources files. Do we able to create our theme at runtime programmatically and use that theme afterward?
I mean:
If we just defined a default app theme, Can we change the value of theme attrs to be a value that not defined in resource xml files programmatically? (like set the colorPrimary to be #7e57c2 in some class but effect whole app) or change the reference of it to another color source like local storage or some external files.
If we store values(colorPrimary: "#7e57c2") in local storage or sharedPref and we use a custom view instead of the default. Can we get that color and use it in our custom view class?
I wondering that If I didn't define several themes in resource files but just one default theme and then I fetched the theme's values from the backend. What is the proper way to do to use that value instead of some defined value?
P.S. I'm not intending to switch between pre-defined style at runtime. I want to know how to create a new style or edit the default value and use it afterward at runtime.
Thank you.