protected int[] calculateCurrentCenterCoordinatesOfPagerElement(int activeElementIndex) { int y = (int)(mPagerIconsContainer.GetY() + mPagerIconsContainer.Height / 2); if (activeElementIndex >= mPagerIconsContainer.ChildCount) { return new int[] { mRootLayout.Width / 2, y } } ; View pagerElem = mPagerIconsContainer.GetChildAt(activeElementIndex); int x = (int)(mPagerIconsContainer.GetX() + pagerElem.GetX() + pagerElem.Width / 2); return(new int[] { x, y }); }