mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Added fail-safe
This commit is contained in:
parent
388af6e7c5
commit
5a8763a7dc
1 changed files with 15 additions and 10 deletions
|
@ -1527,17 +1527,22 @@ public class Helper {
|
|||
}
|
||||
|
||||
static boolean isKeyboardVisible(final View view) {
|
||||
if (view == null)
|
||||
try {
|
||||
if (view == null)
|
||||
return false;
|
||||
View root = view.getRootView();
|
||||
if (root == null)
|
||||
return false;
|
||||
WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(root);
|
||||
if (insets == null)
|
||||
return false;
|
||||
boolean visible = insets.isVisible(WindowInsetsCompat.Type.ime());
|
||||
Log.i("isKeyboardVisible=" + visible);
|
||||
return visible;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
return false;
|
||||
View root = view.getRootView();
|
||||
if (root == null)
|
||||
return false;
|
||||
WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(root);
|
||||
if (insets == null)
|
||||
return false;
|
||||
boolean visible = insets.isVisible(WindowInsetsCompat.Type.ime());
|
||||
Log.i("isKeyboardVisible=" + visible);
|
||||
return visible;
|
||||
}
|
||||
}
|
||||
|
||||
static String getViewName(View view) {
|
||||
|
|
Loading…
Add table
Reference in a new issue