Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danielfaust opened this issue Aug 28, 2017 · 3 comments
Open

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

danielfaust opened this issue Aug 28, 2017 · 3 comments

Comments

@danielfaust
Copy link

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.

@Faltenreich
Copy link

Faltenreich commented Sep 27, 2017

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.

@micHar
Copy link
Contributor

micHar commented Oct 12, 2017

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.

@aliaksandrprus
Copy link

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);
....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants