Recyclerview does not roll fast

Asked

Viewed 141 times

0

I have a RecyclerView that only rolls with your finger glued to the screen, if I make that quick move, to scroll enough items, it only rolls while the finger is on the screen, and then stops. I’ve remade 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 others RecyclerView in the same app that are rolling normal.

  • Put the Adapter on.

  • hello, how so?

  • Edit the question and add the Ofadapter code.

2 answers

0


I solved my problem as follows, I was using Collapsing and mine RecyclerView, was inside a <include>.

put the RecyclerViewwithin 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

Putting the layout_height with a standard size as in the example: 500dp, it scrolls as I wanted, the smaller the layout_height the faster the roll.

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

0

I managed to ease this problem in this way:

recycler_view.setNestedScrollingEnabled(false);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.