title: Change ViewPager2 Scroll Speed when sliding programmatically
body: <p>I know there is way to change animation duration of <code>ViewPager</code> programmatical slide (<a href="https://stackoverflow.com/a/9731345/4565796">here</a>).</p>
  
  <p>But its not working on <code>ViewPager2</code> </p>
  
  <p>I tried this:</p>
  
  <pre><code>try {
          final Field scrollerField = ViewPager2.class.getDeclaredField("mScroller");
          scrollerField.setAccessible(true);
          final ResizeViewPagerScroller scroller = new ResizeViewPagerScroller(getContext());
          scrollerField.set(mViewPager, scroller);
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>IDE gives me warning on "mScroller":</p>
  
  <blockquote>
    <p>Cannot resolve field 'mScroller'</p>
  </blockquote>
  
  <p>If we Run This code thats not going to work and give us Error below:</p>
  
  <pre><code>No field mScroller in class Landroidx/viewpager2/widget/ViewPager2; (declaration of 'androidx.viewpager2.widget.ViewPager2' appears in /data/app/{packagename}-RWJhF9Gydojax8zFyFwFXg==/base.apk)
  </code></pre>
  
  <p>So how we can acheive this functionality?</p>