Google Play Store, such as an interface using a recycler view

My task is to create the same interface as in the Google Play Store. The category name will be indicated, followed by 3 or 4 cards (horizontally), and then the More button. Then again the next category.

I have already implemented this using nesting a horizontal list in a vertical listview.

I know I can achieve this using the Recycler view with the LinearLayoutManager with a horizontal orientation. Using this, I will only have one line.

My question is how to add a second, third line to this? Should I use the Recycler nested view again? Are there any better options?

+7
android android-recyclerview
source share
3 answers

Do not use nested lists (you cannot scroll horizontally in the play store).

Consider the following options:

  • You can use the simple LinearLayoutManager and create different types of views. For three cards horizontally, use a GridLayout or LinearLayout with the same weights. The problem here is that you need to consider the indices of your base data list used in the adapter
  • Write your own LayoutManager for RecyclerView
  • Use TwoWay View , which is based on RecyclerView and offers the Spannable Grid layout manager, which seems to be what you are looking for.
+4
source share

If you look at the layout of the Google Play app, they don’t use listview / recyclerview for horizontal maps. I am sure it is just linearlayout (horizontal) in the vertical list / recyclerview.

If you insist on using a horizontal recyclerview for each row, then using a nested recyclerview would be your best option. You can tell RecycledViewPool to have all nested recyclerviews use the same pool instead of creating their own.

+2
source share

You may like to do this as one vertical RecyclerView (Main recycler), and for each section you can inflate a horizontal RecyclerView (recycler section), as in this blog answer:

Also consider using:

  • Bitmaps cache level for continuous access through other storage screens.
  • Lazy loading method for category / section images
  • Place holder before showing new items
0
source share

All Articles