Skip to content

Commit

Permalink
Update ResideMenu.java
Browse files Browse the repository at this point in the history
Using Api level judge NavigationBar is unreliable! Devices like My HTC One!
http://stackoverflow.com/questions/16092431/check-for-navigation-bar
  • Loading branch information
吴景超 committed Oct 5, 2015
1 parent b77c3c4 commit a7cdf5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ResideMenu/src/com/special/ResideMenu/ResideMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ protected boolean fitSystemWindows(Rect insets) {

// This is added to fix soft navigationBar's overlapping to content above LOLLIPOP
int bottomPadding = viewActivity.getPaddingBottom() + insets.bottom;
if (Build.VERSION.SDK_INT >= 21) {
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
boolean hasHomeKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_HOME);
if (!hasBackKey || !hasHomeKey) {//there's a navigation bar
bottomPadding += getNavigationBarHeight();
}

Expand Down

0 comments on commit a7cdf5e

Please sign in to comment.