本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshBase.State.OVERSCROLLING属性的典型用法代码示例。如果您正苦于以下问题:Java State.OVERSCROLLING属性的具体用法?Java State.OVERSCROLLING怎么用?Java State.OVERSCROLLING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.handmark.pulltorefresh.library.PullToRefreshBase.State
的用法示例。
在下文中一共展示了State.OVERSCROLLING属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: overScrollBy
public static void overScrollBy(PullToRefreshBase<?> view, int deltaX, int scrollX, int
deltaY, int scrollY, int scrollRange, int fuzzyThreshold, float scaleFactor, boolean
isTouchEvent) {
int deltaValue;
int scrollValue;
int currentScrollValue;
switch (view.getPullToRefreshScrollDirection()) {
case HORIZONTAL:
deltaValue = deltaX;
scrollValue = scrollX;
currentScrollValue = view.getScrollX();
break;
default:
deltaValue = deltaY;
scrollValue = scrollY;
currentScrollValue = view.getScrollY();
break;
}
if (view.isPullToRefreshOverScrollEnabled() && !view.isRefreshing()) {
Mode mode = view.getMode();
if (mode.permitsPullToRefresh() && !isTouchEvent && deltaValue != 0) {
int newScrollValue = deltaValue + scrollValue;
if (newScrollValue < 0 - fuzzyThreshold) {
if (mode.showHeaderLoadingLayout()) {
if (currentScrollValue == 0) {
view.setState(State.OVERSCROLLING, new boolean[0]);
}
view.setHeaderScroll((int) (((float) (currentScrollValue +
newScrollValue)) * scaleFactor));
}
} else if (newScrollValue > scrollRange + fuzzyThreshold) {
if (mode.showFooterLoadingLayout()) {
if (currentScrollValue == 0) {
view.setState(State.OVERSCROLLING, new boolean[0]);
}
view.setHeaderScroll((int) (((float) ((currentScrollValue +
newScrollValue) - scrollRange)) * scaleFactor));
}
} else if (Math.abs(newScrollValue) <= fuzzyThreshold || Math.abs(newScrollValue
- scrollRange) <= fuzzyThreshold) {
view.setState(State.RESET, new boolean[0]);
}
} else if (isTouchEvent && State.OVERSCROLLING == view.getState()) {
view.setState(State.RESET, new boolean[0]);
}
}
}