Skip to content

Commit

Permalink
Attempt at smooth scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
walmsley authored Feb 23, 2019
1 parent 0b88041 commit ed8026e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions loopview/src/main/java/com/weigan/loopview/LoopView.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ public void setCurrentPosition(int position) {
invalidate();
}
}

public void smoothScrollSegmentUpdate(int segmentIncrement) {
float dy = segmentIncrement * lineSpacingMultiplier * maxTextHeight;
totalScrollY = (int) (totalScrollY + dy);
invalidate();
}

@Override
protected void onDraw(Canvas canvas) {
Expand Down

0 comments on commit ed8026e

Please sign in to comment.