title: How to align a Switch to the right? [Android]
body: <p>I have a layout with switches. I want the text to be on the left and the actual switch to be on the right.
  How can i do it? I know it's possible because they are like this in the phone settings.</p>
  
  <p>Current situation:</p>
  
  <p><img src="https://i.stack.imgur.com/NETMJ.png" alt="enter image description here"></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_margin="15dp"
  android:dividerPadding="5dp"
  android:orientation="vertical"
  android:padding="15dp"
  android:scrollbars="vertical"
  android:showDividers="middle" &gt;
  
  &lt;Switch
       android:paddingBottom="15dp"
      android:id="@+id/switch_gprs"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:checked="false"
      android:gravity="center_vertical|fill|end"
      android:text="@string/gprs" /&gt;
  
  &lt;View
  android:paddingTop="15dp"
   android:paddingBottom="15dp"
  android:layout_height="1dp"
  android:layout_width="match_parent"
  android:background="@color/holo_black" /&gt;
  
  &lt;Switch
      android:paddingTop="15dp"
       android:paddingBottom="15dp"
      android:id="@+id/switch_voicemail"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/voicemail" /&gt;
  
  &lt;RelativeLayout
      android:paddingTop="15dp"
       android:paddingBottom="15dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:text="@string/number" /&gt;
  
      &lt;TextView
          android:id="@+id/voicemail_number"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:text="TextView" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;RelativeLayout
      android:paddingTop="15dp"
       android:paddingBottom="15dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:text="@string/email" /&gt;
  
      &lt;TextView
          android:id="@+id/voicemail_email"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:text="TextView" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;TextView
      android:paddingTop="15dp"
      android:paddingBottom="15dp"
      android:id="@+id/textView4"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/voicemail_download" /&gt;
  
   &lt;View
  android:paddingTop="15dp"
   android:paddingBottom="15dp"
  android:layout_height="1dp"
  android:layout_width="match_parent"
  android:background="@color/holo_black" /&gt;
  
  &lt;Switch
      android:paddingTop="15dp"
       android:paddingBottom="15dp"
      android:id="@+id/switch1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/redirect" /&gt;
  
  &lt;RelativeLayout
      android:paddingTop="15dp"
       android:paddingBottom="15dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/textView5"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:text="@string/sim_number" /&gt;
  
      &lt;TextView
          android:id="@+id/redirect_sim"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:text="TextView" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;RelativeLayout
      android:paddingTop="15dp"
       android:paddingBottom="15dp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/redirect_number"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:text="TextView" /&gt;
  
      &lt;TextView
          android:id="@+id/textView7"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:text="@string/redirect_number" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>