WrapContentViewPager Details By using this your viewpager can be wraped according to the current selected Fragment's view. You don't need to write extra code. Just follow the sample app steps and enjoy :) Sample Demo