Skip to content

Commit

Permalink
同步主分支的一些修改。
Browse files Browse the repository at this point in the history
  • Loading branch information
teach committed Nov 9, 2020
1 parent d8d070d commit 6e5cd9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ConsecutiveScrollerLayout extends ViewGroup implements ScrollingVie
/**
* 联动容器可滚动的范围
*/
private int mScrollRange;
int mScrollRange;

/**
* 联动容器滚动定位子view
Expand Down Expand Up @@ -1272,7 +1272,7 @@ private void checkTargetsScroll(boolean isLayoutChange, boolean isForce) {
*
* @param target
*/
private void scrollChildContentToTop(View target) {
void scrollChildContentToTop(View target) {
int scrollY = 0;
do {
scrollY = 0;
Expand All @@ -1290,7 +1290,7 @@ private void scrollChildContentToTop(View target) {
*
* @param target
*/
private void scrollChildContentToBottom(View target) {
void scrollChildContentToBottom(View target) {
int scrollY = 0;
do {
scrollY = 0;
Expand Down Expand Up @@ -1375,7 +1375,7 @@ private void recycleAdjustVelocityTracker() {
/**
* 停止滑动
*/
private void stopScroll() {
public void stopScroll() {
mScroller.abortAnimation();
stopNestedScroll(ViewCompat.TYPE_NON_TOUCH);
if (mScrollToIndex == -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ConsecutiveViewPager(@NonNull Context context, @Nullable AttributeSet att

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (isConsecutiveParent() && mAdjustHeight > 0) {
if (isConsecutiveParentAndBottom() && mAdjustHeight > 0) {
int height = getDefaultSize(0, heightMeasureSpec) - mAdjustHeight;
super.onMeasure(widthMeasureSpec,
View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.getMode(heightMeasureSpec)));
Expand Down Expand Up @@ -68,7 +68,12 @@ private void disableChildScroll(View child) {
ViewCompat.setNestedScrollingEnabled(child, false);
}

private boolean isConsecutiveParent() {
/**
* 是否在ConsecutiveScrollerLayout的底部
*
* @return
*/
private boolean isConsecutiveParentAndBottom() {
ViewParent parent = getParent();
if (parent instanceof ConsecutiveScrollerLayout) {
ConsecutiveScrollerLayout layout = (ConsecutiveScrollerLayout) parent;
Expand Down

0 comments on commit 6e5cd9a

Please sign in to comment.