title: Android RadioButton *with* icon and center aligned
body: <p>Is it possible to create a horizontal RadioGroup, with RadioButtons where each button includes a radio, icon, and text, and <strong>these three items are vertically-center-aligned with each other</strong>?  </p>
  
  <p>I have tried to set the <code>gravity</code> and <code>layout_gravity</code> on the <code>RadioGroup</code> and the <code>RadioButtons</code>, as well as the <code>layout_weight</code> on each button, etc, to no avail.  WHYYY is this so difficult on Android?  </p>
  
  <p><a href="https://i.stack.imgur.com/6GPXT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6GPXT.png" alt="enter image description here"></a></p>
  
  <p>^ I want the radio buttons centered with the icons and titles.  </p>
  
  <p>I need the entire area to be selectable, so <strong>I'd really like to set the RadioButton's icon and text values</strong>, rather than add separate ImageViews the UI.  I want to use RadioGroup because I am using this in a custom <code>Preference</code> item, so the selection and persistence are handled nicely for me.  </p>
  
  <p>Here is the XML</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@android:id/widget_frame"
      style="@style/AppTheme"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/colorPrimaryDark"
      android:theme="@style/AppTheme"
      tools:context=".settings.homeScreenPreference"&gt;
  
      &lt;TextView
          android:id="@+id/title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@color/colorPrimaryDark"
          android:text="@string/set_home_screen" /&gt;
  
      &lt;!--Settings icon--&gt;
      &lt;ImageView
          android:id="@+id/settingsIcon"
          android:layout_width="0dp"
          android:layout_height="80dp"
          android:contentDescription="@string/settings_icon_description"
          android:drawable="@drawable/ic_settings"
          android:tint="@color/colorAccent"
          app:layout_constraintBottom_toTopOf="@id/settingsTitle"
          app:layout_constraintEnd_toStartOf="@+id/diidsIcon"
          app:layout_constraintHorizontal_chainStyle="spread"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@id/title"
          tools:srcCompat="@drawable/ic_settings" /&gt;
  
      &lt;!--Cards icon--&gt;
      &lt;ImageView
          android:id="@+id/diidsIcon"
          android:layout_width="0dp"
          android:layout_height="80dp"
          android:contentDescription="@string/my_cards_icon_description"
          android:drawable="@drawable/ic_my_cards"
          android:tint="@color/colorAccent"
          app:layout_constraintBottom_toTopOf="@id/home_screen_radio_group"
          app:layout_constraintEnd_toStartOf="@+id/scannerIcon"
          app:layout_constraintStart_toEndOf="@+id/settingsIcon"
          app:layout_constraintTop_toBottomOf="@id/title"
          tools:srcCompat="@drawable/ic_my_cards" /&gt;
  
      &lt;!--Scanner icon--&gt;
      &lt;ImageView
          android:id="@+id/scannerIcon"
          android:layout_width="0dp"
          android:layout_height="80dp"
          android:contentDescription="@string/scanner_icon_description"
          android:drawable="@drawable/ic_scan_qr"
          android:tint="@color/colorAccent"
          app:layout_constraintBottom_toTopOf="@id/home_screen_radio_group"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toEndOf="@+id/diidsIcon"
          app:layout_constraintTop_toBottomOf="@id/title"
          tools:srcCompat="@drawable/ic_scan_qr" /&gt;
  
      &lt;!--Settings title--&gt;
      &lt;TextView
          android:id="@+id/settingsTitle"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:text="@string/settings"
          android:textAlignment="center"
          android:textColor="@color/colorAccent"
          app:layout_constraintBottom_toTopOf="@id/home_screen_radio_group"
          app:layout_constraintEnd_toStartOf="@+id/diidsTitle"
          app:layout_constraintHorizontal_chainStyle="spread"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@id/settingsIcon" /&gt;
  
      &lt;!--Cards title--&gt;
      &lt;TextView
          android:id="@+id/diidsTitle"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:text="@string/my_cards"
          android:textAlignment="center"
          android:textColor="@color/colorAccent"
          app:layout_constraintBottom_toTopOf="@id/home_screen_radio_group"
          app:layout_constraintEnd_toStartOf="@+id/scannerTitle"
          app:layout_constraintStart_toEndOf="@+id/settingsTitle"
          app:layout_constraintTop_toBottomOf="@id/diidsIcon" /&gt;
  
      &lt;!--Scanner title--&gt;
      &lt;TextView
          android:id="@+id/scannerTitle"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:text="@string/scan_code"
          android:textAlignment="center"
          android:textColor="@color/colorAccent"
          app:layout_constraintBottom_toTopOf="@id/home_screen_radio_group"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toEndOf="@+id/diidsTitle"
          app:layout_constraintTop_toBottomOf="@id/scannerIcon" /&gt;
  
      &lt;!--Radio group--&gt;
      &lt;RadioGroup
          android:id="@+id/home_screen_radio_group"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:background="@color/colorPrimaryDark"
          android:gravity="center"
          android:orientation="horizontal"
          app:layout_constraintTop_toBottomOf="@id/settingsTitle"&gt;
  
          &lt;!--Settings radio--&gt;
          &lt;RadioButton
              android:id="@+id/settingsButton"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:buttonTint="@color/colorAccent" /&gt;
  
          &lt;!--Cards radio--&gt;
          &lt;RadioButton
              android:id="@+id/diidsButton"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:buttonTint="@color/colorAccent" /&gt;
  
          &lt;!--Scanner radio--&gt;
          &lt;RadioButton
              android:id="@+id/scannerButton"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:layout_weight="1"
              android:buttonTint="@color/colorAccent"/&gt;
      &lt;/RadioGroup&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>