0

I'm using a tabLayout with a horizontal recyclerView

The problem is when I scroll the recyclerView, the tabLayout takes priority instead of RecyclerView.

This only happens when the tabLayout is in the last tab, the tabLayout has no more scrolling.

TabLayout have this attributes

<android.support.design.widget.TabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="1dp"
            android:elevation="6dp"
            app:tabMaxWidth="0dp"
            app:tabGravity="fill"
            app:tabMode="fixed"
            app:tabSelectedTextColor="#ffffff"
            app:tabIndicatorColor="#ffffff"
            app:tabTextAppearance="@style/CustomTextStyle"
            >

And I setted the recyclerView with the attribute setHasFixedSize

recycler.setHasFixedSize(true)

This gif shows the problem.

Problem with the recycler and tabs

Here works well, because the tabLayout is not in the last tab.

This works well

BlueSeph
  • 543
  • 1
  • 8
  • 25

1 Answers1

0

You didn't provide complete code so I can't say where are you committing the mistake. But hope below lines can help you

     LinearLayoutManager llm = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
        recyclerView.setLayoutManager(llm);
        recyclerView.setHasFixedSize(true);

After that, if you will swipe from right most side to left then tab will change in between of recyclerview also.