title: ConstraintLayout with DataBinding incorrect width in RecyclerView
body: <p>I am trying to play around with new ConstraintLayout. And I made the layout for my RecyclerView's row. It has ConstraintLayout as root element which width is set to <code>match_parent</code> and when I run my app it renders just as expected</p>
  
  <p><a href="https://i.stack.imgur.com/zOxWv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zOxWv.png" alt="correct width"></a> </p>
  
  <p>It works well until I put data binding section in my XML and the root element henceforth is <code>layout</code> tag which wraps ConstraintLayout and it results in some unpredictable change in behavior of ConstraintLayout - it's width henceforth doesn't renders as <code>match_parent</code>, it only takes small part of display width, though it's still set to <code>match_parent</code> in XML. I also tried to set width to some fixed value and the result was the same</p>
  
  <p><a href="https://i.stack.imgur.com/AuFth.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AuFth.png" alt="enter image description here"></a></p>
  
  <p>I suspect that Data Binding processor kinda strips attributes from ConstrainLayout when process layouts during the build process. Is there any way to get things work correctly?
  My layout </p>
  
  <pre><code>&lt;layout xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
      &lt;data&gt;
          &lt;import type="android.view.View"/&gt;
          &lt;variable
              name="post"
              type=".entity.Post"/&gt;
          &lt;variable
              name="data"
              type=".entity.LinkPostData"/&gt;
      &lt;/data&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:id="@+id/constraintLayout"
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingTop="16dp"&gt;
          ....
      &lt;/android.support.constraint.ConstraintLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>And adapter:</p>
  
  <pre><code>class PostsAdapter(): RecyclerView.Adapter&lt;PostsAdapter.PostItemViewHolder&gt;() {
  
      private val posts: MutableList&lt;Post&gt; = ArrayList()
  
      fun setPosts(domains: List&lt;Post&gt;) {
          this.posts.clear()
          this.posts.addAll(domains)
          notifyDataSetChanged()
      }
  
      override fun getItemViewType(position: Int): Int {
          return super.getItemViewType(position)
      }
  
      override fun onBindViewHolder(holder: PostItemViewHolder?, position: Int) {
          val post = posts[position]
  
          holder?.binding?.post = post
          holder?.binding?.data = post.data as LinkPostData
          holder?.binding?.executePendingBindings()
      }
  
      override fun getItemCount() = this.posts.size
  
      override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): PostItemViewHolder {
          val binding = ItemPostBinding.inflate(LayoutInflater.from(parent?.context))
          return PostItemViewHolder(binding)
      }
  
      class PostItemViewHolder(val binding: ItemPostBinding): RecyclerView.ViewHolder(binding.root) {
  
      }
  }
  </code></pre>