2

I am using Recyclerview with GridLayoutManager . data is shown like this :

1      2      3
4      5      6
.
.
.

But I want this :

3      2       1
6      5       4
.
.
.

How can I do that?

Viral Patel
  • 1,296
  • 1
  • 11
  • 24
faeze saghafi
  • 650
  • 10
  • 25
  • 5
    You don't need to do anything on the side of the `Recyclerview` to make that happen. Just sort your data before loading it in the `RecyclerView`. – devmike01 Jan 21 '19 at 10:44
  • 1
    the question is something else.she just wants a rtl row in grid. – yasin Jan 21 '19 at 13:24

1 Answers1

3

override the isLayoutRTL method of GridLayoutManager Object,like this:

GridLayoutManager gl= new GridLayoutManager(context , 4)
       {
           @Override
           protected boolean isLayoutRTL() {
               return true;
           }
       };
yasin
  • 126
  • 6