timusus / RecyclerView-FastScroll

A simple FastScroller for Android's RecyclerView
Other
1.39k stars 183 forks source link

Popup size changing for fex pixels when new selection name #63

Closed G00fY2 closed 7 years ago

G00fY2 commented 7 years ago

See the logcat below. While scrolling in the sample app within the range of 10 -99 the popup size (bgWidth) jumps between 328 - 332 px. This causes the popup to slightly flicker and lock restless.

08-21 23:05:02.738 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.754 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.771 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.787 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.803 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.821 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70) 08-21 23:05:02.837 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70) 08-21 23:05:02.852 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70) 08-21 23:05:02.869 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72) 08-21 23:05:02.885 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72) 08-21 23:05:02.902 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.918 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.934 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.951 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71) 08-21 23:05:02.967 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72) 08-21 23:05:02.985 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72) 08-21 23:05:03.000 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72) 08-21 23:05:03.018 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72) 08-21 23:05:03.034 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70)

I have some ideas how to address this. The easiest way would be to add some rounding, but is not 100% reliable. Other ways I try is to get the max width of the used typeface or to force monospace text drawing. Will add a PR as soon as I found a solid solution.