I try to use the FirebaseUI-Android lib to simply display a data set in a recycler-view.
Data are store in Firebase in a list, thanks to push() method.
When I get the data, I got the oldest data first, and my requirement is the youngest first. So I need a reverse order.
Is there a way to do that with FirebaseUI itself?
With Firebase Core, it seems the 2 only possible ways are (from Display posts in descending posted order) :
This should be done at adapter level, as Firebase pull the whole list of object.
For a RecyclerView, here is a solution.
mLayoutManager = new LinearLayoutManager(getActivity());
mLayoutManager.setReverseLayout(true); // THIS ALSO SETS setStackFromBottom to true
// mLayoutManager.setStackFromEnd(true);
mRecyclerView.setLayoutManager(mLayoutManager);