Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Guy Bridge
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Guy Bridge
Android Development Techdegree Graduate 24,991 Points

Combining LinearLayout and GridLayout recycler views.

Hi Guys,

I'm wanting to be able to combine a gridLayout and linearLayouts together in the same list like the Google News and Weather app;

The first item is a grid (I think) or it might be a pagerView) then the next items are recyclerViews using linear layout.

In other apps I've had success in creating a recyclerView "header" and then having another child recycler in the header layout then loading data into that. - Seems to work alright.

I was thinking I could put a boolean in the json model and say if I want to show the gridlayout or hide it depending on what Item I wanted to display. Hope that makes sense;

See link to the Google news and weather app so you can better understand what I'm trying to achieve;

https://play.google.com/store/apps/details?id=com.google.android.apps.genie.geniewidget&hl=en