title: Dynamic Center Aligned ViewPager
body: <p>I'm having trouble aligning the fragments to the center of the view pages, in a way that the user can see multiple fragments on the screen. This problem has already been solved before, but not when the fragments have different size.</p>
  
  <p><a href="https://stackoverflow.com/questions/9468581/can-viewpager-have-multiple-views-in-per-page">Can ViewPager have multiple views in per page?</a> is one link that I used. The pagercontainer solution on it works but is very slow. My solution was to set ViewPager padding through <code>setPadding(int, int, int, int)</code> method and <code>false</code> for <code>setClipToPadding</code>. Doing so makes the fragments look as if they're aligned in the center, but assumes that all fragments are the same size (since <code>setPadding</code> is a global setting for a <code>View</code>). So having different fragment sizes just completely messes the alignment. </p>
  
  <p>I was hoping if someone knew how to make it so that the current fragment in view pager can be aligned to center without the use of padding. That way one could have different fragment sizes. Alternatively, could someone suggest how to achieve center alignment with padding with variable fragment sizes?</p>
  
  <p>PS: I've searched everywhere online and couldn't find a solution.</p>