Search code examples
androidandroid-layoutactionbarsherlock

Beginner problems with SlidingMenu #jfeinstein10_sliding_menu #ActionBarSherlock


I tried my hands on the slidingMenu from github by [jfeinstein10]: https://github.com/jfeinstein10/SlidingMenu.

I compiled and ran it on my android. It ran fine. I could slide through views. The screenshot is here.

http://i.imm.io/xUZL.png
(source: i.imm.io)

The problem is I couldn't see the view that is demoed in the video (i.e. the Spotify look and the toggle back button) [video link here]: http://www.youtube.com/watch?v=8vNaANLHw-c&feature=youtu.be http://i.imm.io/xUSu.png http://i.imm.io/xUSu.png

Am I missing something? Is there a tutorial that could help me proceed with the example?

Thanks, Dexter


Solution

  • I am not exactly sure what is it that you are trying to do, can you post some of your code?

    All you need to do to make the SwipingMenu show from either left or right is the following:

    Use Set Mode to declare whether you want the view to show when swiping from the left or right.

    Use SetTouchModeAbove to declare whether you want the sliding menu to respond to swipes on any place on the screen (SlidingMenu.TOUCHMODE_FULLSCREEN) or from just the edge of the screens (SlidingMenu.TOUCHMODE_MARGIN).

    private void initSlidingMenu() {
        menu = new SlidingMenu(this);
        menu.setMode(SlidingMenu.LEFT);
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
        menu.setShadowWidthRes(R.dimen.shadow_width);
        menu.setShadowDrawable(R.drawable.shadow);
        menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
        menu.setFadeDegree(0.35f);
        menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
        menu.setMenu(R.layout.sliding_queue);        
    }