4
votes

I'm using the com.jeremyfeinstein.slidingmenu.lib.SlidingMenu library to create sliding menus, and am using the android.support.v7.app.ActionBarActivity library for the action bar. In my activity, I am extending ActionBarActivity.

I am able to get a sliding menu by clicking on the home button on the top left. How do I get the entire actionbar to also slide when the home button is clicked?

2
developer.android.com/design/patterns/navigation-drawer.html Note that nav drawer examples show where both the drawer AND the action bar slide in coordinated fashion. Depend on your needs , the Nav drawer may provide what you want .Robert Rowntree

2 Answers

1
votes

Please refer to the SlidingMenu's readme: https://github.com/jfeinstein10/SlidingMenu

Here goes the key part: You can wrap your Activities in a SlidingMenu by constructing it programmatically (new SlidingMenu(Context context)) and then calling SlidingMenu.attachToActivity(Activity activity, SlidingMenu.SLIDING_WINDOW | SlidingMenu.SLIDING_CONTENT). SLIDING_WINDOW will include the Title/ActionBar in the content section of the SlidingMenu, while SLIDING_CONTENT does not. You can check it out in the example app AttachExample Activity.

0
votes

Set your theme as follow, and your Activity extends the SlidingFragmentActivity

<resources>
<style name="AppTheme"  parent="ThemeOverlay.AppCompat.Dark.ActionBar">
</style>