FirebaseUI-Android icon indicating copy to clipboard operation
FirebaseUI-Android copied to clipboard

RecyclerView with Indexed Data

Open joemerritt opened this issue 7 years ago • 3 comments

Hi All,

I'm currently using Firebase UI with indexed data in a recycler view. I want to show the latest post from the indexed data first, there for i'm using .setStackFromEnd(true) however when loading the recyclerview, it loads the first set of data from the first key in "setStackFromEnd" order, however I need to swipe the recycler to get the rest of keys data.

If I use .smoothScrollToPosition(mRecycler.getAdapter().getItemCount() -1) in a button this will take me to the last position. However it loads ALL of the data inbetween and the can be very hefty on data.

Has anyone got a solution for the recyclerview to load the very last post of all the indexed data? Or is this a glitch in the system?

Thanks for your help

joemerritt avatar Nov 22 '17 11:11 joemerritt

Classic SO question: https://stackoverflow.com/a/27727398/4548500

SUPERCILEX avatar Nov 22 '17 15:11 SUPERCILEX

@joemerritt see the answer that was pointed out by @SUPERCILEX.

samtstern avatar Nov 27 '17 14:11 samtstern

Hi Guys, I'm still struggling with this. I've read the solution posted but it's not answering my issue. When using:

    mLayoutManager.setReverseLayout(true);
    mLayoutManager.setStackFromEnd(true);

My recycler loads 3-4 post (incorrect order) however does not load at the very last post. Users have to swipe to get to the very last post.

I'm not sure if this is an issue of using indexed data?

Thanks for your time and help

joemerritt avatar Dec 03 '17 01:12 joemerritt