Skip to content

Commit

Permalink
修改onLayout的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
teach committed Apr 3, 2020
1 parent 29418f4 commit ca1b3b2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public ConsecutiveScrollerLayout(Context context, AttributeSet attrs) {
public ConsecutiveScrollerLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);

mScroller = new OverScroller(getContext(),sQuinticInterpolator);
mScroller = new OverScroller(getContext(), sQuinticInterpolator);
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
mMaximumVelocity = viewConfiguration.getScaledMaximumFlingVelocity();
mMinimumVelocity = viewConfiguration.getScaledMinimumFlingVelocity();
Expand Down Expand Up @@ -134,14 +134,14 @@ public void addView(View child, int index, ViewGroup.LayoutParams params) {
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// 测量子view
measureChildren(widthMeasureSpec,heightMeasureSpec);
measureChildren(widthMeasureSpec, heightMeasureSpec);
}

@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
mScrollRange = 0;
int childTop = t + getPaddingTop();
int left = l + getPaddingLeft();
int childTop = getPaddingTop();
int left = getPaddingLeft();

List<View> children = getNonGoneChildren();
int count = children.size();
Expand Down

0 comments on commit ca1b3b2

Please sign in to comment.