SpecialCyCi / AndroidResideMenu

The idea of ResideMenu is from Dribbble 1 and 2. It has come true and run in iOS devices. iOS ResideMenu This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu. And thanks to the authors for the above idea and contribution.
MIT License
2.85k stars 1.1k forks source link

Not Compatible with hide and showing Navigation bar #140

Open assilMekki opened 6 years ago

assilMekki commented 6 years ago

I am running this library ( Great work) in my App and when I test run on a Samsung s8 Plus( that has the option to hide and show the navigation bar ) the Activity that I attache ResideMenu to stopped resizing when the NavigationBar is shown or hidden.

I found the bit of code where you make space for the softKeys and I saw the issues where the activity was showing behind the NavigationBar So I understand it's purpose.

Si if it's can you help me to get the Activity to resize when the NavigationBar is shown/hidden ?

Thank you.

Nik2505 commented 5 years ago

I am facing same issue. Have you find any solution?

assilMekki commented 5 years ago

Unfortunately no.

Nik2505 commented 5 years ago

Is there any even which provide us Navigation bar is hidden or not? I have tried with many solutions but it was not work. Due to Android P Navigation Gesture I am facing same problem.

DevRahul123 commented 5 years ago

Hello,

I resolved this issue by writing this code in my activity:

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
getWindow().getDecorView().setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
resideMenu.post(new Runnable() {
@Override
public void run() {
resideMenu.setPadding(resideMenu.viewActivity.getPaddingLeft() + insets.getSystemWindowInsetLeft(),
resideMenu.viewActivity.getPaddingTop() + insets.getSystemWindowInsetTop(),
resideMenu.viewActivity.getPaddingRight() + insets.getSystemWindowInsetRight(),
insets.getSystemWindowInsetBottom());
}
});
return insets.consumeSystemWindowInsets();
}
});
}

Note: I've imported this project as a module in my app and made 'TouchDisableView' as 'public class'