public int getScreenForView(View v) {
		int result = -1;
		if (v != null) {
			ViewParent vp = v.getParent();
			int count = getChildCount();
			for (int i = 0; i < count; i++) {
				if (vp == getChildAt(i)) {
					return i;
				}
			}
		}
		return result;
	}
Snap pager to the specified page.

@param whichPage
           Zero based index of the page.
@param duration
           Duration in milliseconds of scrolling to the chosen page.
app/src/main/java/pro/alexzaitsev/freepager/library/view/core/VerticalPager.java