I am using android.support.v7.widget.SwitchCompat and I am having the following problems.
- My style, which includes colorControlActivated, doesn't apply.
- Replacing a proxy server using the Android and Res-Auto namespaces has no effect
- How to set maximum text for all caps
My code
styles.xml
Notice that I tried without parent and Theme.AppCompat.Light.NoActionBar
<style name="ToggleSwitchStyle" parent="Theme.AppCompat"> <item name="colorControlActivated">@color/emerald</item> </style>
My SwitchCompat defined in XML layout
<android.support.v7.widget.SwitchCompat android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" android:padding="5dp" android:textOff="@string/no" android:textOn="@string/yes" app:showText="true" android:switchPadding="5dp" app:switchPadding="10dp" app:theme="@style/ToggleSwitchStyle" android:theme="@style/ToggleSwitchStyle" android:textAllCaps="true" app:thumbTextPadding="5dp" >
So in the text above, AllCaps does not make the text on the thumb with all the caps.
Passage filling does not affect
A theme using the Res-Auto or Android namespace does not affect the active color.
However, I can change the active color by changing the color accent to my material theme.
<style name="MaterialDesign" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/yellow</item> </style>
source share