title: ViewPager scroll half screen
body: <p>I have a list of Fragments that I have to put in a ViewPager (no problem so far).</p>
  
  <pre><code>ArrayList&lt;Fragment&gt;  fragmentList = new ArrayList&lt;Fragment&gt;();
  fragmentList.add(new fragment1());
  fragmentList.add(new fragment2());
  fragmentList.add(new fragment3());
  fragmentList.add(new fragment4());
  FragmentAdapter mAdapter = new FragmentAdapter( mFragmentManager, fragmentList);
  mPager = (ViewPager) view.findViewById(R.id.pager_items_list);
  mPager.setCurrentItem(0);
  mPager.setAdapter(mAdapter);
  mPager.setOnPageChangeListener(pageChangeListener);
  </code></pre>
  
  <p>The adapter</p>
  
  <pre><code>public class FragmentAdapter extends FragmentStatePagerAdapter {
      ArrayList&lt;Fragment&gt; fragmentsList;
      public FragmentAdapter(FragmentManager fm, ArrayList&lt;Fragment&gt; fragmentsList) {
          super(fm);
          this.fragmentsList = fragmentsList;
      }
      @Override
      public int getCount() { 
          return fragmentsList.size(); 
      }       
      @Override
      public Fragment getItem(int position) {
          if (position&lt;fragmentsList.size() &amp; fragmentsList.get(position)!=null) {
              return fragmentsList.get(position);
          }
          return null;
      }
  }
  </code></pre>
  
  <p>What I need is to make the ViewPager to show two items on the screen, but scroll only by one every time.</p>
  
  <p>This image may help me explain what I mean: 
  <img src="https://i.stack.imgur.com/BOyPQ.png" alt="Half screen scroll ViewPager"></p>