title: Wrap_content view inside a ConstraintLayout stretches outside the screen
body: <p>I am trying to implement a simple chat bubble using a <code>ConstraintLayout</code>. This is what I am trying to achieve:</p>
  <p><a href="https://i.stack.imgur.com/J2EJOm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/J2EJOm.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/0GsnMm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0GsnMm.png" alt="enter image description here" /></a></p>
  <p>However, <code>wrap_content</code> does not do what I want. It respects the margins, but expands outside of the view bounds. Here is my layout:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;android.support.constraint.ConstraintLayout   xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;&gt;
  
      &lt;TextView
          android:id=&quot;@+id/chat_message&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:padding=&quot;16dp&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
          app:layout_constraintRight_toRightOf=&quot;parent&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          app:layout_constraintHorizontal_bias=&quot;0&quot;
          tools:background=&quot;@drawable/chat_message_bubble&quot;
          tools:text=&quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sodales accumsan tortor at bibendum.&quot;
          android:layout_marginStart=&quot;64dp&quot;
          android:layout_marginLeft=&quot;64dp&quot;
          android:layout_marginEnd=&quot;32dp&quot;
          android:layout_marginRight=&quot;32dp&quot;
          android:layout_marginTop=&quot;8dp&quot;
          android:layout_marginBottom=&quot;8dp&quot; /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  <p>This renders as follows:</p>
  <p><a href="https://i.stack.imgur.com/s80iSm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/s80iSm.png" alt="enter image description here" /></a></p>
  <p>I am using <code>com.android.support.constraint:constraint-layout:1.0.0-beta4</code>.</p>
  <p>Am I doing something wrong? Is it a bug or just an unintuitive behavior? Can I achieve the proper behavior using a <code>ConstraintLayout</code> (I know I can use other layouts, I am asking about <code>ConstrainLayout</code> specifically).</p>