private void propagateScroll(int scrollY) { // Set scrollY for the fragments that are not created yet mPagerAdapter.setScrollY(scrollY); // Set scrollY for the active fragments for (int i = 0; i < mPagerAdapter.getCount(); i++) { // Skip current item if (i == mPager.getCurrentItem()) { continue; } // Skip destroyed or not created item FlexibleSpaceWithImageBaseFragment f = (FlexibleSpaceWithImageBaseFragment) mPagerAdapter.getItemAt(i); if (f == null) { continue; } View view = f.getView(); if (view == null) { continue; } f.setScrollY(scrollY, mFlexibleSpaceHeight); f.updateFlexibleSpace(scrollY); } }