Sliding menu has become a hit and we see almost all apps adopting this style. I will show you how to add it to your app.
I will use https://github.com/jfeinstein10/SlidingMenu library. Its very simple and straightforward to use.
Step 1) Download it and add it to your project as a library - Download it and import to eclipse. Right click your project . Properties ->Android -> Bottom there will be a button to add library. click on that and add it.
Step 2) Create a layout for sliding menu - Create an XML file in layout folder. Layout can have a list view or fragment or anything that you want.
Step 3) Extend Sliding Activity - Go to your main Activity and instead of extending normal Activity Class, extend SlidingActivity.
Step 4) Set layout and few Properties - In onCreate Method add the layout for sliding area.
setBehindContentView(R.layout.your_sliding_layout) -> This will add layout.
SlidingMenu menu = getSlidingMenu() -> Get SlidingMenu Instance.
menu.setMode(SlidingMenu.LEFT) -> Add menu to left side.
...
You can refer to various properties on Github.
One more point.
If you want to add sliding menu along with ActionBar then their site had given tutorial how to do it. If you want Action Bar to be static and not move along with sliding menu then you can use setSlidingActionBarEnabled(false). This will keep it static.
Thanks for reading and do comment if you have anything to say or add.
I will use https://github.com/jfeinstein10/SlidingMenu library. Its very simple and straightforward to use.
Step 1) Download it and add it to your project as a library - Download it and import to eclipse. Right click your project . Properties ->Android -> Bottom there will be a button to add library. click on that and add it.
Step 2) Create a layout for sliding menu - Create an XML file in layout folder. Layout can have a list view or fragment or anything that you want.
Step 3) Extend Sliding Activity - Go to your main Activity and instead of extending normal Activity Class, extend SlidingActivity.
Step 4) Set layout and few Properties - In onCreate Method add the layout for sliding area.
setBehindContentView(R.layout.your_sliding_layout) -> This will add layout.
SlidingMenu menu = getSlidingMenu() -> Get SlidingMenu Instance.
menu.setMode(SlidingMenu.LEFT) -> Add menu to left side.
...
You can refer to various properties on Github.
One more point.
If you want to add sliding menu along with ActionBar then their site had given tutorial how to do it. If you want Action Bar to be static and not move along with sliding menu then you can use setSlidingActionBarEnabled(false). This will keep it static.
Thanks for reading and do comment if you have anything to say or add.