Skip to content

Commit 469ad44

Browse files
committed
Code improvement
Removed redundant variables
1 parent 49df655 commit 469ad44

File tree

1 file changed

+1
-3
lines changed
  • app/src/main/java/com/lb/lollipop_contacts_recyclerview_fast_scroller

1 file changed

+1
-3
lines changed

app/src/main/java/com/lb/lollipop_contacts_recyclerview_fast_scroller/FastScroller.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ public void onScrolled(final RecyclerView recyclerView, final int dx, final int
102102
{
103103
if (handle.isSelected())
104104
return;
105-
int verticalScrollOffset = recyclerView.computeVerticalScrollOffset();
106-
int verticalScrollRange = recyclerView.computeVerticalScrollRange();
107-
float proportion = (float) verticalScrollOffset / ((float) verticalScrollRange - height);
105+
float proportion = (float) recyclerView.computeVerticalScrollOffset() / ((float) recyclerView.computeVerticalScrollRange() - height);
108106
setBubbleAndHandlePosition(height * proportion);
109107
}
110108
};

0 commit comments

Comments
 (0)