Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Self-Destructing Message Android App Using Fragments for Tabs Modifying Tabs from the Template

Vince Varga
Vince Varga
15,282 Points

How to implement a Google Play-like app design with Navigation drawer (from the left) and swipeable tab fragments?

I would like to follow the Google Play design in my application since an application design similar to a famous application can help users getting around in the app.

I thought it should be pretty straight-forward, but unfortunately Android Studio doesn't offer such a built-in layout, nor I could find a detailed example. However I found dozens of questions about that, but the answers vary too much and it looks like that there is no consensus.

I would like to get a navigation drawer you get when you swipe from the left, and based on what you click in the navigation drawer menu, I would like to have a tabbed fragments (under the action bar) and I want my application to change tabs on swipe and click events on the tab section titles.

If you have any questions, please leave a comment.

Vince Varga
Vince Varga
15,282 Points

Hey, thanks for your help, unfortunately this is not what I am looking for.

3 Answers

Nicolas Hampton
Nicolas Hampton
44,626 Points

If you want to see the most straight forward non-deprecated code for this exercise, see the question and answer "This Is The Droid You Are Looking For" in the lesson's forum.

Vince Varga
Vince Varga
15,282 Points

Hi Nicolas, Thanks for your comment. That code is nice to have for the lesson, however my question was how to implement swipeable tabs AND nav drawer menu. I posted an open source project from which I could my code work. Cheers

Vince Varga
Vince Varga
15,282 Points

Bitbeaker is an open-source client for Bitbucket (similar to GitHub) and uses the design very similar to the one I wanted to achieve.

Vince Varga
Vince Varga
15,282 Points

You can also checkout this video about Android Design Support Library, Material Design made easy. Android Design Support Library (100 Days of Google Dev) by Google Developers

Dayan Rodriguez
Dayan Rodriguez
1,286 Points

Have you tried doing some research on ViewPager(For Swipeable Fragments) TabLayout(For The Tabs) and Drawer Layout (Side Drawer)? If you use these material components you will achieve what you want. Let me know if I am totally off-topic right here, or if you need an example, I can show you.