NestedScrollingChildHelper的startNestedScroll函数 hasNestedScrollingParent:判断当前是否有正在进行嵌套滑动的父View,如果有的话说明当前正处于滑动状态,直接返回不用处理 判断isNestedScrollingEnabled...hasNestedScrollingParent(type)) { // Already in progress return true; } if (isNestedScrollingEnabled...int[] consumed, @Nullable int[] offsetInWindow, @NestedScrollType int type) { if (isNestedScrollingEnabled...dyUnconsumed, @Nullable int[] offsetInWindow, @NestedScrollType int type) { if (isNestedScrollingEnabled
* * @param enabled true to enable nested scrolling, false to disable * * @see #isNestedScrollingEnabled...If a nested scroll * is not currently in progress or nested scrolling is not * {@link #isNestedScrollingEnabled...* * @return true if nested scrolling is enabled for this view */ public boolean isNestedScrollingEnabled...int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) { if (isNestedScrollingEnabled...boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) { if (isNestedScrollingEnabled
setNestedScrollingEnabled(boolean enabled); /** * 判断嵌套滑动是否可用 */ @Override public boolean isNestedScrollingEnabled...mNestedScrollingChildHelper.setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled...() { return mNestedScrollingChildHelper.isNestedScrollingEnabled(); } @Override...getNestedScrollingChildHelper().setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled...() { return getNestedScrollingChildHelper().isNestedScrollingEnabled(); } @Override
: 在内控件处理完滑动后把剩下的滑动距离信息分发给外控件. stopNestedScroll : 结束方法, 主要作用就是清空嵌套滑动的相关状态 setNestedScrollingEnabled和isNestedScrollingEnabled...hasNestedScrollingParent(type)) { // Already in progress return true; } if (isNestedScrollingEnabled...Nullable int[] consumed, @Nullable int[] offsetInWindow, @NestedScrollType int type) { if (isNestedScrollingEnabled
boolean enabled) { mChildHelper.setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled...() { return mChildHelper.isNestedScrollingEnabled(); } @Override public boolean startNestedScroll...startNestedScroll(int axes) { if (hasNestedScrollingParent()) { // Already in progress return true; } if (isNestedScrollingEnabled...public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) { if (isNestedScrollingEnabled
) { if(this.hasNestedScrollingParent(type)) { return true; } else { if(this.isNestedScrollingEnabled...dispatchNestedPreScroll(int dx, int dy, @Nullable int[] consumed, @Nullable int[] offsetInWindow, int type) { if(this.isNestedScrollingEnabled
enabled) { getScrollingChildHelper().setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled...() { return getScrollingChildHelper().isNestedScrollingEnabled(); } @Override public boolean startNestedScroll...hasNestedScrollingParent()) { // Already in progress return true; } // 判断是否支持嵌套滑动,默认是支持的 if (isNestedScrollingEnabled...dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) { if (isNestedScrollingEnabled
If a nested scroll * is not currently in progress or nested scrolling is not * {@link #isNestedScrollingEnabled...// Already in progress return true; } // 支持嵌套滑动 if (isNestedScrollingEnabled...@Nullable int[] offsetInWindow, @NestedScrollType int type) { // 支持嵌套滑动 if (isNestedScrollingEnabled...offsetInWindow, @NestedScrollType int type, @Nullable int[] consumed) { // 可嵌套滑动 if (isNestedScrollingEnabled
public void setNestedScrollingEnabled(boolean enabled); /** * 判断是否启用嵌套滚动 */ public boolean isNestedScrollingEnabled
if (hasNestedScrollingParent()) { // Already in progress return true; } if (isNestedScrollingEnabled...true if nested scrolling is enabled * * @see #setNestedScrollingEnabled(boolean) */ public boolean isNestedScrollingEnabled...mPrivateFlags3 & PFLAG3_NESTED_SCROLLING_ENABLED) == PFLAG3_NESTED_SCROLLING_ENABLED; } 当 isNestedScrollingEnabled...if (view instanceof NestedScrollingChild) { return ((NestedScrollingChild) view).isNestedScrollingEnabled...if (hasNestedScrollingParent()) { // Already in progress return true; } if (isNestedScrollingEnabled
NestedScrollingChild { public void setNestedScrollingEnabled(boolean enabled); public boolean isNestedScrollingEnabled
enabled); } /** * 判断当前View能否滑动 * @return */ @Override public boolean isNestedScrollingEnabled...() { return mChildHelper.isNestedScrollingEnabled(); } /** * 启动嵌套滑动事件流 * 1.
boolean enabled) { mScrollingChildHelper.setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled...() { return mScrollingChildHelper.isNestedScrollingEnabled(); } @Override public boolean startNestedScroll
public interface NestedScrollingChild { void setNestedScrollingEnabled(boolean var1); boolean isNestedScrollingEnabled
ViewCompat.isNestedScrollingEnabled(mTarget))) { // Nope. } else { super.requestDisallowInterceptTouchEvent
public interface NestedScrollingChild2 { void setNestedScrollingEnabled(boolean enabled); boolean isNestedScrollingEnabled
getScrollingChildHelper().setNestedScrollingEnabled(enabled); } @Override public boolean isNestedScrollingEnabled...() { return getScrollingChildHelper().isNestedScrollingEnabled(); } @Override public
dy, @Nullable int[] consumed,@Nullable int[] offsetInWindow, @NestedScrollType int type) { if (isNestedScrollingEnabled
startNestedScroll, //NestedScrollingChildHelper.java boolean startNestedScroll(int axes, int type) { if (isNestedScrollingEnabled
领取专属 10元无门槛券
手把手带您无忧上云