Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not detect whether device have soft navigation bar or not #29

Closed
FrankieLWChen opened this issue Mar 18, 2016 · 1 comment
Closed

Comments

@FrankieLWChen
Copy link

If no detect whether android device have soft navigation bar or not then the height of bottom bar will abnormal.
Modification:
BottomBar.java
navBarMagic() {
...
boolean hasMenuKey = ViewConfiguration.get(activity).hasPermanentMenuKey();
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
final int navBarHeight;

        if(!hasMenuKey && !hasBackKey) {
          if (navBarIdentifier > 0) {
            navBarHeight = res.getDimensionPixelSize(navBarIdentifier);
          } else {
            navBarHeight = MiscUtils.dpToPixel(activity, 48);
          }
        } else {
          navBarHeight = 0;
        }

...
}

@roughike
Copy link
Owner

What version are you using? Newest version is 1.0.8. The library has already been updated several times and I thought this was fixed.

However, if you have the latest version but the detection doesn't still work, you can call bottomBar.noNavBarGoodness() to disable the bigger height.

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

No branches or pull requests

2 participants