2

I am trying to create my own sliding panel menu from code I have seen all over the internet. I want the following concept provided here.

I've tried looking at different libraries who implement a sliding panel menu. However I don't see the way they add the panel to the screen, wether it is an overlay or a panel that shifts the entire screen.

I think I know how to make this type of menu, I just don't know how to add something like this to the Activity.

Anujith
  • 9,370
  • 6
  • 33
  • 48
Marvin Brouwer
  • 306
  • 3
  • 13
  • 1
    I can't spot the question. Where should the question mark be? – Ovidiu Latcu Apr 25 '13 at 14:08
  • I just tried explaining the problem but if you need a question: "How do you add a panel/activity to the left side of the screen that is able to shift the current activity, as shown on the image I linked to?" – Marvin Brouwer Apr 25 '13 at 14:29
  • 1
    won't this do the trick for you? https://github.com/jfeinstein10/SlidingMenu – Ovidiu Latcu Apr 25 '13 at 15:07
  • Take a look at https://github.com/Ali-Rezaei/SlidingDrawer which makes it possible to slide from any side by few lines of code. – Ali Jun 13 '15 at 19:39

1 Answers1

0

I implemented this one long back without any libraries.

This can be done in the following way

  1. Make a layout file having slider attached to header of the activity

Place these two layouts relatively the header should be to the right of panel Initially panels is not visible.... so when you click on a button on the header it gets shifted and panel comes in...

So logic is the whole header moves (its margin left will increase to 50%) and panel.setvisibility(visible);

By 50% i mean shift it to the screen width/2 So thats it...only change of margin can help you get this

cafebabe1991
  • 4,928
  • 2
  • 34
  • 42