android.support.v4.view.ViewCompat#setOverScrollMode ( )源码实例Demo

下面列出了android.support.v4.view.ViewCompat#setOverScrollMode ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

public void setOverScrollMode(int overScrollMode) {
    if (overScrollMode < ViewCompat.OVER_SCROLL_ALWAYS || overScrollMode > ViewCompat.OVER_SCROLL_NEVER)
        throw new IllegalArgumentException("Unknown overscroll mode: " + overScrollMode);
    if (this.view == null) throw new IllegalStateException("view == null");
    this.overScrollMode = overScrollMode;
    ViewCompat.setOverScrollMode(view, overScrollMode);
}
 
源代码2 项目: beaconloc   文件: WrapLinearLayoutManager.java
public void setOverScrollMode(int overScrollMode) {
    if (overScrollMode < ViewCompat.OVER_SCROLL_ALWAYS || overScrollMode > ViewCompat.OVER_SCROLL_NEVER)
        throw new IllegalArgumentException("Unknown overscroll mode: " + overScrollMode);
    if (this.view == null) throw new IllegalStateException("view == null");
    this.overScrollMode = overScrollMode;
    ViewCompat.setOverScrollMode(view, overScrollMode);
}
 
源代码3 项目: Loop   文件: CustomLinearLayoutManager.java
public void setOverScrollMode(int overScrollMode) {
    if (overScrollMode < ViewCompat.OVER_SCROLL_ALWAYS || overScrollMode > ViewCompat.OVER_SCROLL_NEVER)
        throw new IllegalArgumentException("Unknown overscroll mode: " + overScrollMode);
    if (this.view == null) throw new IllegalStateException("view == null");
    this.overScrollMode = overScrollMode;
    ViewCompat.setOverScrollMode(view, overScrollMode);
}
 
源代码4 项目: MultiView   文件: TouchChildPagerLayoutManager.java
@Override
public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State state) {
    final int layoutDirection = dx > 0 ? 1 : -1;
    View currView = getCurrentPageView();
    //check if we need to work with the child view
    if (recyclerView != null && currView != null && currView.canScrollHorizontally(layoutDirection)
            && ((layoutDirection == 1 && currView.getLeft() <= 0) ||
            (layoutDirection == -1 && currView.getRight() >= currView.getWidth()))
            ) {
        dOffset = 0;
        if (lastTouchEvent != null) {
            currView.dispatchTouchEvent(lastTouchEvent);
            lastTouchEvent = null;
        }
        ViewCompat.setOverScrollMode(recyclerView, ViewCompat.OVER_SCROLL_NEVER);

        if ((layoutDirection == 1 && currView.getLeft() < 0) || (layoutDirection == -1 && currView.getRight() > currView.getWidth())) {
            adjust();
        }
        return 0;
    } else if (Math.abs(dOffset + dx) < triggPx &&
            recyclerView != null && currView != null &&
            currView.getLeft() == 0 && currView.getRight() == currView.getWidth()
            ) {
        dOffset += dx;
        if (lastTouchEvent != null) {
            currView.dispatchTouchEvent(lastTouchEvent);
            lastTouchEvent = null;
        }
        ViewCompat.setOverScrollMode(recyclerView, ViewCompat.OVER_SCROLL_NEVER);
        return 0;
    } else {
        dOffset = 0;
        ViewCompat.setOverScrollMode(recyclerView, ViewCompat.OVER_SCROLL_ALWAYS);
        return super.scrollHorizontallyBy(dx, recycler, state);
    }
}
 
源代码5 项目: MultiView   文件: TouchChildPagerLayoutManager.java
@Override
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
    final int layoutDirection = dy > 0 ? 1 : -1;
    View currView = getCurrentPageView();
    //check if we need to work with the child view
    if (recyclerView != null && currView != null && currView.canScrollVertically(layoutDirection)
            && ((layoutDirection == 1 && currView.getTop() <= 0) ||
            (layoutDirection == -1 && currView.getBottom() >= currView.getHeight()))
            ) {
        dOffset = 0;
        if (lastTouchEvent != null) {
            currView.dispatchTouchEvent(lastTouchEvent);
            lastTouchEvent = null;
        }
        ViewCompat.setOverScrollMode(recyclerView, ViewCompat.OVER_SCROLL_NEVER);
        if ((layoutDirection == 1 && currView.getTop() < 0) ||
                (layoutDirection == -1 && currView.getBottom() > currView.getHeight())) {
            adjust();
        }
        return 0;
    } else if (Math.abs(dOffset + dy) < triggPy &&
            recyclerView != null && currView != null &&
            currView.getTop() == 0 && currView.getBottom() == currView.getHeight()
            ) {
        dOffset += dy;
        if (lastTouchEvent != null) {
            currView.dispatchTouchEvent(lastTouchEvent);
            lastTouchEvent = null;
        }
        ViewCompat.setOverScrollMode(recyclerView, ViewCompat.OVER_SCROLL_NEVER);
        return 0;
    } else {
        dOffset = 0;
        ViewCompat.setOverScrollMode(recyclerView, ViewCompat.OVER_SCROLL_ALWAYS);
        return super.scrollVerticallyBy(dy, recycler, state);
    }
}
 
源代码6 项目: MultiView   文件: LinearLayoutManager2.java
public void setOverScrollMode(int overScrollMode) {
    if (overScrollMode < ViewCompat.OVER_SCROLL_ALWAYS || overScrollMode > ViewCompat.OVER_SCROLL_NEVER)
        throw new IllegalArgumentException("Unknown overscroll mode: " + overScrollMode);
    if (this.view == null) throw new IllegalStateException("view == null");
    this.overScrollMode = overScrollMode;
    ViewCompat.setOverScrollMode(view, overScrollMode);
}
 
源代码7 项目: BlueBoard   文件: MyLinearLayoutManager.java
public void setOverScrollMode(int overScrollMode) {
    if (overScrollMode < ViewCompat.OVER_SCROLL_ALWAYS || overScrollMode > ViewCompat.OVER_SCROLL_NEVER)
        throw new IllegalArgumentException("Unknown overscroll mode: " + overScrollMode);
    if (this.view == null) throw new IllegalStateException("view == null");
    this.overScrollMode = overScrollMode;
    ViewCompat.setOverScrollMode(view, overScrollMode);
}
 
public void setOverScrollMode(int overScrollMode) {
    if (overScrollMode < ViewCompat.OVER_SCROLL_ALWAYS || overScrollMode > ViewCompat.OVER_SCROLL_NEVER)
        throw new IllegalArgumentException("Unknown overscroll mode: " + overScrollMode);
    if (this.view == null) throw new IllegalStateException("view == null");
    this.overScrollMode = overScrollMode;
    ViewCompat.setOverScrollMode(view, overScrollMode);
}
 
 同类方法