Android only setStackFromEnd only if RecycleView/List is larger than screen

Viewed 3308

I have a RecyclerView that I want to start showing the bottom items, so I'm using: myLayoutManager.setStackFromEnd(true).

It works just as I want when there are enough items to fill the screen, but if there are only a few items in the RecyclerView, it pushes them down and leaves empty space at the top of the screen

Is there any way prevent this, or to only setStackFromEnd if the RecyclerView is larger than the screen height?

Here's an example of what I get and what I'm trying to get:

What I Get What I Want

1 Answers
Related