Code example for ListView

Methods: getFirstVisiblePosition

0
			childView = this.getChildAt(1);
			if (childView instanceof ListView) {
				int top = ((ListView) childView).getChildAt(0).getTop();
				int pad = ((ListView) childView).getListPaddingTop();
				if ((Math.abs(top - pad)) < 3
						&& ((ListView) childView).getFirstVisiblePosition() == 0) {
					return true; 
				} else { 
					return false; 
				} 
			} else if (childView instanceof ScrollView) {
				if (((ScrollView) childView).getScrollY() == 0 && diff > 0) {
					nowpull = 0;
					return true; 
				} else if ((((ScrollView) childView).getChildAt(0)
						.getMeasuredHeight() <= ((ScrollView) childView)
						.getScrollY() + getHeight())
						&& diff < 0) {
					nowpull = 1;
					return true; 
				} else {