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
  • 560
  • 1
  • 8
  • 22

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,387
  • 9
  • 51
  • 82
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,261
  • 4
  • 27
  • 59