RecyclerView does not roll fast

0

I have a RecyclerView that just rolls with the finger glued to the screen, if I make that fast move, to roll enough items, it just roll while the finger is on the screen, and then to. I've refined it all, and the problem continues.

XML:

 <android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/recyclerViewOf"
    android:scrollbars="horizontal"
    android:clipToPadding="true"
    android:clipChildren="true" />

Java:

RecyclerView.LayoutManager lnm = new GridLayoutManager(getBaseContext(),2);
recyclerView.setLayoutManager(lnm);
OfAdapter adapter = new OfAdapter(getBaseContext(),mList);
adapter.salvaContext(MainActivity.this);
recyclerView.setAdapter(adapter);

I have other RecyclerView in the same app that are rolling normal.

    
asked by anonymous 06.02.2017 / 20:44

2 answers

0

I solved my problem as follows, I was using collapsing and my RecyclerView was within <include> .

I put RecyclerView inside a Frame :

<FrameLayout
    android:id="@+id/main.framelayout.title"
    android:layout_width="match_parent"
    android:layout_height="500dp"
    android:layout_gravity="bottom|center_horizontal"
    android:orientation="vertical">...//resto do codigo

By putting layout_height with a default size as in the example: 500dp, it does the scrolling as I wanted, the smaller the layout_height the faster the scrolling gets.

If I put wrap or match scrolling works, but continue the problem as it was initially, I can not explain why, but so my problem is solved.

    
07.02.2017 / 16:35
0

I was able to soften this problem this way:

recycler_view.setNestedScrollingEnabled(false);
    
08.02.2017 / 01:29