Skip to content

Commit

Permalink
适配循环viewpager
Browse files Browse the repository at this point in the history
  • Loading branch information
juyao committed Aug 1, 2018
1 parent 7f89dab commit bacf281
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse
rightRadius= (int) (2*(bigRadius-smallRadius)*rightRate+2*smallRadius-bigRadius);
}
Log.i("leftRadius","leftRadius="+ leftRadius);
int rightBounds=bigRadius+((itemSpace+bigRadius*2)*(itemNum-1));
if(rightX>rightBounds){
rightX=rightBounds;
}
if(leftX>rightBounds){
leftX=rightBounds;
}
if(leftX<bigRadius){
leftX=bigRadius;
}
if(rightX<bigRadius){
rightX=bigRadius;
}
invalidate();
}
@Override
Expand Down

0 comments on commit bacf281

Please sign in to comment.