title: android viewpager lags when swiping and loading data
body: <p>I have several pages some 8 pages on my dashboard containing viewpager and all have recycler view on it. The problem is when I swipe through viewpager, both swiping and recycler view setting adapter on the page happens at the same time on same ui thread due to which swiping lags and hence there is no smooth swiping and loading experience.</p>
  
  <p>Things I tried using:<br>
  1. I tried putting delay to load the data but when swiping through, the previous fragment loads data due to which the ui lags again.<br>
  2. I also used setoffscreenpagelimit but I have some 8 pages and loading all at once or even some takes time to open the dashboard.<br>
  3. I tried using addOnPageChangeListener of the viewpager. But it lags the most.</p>
  
  <p>Currently i am loading data when fragment is visible i.e in setUserVisibleHint method. I want to have a smooth swiping and loading experience. Help needed.</p>
  
  <p>Thanks very much.</p>