Skip to content

Commit

Permalink
处理ConsecutiveViewPager
Browse files Browse the repository at this point in the history
  • Loading branch information
teach committed May 27, 2020
1 parent cdded30 commit c912ef9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ConsecutiveViewPager(@NonNull Context context, @Nullable AttributeSet att

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (isAdjust() && mAdjustHeight > 0) {
if (isConsecutiveParent() && mAdjustHeight > 0) {
ConsecutiveScrollerLayout layout = (ConsecutiveScrollerLayout) getParent();
int parentHeight = layout.getMeasuredHeight();
int height = Math.min(parentHeight - mAdjustHeight, getDefaultSize(0, heightMeasureSpec));
Expand All @@ -42,7 +42,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}
}

private boolean isAdjust() {
private boolean isConsecutiveParent() {
ViewParent parent = getParent();
if (parent instanceof ConsecutiveScrollerLayout) {
ConsecutiveScrollerLayout layout = (ConsecutiveScrollerLayout) parent;
Expand Down

0 comments on commit c912ef9

Please sign in to comment.