@Override public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) { return mChildHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow); }
@Override public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) { return mChildHelper.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow); }
mHeaderHeight = density.dip2px(100); mNestedChild.setNestedScrollingEnabled(true);//默认开启嵌套滚动 mNestedChild.setNestedScrollingEnabled(ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableNestedScrolling, mNestedChild.isNestedScrollingEnabled())); mDragRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlDragRate, mDragRate); mHeaderMaxDragRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlHeaderMaxDragRate, mHeaderMaxDragRate);
private void init() { setWillNotDraw(false); startScrollerTask(); setOverScrollMode(View.OVER_SCROLL_NEVER); childHelper = new NestedScrollingChildHelper(this); childHelper.setNestedScrollingEnabled(true); }
@Override public void stopNestedScroll() { mChildHelper.stopNestedScroll(); }
@Override public boolean startNestedScroll(int axes) { return mChildHelper.startNestedScroll(axes); }
@Override public boolean dispatchNestedFling(float velocityX, float velocityY, boolean consumed) { return mChildHelper.dispatchNestedFling(velocityX, velocityY, consumed); }
@Override public boolean dispatchNestedPreFling(float velocityX, float velocityY) { return mChildHelper.dispatchNestedPreFling(velocityX, velocityY); } }
@Override public boolean hasNestedScrollingParent() { return mChildHelper.hasNestedScrollingParent(); }
@Override public boolean isNestedScrollingEnabled() { return mNestedChild.isNestedScrollingEnabled(); }
@Override public void setNestedScrollingEnabled(boolean enabled) { // mManualNestedScrolling = true; mNestedChild.setNestedScrollingEnabled(enabled); }
private void init() { mChildHelper = new NestedScrollingChildHelper(this); setNestedScrollingEnabled(true); }
private void initData() { if (mScrollingChildHelper == null) { mScrollingChildHelper = new NestedScrollingChildHelper(this); mScrollingChildHelper.setNestedScrollingEnabled(true); } }
@Override public void stopNestedScroll() { mNestedScrollingChildHelper.stopNestedScroll(); }
@Override public boolean startNestedScroll(int axes) { return mNestedScrollingChildHelper.startNestedScroll(axes); }
@Override public boolean onNestedFling(@NonNull View target, float velocityX, float velocityY, boolean consumed) { return mNestedChild.dispatchNestedFling(velocityX, velocityY, consumed); }
@Override public boolean dispatchNestedPreFling(float velocityX, float velocityY) { return mNestedScrollingChildHelper.dispatchNestedPreFling(velocityX, velocityY); }
@Override public boolean hasNestedScrollingParent() { return mNestedScrollingChildHelper.hasNestedScrollingParent(); }
@Override public boolean isNestedScrollingEnabled() { return mChildHelper.isNestedScrollingEnabled(); }
@Override public void setNestedScrollingEnabled(boolean enabled) { mChildHelper.setNestedScrollingEnabled(enabled); }