Android: Navigation Drawer, JSON Feed, RecylerView

419 views Asked by At

So I have set-up a navigation drawer and a main layout that downloads JSON data and displays it in a RecyclerView in a tab fragment.

Now what I intend to achieve is that, when I click on a hardcoded item in the navigation drawer it calls the API corresponding to it, should filter the main RecyclerView based on the JSON parameter passed.

(eg: If the Main Layout RecyclerView shows all the Items that you can buy, and the Navigation Drawer contains items like Laptops, Cellphones, TV, Clothing etc and while clicking on NavDrawer item, it filters the RecyclerView to show only the items in that particular category)

1

There are 1 answers

0
Seishin On

Why don't you have fragments for each navigation drawer item? These drawers will make the API calls and present the received information in the RecycleViews they hold?

It would be much easier and better than reuse a single view to present different information on different actions...