title: Android SwitchCompat style
body: <p>I tested my app on my new device with android 5.1.1. In my SettingsActivity i have a switch. I already read some posts and changed it to <code>android.support.v7.widget.SwitchCompat</code> but the problem still is the following: On my old device the switch looks very nice. you can set two texts for <code>textOn</code> and <code>textOff</code> and it fits perfectly. but since api 21 or whatever I get this little bastard here:</p>
  
  <p><a href="https://i.stack.imgur.com/xIFfI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xIFfI.png" alt="enter image description here"></a></p>
  
  <p>It looks like ****. How can I restyle it for all devices like the lollypop switch?</p>
  
  <p><strong>Edit:</strong>
  The question above is answered.
  One tiny thing is missing: How to change the color of the text on the switch.(Not the tag on the left side!!!)</p>
  
  <p><strong>styles.xml</strong></p>
  
  <pre><code>&lt;style name="SwitchTextAppearance" parent="TextAppearance.AppCompat.Widget.Switch"&gt;
          &lt;item name="android:textSize"&gt;12sp&lt;/item&gt;
          &lt;item name="android:textColor"&gt;#3F51B5&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p><strong>layout.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingLeft="8dp"
      android:paddingRight="8dp"
      android:paddingBottom="12dp"
      android:paddingTop="12dp"&gt;
  
      &lt;android.support.v7.widget.SwitchCompat
          android:id="@+id/mySwitch"
          android:layout_width="match_parent"
          android:switchMinWidth="56dp"
          android:layout_height="wrap_content"
          android:switchTextAppearance="@style/SwitchTextAppearance"
          android:thumb="@drawable/thumb"
          android:track="@drawable/track"
          app:showText="true"
          android:textOn="ON"
          android:textOff="OFF"
          android:text="Toggle Switch"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:background="@android:color/transparent"
          android:button="@null"
          android:layout_alignParentEnd="true"
          android:layout_alignParentRight="true"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>