0

I had used StaggeredGridLayout manage in recyclerview, and applied reverse layout as it was required but now it always starts from bottom while I want scroll position in top, I am providing my code below, any help will be much appreciated and as I m new in android, I don't know much about staggeredGridlayout, so any other advice along with above help to make it better will also be a great help.

Here is the code (Showing how I applied StaggeredGridLayout in recyclerview)

.XML

<android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/explore_page"
        android:layout_above="@+id/id_views">
    </android.support.v7.widget.RecyclerView>

MainActivity.java

 mgrid = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
            mgrid.setReverseLayout(true);
            mgrid.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
            mexplore_page = (RecyclerView) findViewById(R.id.explore_page);
            mexplore_page.setHasFixedSize(true);
        mexplore_page.setLayoutManager(mgrid);

So, what to add in this? which will help recyclerview onStart() to from top position rather than bottom

AskNilesh
  • 67,701
  • 16
  • 123
  • 163

0 Answers0