public void snapPageWhenLayoutIsReady(final int page) {
		/*
		 * VerticalPager is not fully initialized at the moment, so we want to
		 * snap to the central page only when it layout and measure all its
		 * pages.
		 */
		getViewTreeObserver().addOnGlobalLayoutListener(
				new OnGlobalLayoutListener() {
					@SuppressWarnings("deprecation")
					@Override
					public void onGlobalLayout() {
						getViewTreeObserver()
								.removeGlobalOnLayoutListener(this);

						snapToPage(page, PAGE_SNAP_DURATION);
					}
				});
	}
Adding functionality of program page spapping and infinite paging. Call
{@link instaniate()} to initialize.

@author A.Zaitsev
app/src/main/java/pro/alexzaitsev/freepager/library/view/infinite/AbstractInfiniteVerticalPager.java