Repository navigation
[Theming] Dynamically use server color - #1031
Conversation
auto upload cloud icon in on state: tint it
|
In theming app on server we only define one basic color.
How can we get these colors? color accent is a bit lighter, the other one darker. |
We are more or less free to choose how they get calculated since they do not really follow Material Design guidelines (simply since we do not use a truly different accent color but a slightly lighter one). Maybe @juliushaertl has an idea on color calculation here since he is the server side color calculation hero 😃 |
5e246f2 to
9b64c2c
Compare
It should work quite well if you convert the RGB value to the HSL color space and then either increase or decrease the lightness (L) component to get brighter/darker color tones. Unfortunately android sdk doesn't seem to support HSL out of the box or at least I can't find it at the moment. But conversion is not that hard, see: https://tips4java.wordpress.com/2009/07/05/hsl-color/ |
17b227b to
3d772ab
Compare
|
primary_dark should be the fallback for drawer and user info screen background image in case no background image could be retrieved from server |
|
@juliushaertl thanks for pointing out with HSL. |
3d772ab to
dc21800
Compare
2bf1cf1 to
4c4c498
Compare
|
The bullet points are now grey as discussed as we cannot dynamically theme them. |
@tobiasKaminsky than I guess that is the reason for it since I run English (Germany) on my device 😁 |
| int trackColor = Color.argb(77, Color.red(color), Color.green(color), Color.blue(color)); | ||
|
|
||
| // setting the thumb color | ||
| DrawableCompat.setTintList(switchView.getThumbDrawable(), new ColorStateList( |
There was a problem hiding this comment.
needs an API check since we support 14+ while getThumbDrawable() is v16+
| new int[]{color, Color.WHITE})); | ||
|
|
||
| // setting the track color | ||
| DrawableCompat.setTintList(switchView.getTrackDrawable(), new ColorStateList( |
There was a problem hiding this comment.
needs an API check since we support 14+ while getTrackDrawable() is v16+
|
Awesome fix @tobiasKaminsky - very minor thing which we can ignore: The settings switches are slightly lighter colored than the "regular ones, see screenshot mix: |
|
Feel free to try to set the color to a better value ;-) |
|
I'll have a look! |
|
👍 fine with all the changes and by now thoroughly tested on dev releases and also by me - @mario feel free to review/approve/merge :) |
|
Great work everyone, works really nice in the dev release 👏 |
|
@mario @tobiasKaminsky in case we get this merged today I' might be able to update the auto upload branch this evening if there aren't too many conflicts to resolve. :D |
|
@AndyScherzinger if you feel like this is ok, feel free to merge - I will not be able to review it in a while. Thanks. |

This overwrites the default server color and uses the color provided via theming app.
TODO:
OPEN / UNRESOLVED: