microsoftarchive / android-sliding-layer-lib

Highly customizable SlidingLayer as you have seen in Wunderlist
http://wunderlist.com
Apache License 2.0
932 stars 279 forks source link

implementing onBackPressed for SlidingLayer #109

Open pishguy opened 6 years ago

pishguy commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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 ?