Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

implementing onBackPressed for SlidingLayer #109

Open
pishguy opened this issue Apr 12, 2018 · 2 comments
Open

implementing onBackPressed for SlidingLayer #109

pishguy opened this issue Apr 12, 2018 · 2 comments

Comments

@pishguy
Copy link

pishguy commented Apr 12, 2018

i have a big problem with this library such as implementing onBackPressed for opened SlidingLayers on fragments or activities, how can i do that without implementing android listeners to detect that?

@Mr-Krabbe
Copy link

What I did to prevent back navigation when SlidingLayer is open is to simple override onBackPressed() and check if the layer is open. Was this your question?

    @Override
    public void onBackPressed() {
        if (slidingLayer.isOpened()) {
            slidingLayer.closeLayer(true);
        } else {
            super.onBackPressed();
        }
    }

@JlUgia
Copy link
Contributor

JlUgia commented Jan 3, 2019

Right, that's left at your complete control and will. Where you able to find a similar solution to apply to your navigation patterns @MahdiPishguy ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants