0

Say I have a theme color selector for the user to choose custom colors (hex color integer, for example) as theme color for the app, how should I do it?

This is pretty much the same question as this one, but since it's never got a proper answer and it's four years ago, I wonder if there's a way that we could do it now. Reflection methods, for example, might be able to some tricks to make it work, but I have no idea where to start with them.

Update: I already explained that my question is basically asking for the same thing as the duplicated question did, but since no one came up with any feasible solutions under that question, I decided to bring up this question again 4 years later to see if someone has come up some solution to it.

Jack
  • 5,354
  • 2
  • 29
  • 54
  • 1
    Possible duplicate of [How to \_really\_ programmatically change primary and accent color in Android Lollipop?](https://stackoverflow.com/questions/25815769/how-to-really-programmatically-change-primary-and-accent-color-in-android-loll) – Darish Oct 04 '18 at 06:05
  • @Darish I already explained that my question is asking for the same thing the duplicated question did, but since no one came up with any feasible solutions under that question, I decided to bring up this question again 4 years later to see if someone has come up some solution to it. – Jack Oct 04 '18 at 07:57
  • Taking your question literally (you want to change the *style* at runtime) I am not aware of any way to do it. If you want to change the *colors used by widgets* at runtime, there should be options for that, perhaps with a custom `ContextWrapper`. Take a peek at https://github.com/garretyoder/Colorful and see how it is handling the problem. – CommonsWare Oct 05 '18 at 21:10
  • 1
    "since it's never got a proper answer" -- note that the question has many answers, a few of which have many upvotes. You might consider asking a separate Stack Overflow question where you explain in detail your situation, to clearly distinguish what you are trying to do from what is offered by the answers on that question. – CommonsWare Oct 06 '18 at 12:42
  • @CommonsWare got it, will take a look at ContextWrapper. – Jack Oct 09 '18 at 03:30

0 Answers0