Im working on an app which has an Activity containing a PreferenceFragment. When i add a Switch to my fragment, the base color of the switch is pure black, making it hard to see on a Dark theme.
Is it possible to change color of both states of the switch? If so, how?
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">@color/colorPrimaryDark</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorPrimary</item>
<item name="android:navigationBarColor">@color/colorSecondaryDark</item>
<item name="android:listDivider">@color/colorUnselected</item>
<item name="colorControlNormal">@android:color/white</item>
<item name="colorControlActivated">@color/colorSelected</item>
<item name="colorControlHighlight">@color/colorSecondaryDark</item>
<item name="popupMenuStyle">@style/popupMenuThemeDark</item>
</style>
<style name="popupMenuThemeDark">
<item name="android:backgroundTint">@color/colorSecondaryDark</item>
<item name="android:textColor">@android:color/white</item>
</style>
<style name="NavigationDrawerTheme">
<item name="android:listDivider">@color/colorUnselected</item>
</style>
<style name="PreferenceScreen" parent="AppTheme">
<item name="android:textColor">@android:color/white</item>
<item name="android:colorAccent">@color/colorSelected</item>
</style>
</resources>