How to detect if slide menu is opened or closed using SlideHolder in android

987 views Asked by At

I am using the slideHolder class for using slide menu in my project. I want to get notified in my fragment, when slide is opened or closed. I have tried the following line of code also:

SlideHolder.setOnSlideListener(SlideHolder.OnSlideListener);

But its giving error. How to detect the open and close event of the slide menu?

Any help will be appreciated. Thanks.

1

There are 1 answers

2
slecorne On BEST ANSWER

You can use a code similar to this. You need to implement your SlideHolderListener.

    sliderMenu.setOnSlideListener(new SlideHolder.OnSlideListener() {

            @Override
            public void onSlideCompleted(boolean opened) {
                if(opened)
                    // do whatever need once menu opened
                else
                    // do whatever need once menu closed
            }
            });