Skip to content

Commit e0948ff

Browse files
committed
see 02/05 log
1 parent a50111f commit e0948ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static void toggleSoftInput() {
105105
* @return {@code true}: 可见<br>{@code false}: 不可见
106106
*/
107107
public static boolean isSoftInputVisible(final Activity activity) {
108-
return getContentViewInvisibleHeight(activity) >= 200;
108+
return isSoftInputVisible(activity, 200);
109109
}
110110

111111
/**
@@ -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.getRootView().getHeight() - (r.top - r.bottom);
127+
return contentView.getRootView().getHeight() - r.height();
128128
}
129129

130130
/**

0 commit comments

Comments
 (0)