本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshBase.Mode.showHeaderLoadingLayout方法的典型用法代码示例。如果您正苦于以下问题:Java Mode.showHeaderLoadingLayout方法的具体用法?Java Mode.showHeaderLoadingLayout怎么用?Java Mode.showHeaderLoadingLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.handmark.pulltorefresh.library.PullToRefreshBase.Mode
的用法示例。
在下文中一共展示了Mode.showHeaderLoadingLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLoadingLayoutProxy
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入方法依赖的package包/类
protected LoadingLayoutProxy createLoadingLayoutProxy(boolean includeStart, boolean
includeEnd) {
LoadingLayoutProxy proxy = super.createLoadingLayoutProxy(includeStart, includeEnd);
if (this.mListViewExtrasEnabled) {
Mode mode = getMode();
if (includeStart && mode.showHeaderLoadingLayout()) {
proxy.addLayout(this.mHeaderLoadingView);
}
if (includeEnd && mode.showFooterLoadingLayout()) {
proxy.addLayout(this.mFooterLoadingView);
}
}
return proxy;
}
示例2: overScrollBy
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; //导入方法依赖的package包/类
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]);
}
}
}