Пример #1
0
		/// <returns>
		/// whether the descendant of this scroll view is within delta
		/// pixels of being on the screen.
		/// </returns>
		private bool isWithinDeltaOfScreen(android.view.View descendant, int delta)
		{
			descendant.getDrawingRect(mTempRect);
			offsetDescendantRectToMyCoords(descendant, mTempRect);
			return (mTempRect.right + delta) >= getScrollX() && (mTempRect.left - delta) <= (
				getScrollX() + getWidth());
		}
Пример #2
0
		/// <summary>Scrolls the view to the given child.</summary>
		/// <remarks>Scrolls the view to the given child.</remarks>
		/// <param name="child">the View to scroll to</param>
		private void scrollToChild(android.view.View child)
		{
			child.getDrawingRect(mTempRect);
			offsetDescendantRectToMyCoords(child, mTempRect);
			int scrollDelta = computeScrollDeltaToGetChildRectOnScreen(mTempRect);
			if (scrollDelta != 0)
			{
				scrollBy(scrollDelta, 0);
			}
		}
Пример #3
0
		/// <returns>
		/// whether the descendant of this scroll view is within delta
		/// pixels of being on the screen.
		/// </returns>
		private bool isWithinDeltaOfScreen(android.view.View descendant, int delta, int height
			)
		{
			descendant.getDrawingRect(mTempRect);
			offsetDescendantRectToMyCoords(descendant, mTempRect);
			return (mTempRect.bottom + delta) >= getScrollY() && (mTempRect.top - delta) <= (
				getScrollY() + height);
		}