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

Fix keyboard hiding bug #2652

Merged
merged 5 commits into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ internal class OptionSelectDialogFragment(
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
)
// Adjust the dialog after the keyboard is on so that OK-CANCEL buttons are visible.
// SOFT_INPUT_ADJUST_RESIZE is deprecated and the suggested alternative
// setDecorFitsSystemWindows is available api level 30 and above.
// Ideally SOFT_INPUT_ADJUST_RESIZE supposed to be used, but in some devices the
// keyboard immediately hide itself after being opened, that's why SOFT_INPUT_ADJUST_PAN
// is used instead. There's no issue with setDecorFitsSystemWindows and is only
// available for api level 30 and above.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
it.setDecorFitsSystemWindows(false)
} else {
it.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
it.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
FikriMilano marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
Loading