Skip to content

Commit

Permalink
改bug
Browse files Browse the repository at this point in the history
  • Loading branch information
teach committed Aug 11, 2021
1 parent e7b1d6f commit 7cba987
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public class ConsecutiveScrollerLayout extends ViewGroup implements ScrollingVie
private boolean isPermanent;

/**
* 禁用子view的水平滑动,如果ConsecutiveScrollerLayout下没有需要水平滑动的子view,应该把它设置为true
* 为true时,将不会分发滑动事件给子view,而是有ConsecutiveScrollerLayout处理,可以优化ConsecutiveScrollerLayout的滑动
* 禁用子view的水平滑动,如果ConsecutiveScrollerLayout下没有水平滑动的下级view,应该把它设置为true
* 为true时,将不会分发滑动事件给子view,而是由ConsecutiveScrollerLayout处理,可以优化ConsecutiveScrollerLayout的滑动
*/
private boolean disableChildHorizontalScroll;

Expand Down Expand Up @@ -277,6 +277,9 @@ public ConsecutiveScrollerLayout(Context context, AttributeSet attrs, int defSty
mChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
setChildrenDrawingOrderEnabled(true);

setMotionEventSplittingEnabled(false);

}

@Override
Expand Down Expand Up @@ -2317,6 +2320,23 @@ public boolean isPermanent() {
return isPermanent;
}


public boolean isDisableChildHorizontalScroll() {
return disableChildHorizontalScroll;
}

/**
* 禁用子view的水平滑动,如果ConsecutiveScrollerLayout下没有水平滑动的下级view,应该把它设置为true
* 为true时,将不会分发滑动事件给子view,而是由ConsecutiveScrollerLayout处理,可以优化ConsecutiveScrollerLayout的滑动
* 注意:如果你的ConsecutiveScrollerLayout下使用了ViewPager、HorizontalScrollView、水平滑动RecyclerView等,
* 就不要设置disableChildHorizontalScroll为true.因为它会禁止水平滑动
*
* @param disableChildHorizontalScroll
*/
public void setDisableChildHorizontalScroll(boolean disableChildHorizontalScroll) {
this.disableChildHorizontalScroll = disableChildHorizontalScroll;
}

/**
* 设置吸顶view到顶部的偏移量,允许吸顶view在距离顶部offset偏移量的地方吸顶停留。
*
Expand Down

0 comments on commit 7cba987

Please sign in to comment.