Skip to content

Commit f394746

Browse files
authored
Merge pull request Blankj#406 from ethanhua/master
兼容部分低版本手机软键盘显示隐藏事件
2 parents 5278250 + 260683e commit f394746

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utilcode/src/main/java/com/blankj/utilcode/util/KeyboardUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private static int getContentViewInvisibleHeight(final Activity activity) {
124124
final View contentView = activity.findViewById(android.R.id.content);
125125
Rect r = new Rect();
126126
contentView.getWindowVisibleDisplayFrame(r);
127-
return contentView.getBottom() - r.bottom;
127+
return contentView.getRootView().getHeight() - (r.top - r.bottom);
128128
}
129129

130130
/**

0 commit comments

Comments
 (0)