title: How to change page without animation in a TabLayout setup with ViewPager?
body: <p>I have <code>TabLayout</code> setup with a <code>ViewPager</code>. When I select a tab the <code>ViewPager</code> scroll to the selected page with animation (showing all the pages in between current page and selected page). I want <code>ViewPager</code> to directly jump to the selected page.</p>
  
  <p>I know I can use <code>viewPager.setCurrentItem(1, false)</code> to disable <code>smoothScroll</code>. But I want to change the default behavior to disable <code>smoothScroll</code> effect on <code>ViewPager</code></p>
  
  <p>Here is what I have done.</p>
  
  <pre><code>val mSectionsPagerAdapter = SectionsPagerAdapter(supportFragmentManager)
  
          vp!!.adapter = mSectionsPagerAdapter
          vp!!.addOnPageChangeListener(object: ViewPager.OnPageChangeListener {
              override fun onPageScrollStateChanged(state: Int) {
              }
  
              override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
              }
  
              override fun onPageSelected(position: Int) {
                  when (position) {
                      0 -&gt; supportActionBar!!.title = "Page 1"
                      1 -&gt; supportActionBar!!.title = "Page 2"
                      2 -&gt; supportActionBar!!.title = "Page 3"
                      3 -&gt; supportActionBar!!.title = "Page 4"
                  }
              }
          })
  
          tabLayout.setupWithViewPager(vp)
  </code></pre>