title: ViewPager2 when set height then swipe not work
body: <p>Android Studio 3.6</p>
  
  <p>I want to use <strong>ViewPager2</strong> to swipe images:</p>
  
  <p>here xml layout:</p>
  
  <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id="@+id/waitressCallMainContainer"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;include
              android:id="@+id/toolBarContainer"
              layout="@layout/tool_bar"
              android:title='@{@string/articles}'
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
          &lt;androidx.viewpager2.widget.ViewPager2
              android:id="@+id/viewPager2"
              android:layout_width="0dp"
              android:layout_height="0dp"
              android:background="#bbccaa"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/toolBarContainer" /&gt;
  </code></pre>
  
  <p>here adapter item layout (<strong>article_item_tour.xml</strong>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/imageTourPageMainContainer"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ImageView
          android:id="@+id/tourArticleImageView"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:scaleType="centerCrop"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>here my custom adapter:</p>
  
  <pre><code>class MyAdapter : RecyclerView.Adapter&lt;MyAdapter .ArticleViewHolder&gt;() {
      var articleList: List&lt;Article&gt; = listOf()
  
  
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ArticleViewHolder {
          return ArticleViewHolder(parent)
      }
  
      override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
          holder.bind(articleList[position], position)
      }
  
      fun setList(articleList: List&lt;Article&gt;) {
          this.articleList = articleList
          notifyDataSetChanged()
      }
  
      override fun getItemCount(): Int = articleList.size
  
      class MyViewHolderconstructor(itemView: View) : RecyclerView.ViewHolder(itemView) {
          constructor(parent: ViewGroup) :
                  this(
                      LayoutInflater.from(parent.context).inflate(
                          R.layout.article_item_tour,
                          parent,
                          false
                      )
                  )
  
          fun bind(article: Article, number: Int) {
              Glide.with(itemView.tourArticleImageView.getContext())
                  .load("http://www.gravatar.com/avatar/$number?s=200x200&amp;d=identicon")
                  .apply(RequestOptions().error(R.drawable.default_image))
                  .into(itemView.tourArticleImageView)
          }
      }
  }
  </code></pre>
  
  <p>And here result:</p>
  
  <p><a href="https://i.stack.imgur.com/fWJtJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fWJtJ.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/R0KIY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R0KIY.png" alt="enter image description here"></a></p>
  
  <p>As you can see the ViewPager2 success swipe 2 images. Nice.</p>
  
  <p>but I want to set height of viewpager = 300 dp. I'm not need to show image at whole screen.</p>
  
  <p>So here changes:</p>
  
  <pre><code> &lt;androidx.viewpager2.widget.ViewPager2
              android:id="@+id/viewPager2"
              android:layout_width="0dp"
              android:layout_height="300dp"
              android:background="#bbccaa"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/toolBarContainer" /&gt;
  </code></pre>
  
  <p>But now <strong>images not show</strong>. Show only ViewPager2 (green background). And as result no swipe.</p>
  
  <p><a href="https://i.stack.imgur.com/UlwQn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UlwQn.png" alt="enter image description here"></a></p>