1

Hi I am working with android.I had integrated a slider library https://github.com/jfeinstein10/SlidingMenu into my app. Now I can swipe left to open the menu from behind the screen and swipe right to close the menu.Now I want to add a button at the left side of the screen to control the swipe activity.So that I can swipe screen along with the button and button will always appear in front of the screen even the menu is closed as in the image.Is it possible?? please help me, thanks in advance :)

here is the code I used to display slide menu

    SlidingMenu menu = new SlidingMenu(this);
    menu.setMode(SlidingMenu.LEFT);

    menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    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.setSecondaryMenu(R.layout.login);  

enter image description here

Maxwell
  • 552
  • 2
  • 5
  • 20
  • possible duplicate of [How to set a handle button in slider content in android?](http://stackoverflow.com/questions/23005067/how-to-set-a-handle-button-in-slider-content-in-android) – Blo Apr 15 '14 at 05:41
  • yup I posted the same question.Still I didn't get right answer – Maxwell Apr 15 '14 at 05:47
  • Right, but in this case, it's better to rewrite your question: what did you find, what did you tried, everything that can be useful to us to provide an answer to your question. Flood SO is not the best way to have an answer ;) – Blo Apr 15 '14 at 05:50
  • Maxwell, there may be a solution for you: [offer a bounty on your question](http://stackoverflow.com/help/bounty). This does not **guarantee** a response, however you will have more attention on your demand. To do so, you can answer, improve the edit of other post, to grow up your rep. This can be a solution to your need. - Regards – Blo Apr 15 '14 at 07:17
  • can you please set a bounty form= my question. I don't have enough reputation :( – Maxwell Apr 15 '14 at 07:18
  • Sorry Maxwell, but I don't really find this feature useful. This is a personal feeling, I think it's to intrusive on a screen. Like I said before, you have to keep in mind that a screen device is sometimes "small", so why do you want to reduce it again? And you can have enough rep, if you help the community, it will reward you. – Blo Apr 15 '14 at 07:21
  • And you can easily create a workaround: make a parent container as framelayout, add a fragment which contains a listview (your items), let this fragment overlaps a bit your content and then with a touch listener you may have a right approach. – Blo Apr 15 '14 at 07:34

1 Answers1

0

You can put that button in your fragment itself and control your swiping over that button click using the toggle() method of your activity extending SlidingFragmentActivity

NullPointerException
  • 3,978
  • 4
  • 34
  • 52