title: Can't figure out layout dependencies in Android
body: <p>I need to create a layout which should look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ZvEjq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZvEjq.png" alt=""></a> </p>
  
  <p><a href="https://i.stack.imgur.com/292x5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/292x5.png" alt=""></a></p>
  
  <p><a href="https://i.stack.imgur.com/zXFrD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zXFrD.png" alt=""></a></p>
  
  <ol>
  <li>The <code>TextView</code> content should be wrapped so the <code>ImageView</code> is always at the ent of the text. </li>
  <li><code>TextView</code> should not overlap with other views regardless of content.</li>
  <li><code>ImageView</code> can have visibility <code>GONE</code> during runtime, so <code>TextView</code> should use the space of <code>ImageView</code>.</li>
  </ol>
  
  <p>My current layout:</p>
  
  <pre><code>&lt;RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="48dp"
      android:background="@android:color/white"&gt;
  
      &lt;TextView
          android:id="@+id/pref_list_item_title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentStart="true"
          android:layout_centerVertical="true"
          android:layout_marginStart="16dp"
          android:fontFamily="sans-serif"
          android:text="Long long"
          android:textSize="@dimen/preference_text_size" /&gt;
  
      &lt;ImageView
          android:id="@+id/pref_list_item_help_button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_toEndOf="@id/pref_list_item_title"
          android:layout_centerVertical="true"
          android:layout_margin="8dp"
          android:src="@drawable/ic_help_primary_color"
          android:contentDescription="@string/help" /&gt;
  
      &lt;Switch
          android:id="@+id/pref_list_item_switch"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentEnd="true"
          android:layout_centerVertical="true"
          android:layout_marginEnd="16dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><code>ConstraintLayout</code> is an option, but I couldn't create constraints that satisfy my needs.</p>