recycler-fast-scroll icon indicating copy to clipboard operation
recycler-fast-scroll copied to clipboard

When targeting API 26 (Android O) logcat is full of warnings.

Open danielfaust opened this issue 8 years ago • 3 comments

W/View: requestLayout() improperly called by android.support.v7.widget.AppCompatTextView{9cb9cc0 I.ED..... ......I. 3,3-171,171} during layout: running second layout pass

These went away when I removed com.futuremind.recyclerfastscroll:fastscroll:0.2.5 and everything that made use of it in my code.

I'm getting a ton of these.

I have tabbed fragments which contain a RecyclerView which makes use of fastscroll. When the app starts, only two fragments are created. Whenever something needs to redraw the fragmets, that warning comes up (including each animation frame, so really a lot), one for each fragment. It really floods logcat. When I scroll a fragment to the left, so that a new one is created because a new tab is getting prepared by the system, then not only three different addresses (like the one in the sample 9cb9cc0) exist, but somehow a loop is created so that I get a constant stream of this warnings without even doing anything.

Also, when scrolling the adapter which is under the influence of fastscroll (scrolling it normally), it kind of looks as if everything is getting redrawn twice, it no longer looks smooth like when fastscroll is removed.

danielfaust avatar Aug 28 '17 11:08 danielfaust

Same for me but on Android Nougat. The performance gets really dragged down by this otherwise fantastic library and the logcat gets flooded by the warnings posted by danielfaust.

Faltenreich avatar Sep 27 '17 17:09 Faltenreich

Sorry guys, this lib is quite old and I don't have time to support it anymore. If you found this error and be kind enough to propose a PR, it would be more than welcome.

micHar avatar Oct 12 '17 09:10 micHar

you need:

https://github.com/FutureMind/recycler-fast-scroll/blob/master/fastscroll/src/main/java/com/futuremind/recyclerviewfastscroll/FastScroller.java#L158

@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    super.onLayout(changed, l, t, r, b);
  •    if (changed) {
          initHandleMovement();
          bubbleOffset = viewProvider.getBubbleOffset();
          ...
    
  •    }
    

also updateHandlePosition can be optimized: private float previousPos = 0; void updateHandlePosition(RecyclerView rv) { if (previousPos!=relativePos) { scroller.setScrollerPosition(relativePos); ....

aliaksandrprus avatar Mar 19 '19 10:03 aliaksandrprus