title: Changing viewPager swipe direction
body: <p>I'm using TabLayout and viewPager with an option to swipe the viewPager to the left or right in order to navigate between pages.</p>
  
  <p>My problem is, that my application is RTL based (right-to-left) and the swipe direction is reversed.</p>
  
  <p>I'm trying to change the swipe direction from the default to the reversed version.
  I've been searching alot on the web and couldn't find a way how to do it.</p>
  
  <p>I'm using <code>android.support.v4.view.ViewPager;</code></p>
  
  <p>and this is how I initialize my TabLayout with the viewPager:</p>
  
  <pre><code>// View Page Adapter
          final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
          final PagerAdapter adapter = new PagerAdapter
                  (getSupportFragmentManager(), tabLayout.getTabCount());
          //View Page Adapter Configuration
          viewPager.setAdapter(adapter);
          viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
          viewPager.setOffscreenPageLimit(3);
          tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
              @Override
              public void onTabSelected(TabLayout.Tab tab) {
                  viewPager.setCurrentItem(tab.getPosition());
              }
  </code></pre>
  
  <p>Summary: Currently, When I'm swiping the viewPager to the left, it shows the next page.
  in RTL, when you swipe the viewPager to the right, it shows the next page.</p>
  
  <p>It might be hard to understand, but here it is.
  <strong>Swiping right shows the next page</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SZqnI.png"><img src="https://i.stack.imgur.com/SZqnI.png" alt="Swiping right shows the next page"></a></p>
  
  <p>while I need swiping right to show the <strong>previous page</strong>.</p>