1

I'm currently styling my Preference screen and stumbled upon an issue.

I have some SwitchPreferenceCompat which I can style like I want and works fine. I do however have one SwitchPreferenceCompat which is always checked and disabled (no clicks possible). The issue here is that the color of this disabled SwitchPreferenceCompat isn't the same as the regular SwitchPreferenceCompat when set to checked. It instead has the inverted color scheme of the SwitchPreferenceCompat unchecked.

I looked into this thread: How to change the color of a SwitchCompat in order to find an answer, but none of the given attributes changed anything (except colorSwitchThumbNormal, but that changed the unchecked SwitchPreferenceCompat as well as the checked disabled SwitchPreferenceCompat with inverted color scheme as usual).

How do I set the color scheme of a disabled but checked SwitchPreferenceCompat specifically? If I set it enabled it has the same colors as the other SwitchPreferenceCompat, so something with it being disabled changes the colors of it and I have no idea how to set it like I want it to be.

How do I fix this?

Felix Eder
  • 325
  • 3
  • 16

0 Answers0