0

I need to implement a list that has some card which scroll horizontally (scroll one item at a time like facebook friend suggestion list). enter image description here

Umesh Saraswat
  • 500
  • 1
  • 8
  • 19

2 Answers2

0

Use RecyclerView & set layout manager to that like this

recyclerView.setLayoutManager(new LinearLayoutManager(this) {
     @Override
     public boolean canScrollVertically() {
           return false;
     }
});

recyclerView.setAdapter(adapter); I hope this will help you.

Srihari
  • 2,516
  • 9
  • 50
  • 80
0

for set horizontal RecyclerView use :

 LinearLayoutManager mLayoutManager = new LinearLayoutManager(Context, RecyclerView.HORIZONTAL, false);

 mRecyclerView.setLayoutManager(mLayoutManager);

and for showing horizontal scrollBar in RecyclerView , in xml layout :

 android:scrollbars="horizontal" 

and with this line you can set custom scrollBar:

 android:scrollbarThumbHorizontal="@drawable/recycler_scroll"
Saeid
  • 2,155
  • 4
  • 26
  • 57