Creating a Slide-In Menu in Android - Part 1: Showing the Menu

Jay Lamont · 178K views · 2013 · 17:12

Open on YouTube

Software (other)Testing, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed to build a sliding menu, and then ask follow-up questions about extending or debugging that approach.

Recommended by 3 people across 2 different months, 2013 to 2016.

What it is

A 17-minute Android tutorial by Jay Lamont that builds a fly-out (slide-in) navigation menu from scratch using a custom ViewGroup, based on Cyril Mottier's Prixing app design. Part 1 covers showing the menu, with example code on GitHub.

What people said

Recommends AndyRoid · 2014-05 · Stack Overflow · on “Navigation Drawer with Page Sliding example”

I would check out the FlyOutContainer class, if you've ever used the StackOverFlow app it's sort of like that sliding navigation tab. [LINK] Here's a really good tutorial from YouTube regarding the FlyOutContainer class [this video] Here you are relying on one dependency.

Recommends smatthewenglish · 2015-06 · Stack Overflow · on “assign button press to evoke a new page from sliding menu”

I've implemented a sliding menu android framework by following a tutorial video [this video] , the menu works well but I can't figure out how to make the buttons generate new "fresh", i.e. distinct, pages wherein I can place subsequent components/"activities". Right now all the buttons do is "toggle" back and forth between having the menu exposed, and hiding the menu, making visible the complete "landing page". This is how it looks: In my layout file, I think this is responsible for assigning functionality to the buttons: <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="toggleMenu" android:text="Button 1" /> <Button android:layout_width="match_pare

Recommends Bisclavret · 2015-06 · Stack Overflow · on “ClassCastException: LinearLayout cannot be cast to (java class)”

@Original Android: Thanks again for the replies. If you need further explanation, I am following this example almost exactly: [this video] I just can't work out what he means when he says he set the root to the SlideOutMenu in his xml file.

Cites Marcel Marino · 2013-12 · Stack Overflow · on “Android - Dynamic Slide Menu”

Using a tutorial [this video] (source code here [LINK] ), I was able to create a slide menu in android using a single xml layout for both the menu and the main content. The problem is I need to make the menu and the content dynamic. I can create a dynamic view, but I don't know how to switch to a second dynamic view using a button\swipe or to create both views and have one slide out upon pressing of a button. The content must be dynamic, the menu will be based upon files from the internet. I've looked up numerous tutorials, but I haven't quite found how to meld all of them together into single coherent project. So that would mean either making the View menu and View context dynamic from the sourc

Cites Bisclavret · 2015-06 · Stack Overflow · on “ClassCastException: LinearLayout cannot be cast to (java class)”

This does not work either. What I end up with is my activity covered by the SlideOutMenu, so you cannot see the activity at all, and then it crashes when you try to slide it back. I followed this guide exactly: [this video] and in this clip he is saying you have to set SlideOutMenu to be the root of the activity.... but it isn't working. It HAS to be done this way for it to work, you cannot skip around it by ignoring this part of the code.

Cites JustCurious · 2016-07 · Stack Overflow · on “How to dim the background of a custom layout?”

I have created a custom layout which extends viewgroup in order to implement a sliding menu similar to the one in this video at 1:18: [this video] However, what I don't know how to do is dim the background content when the menu is sliding in.