Does anyone know the replacement for the adjust resize flag in Android 11? My layout has the EditText and it's getting hidden after the keyboard popup as I can't use the below the flag
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Thanks
Can you please try the following? I think you should add padding at the bottom of your view. The size of the padding should be the height of the keyboard.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
getActivity().getWindow().setDecorFitsSystemWindows(false);
getActivity().getWindow().getDecorView().setOnApplyWindowInsetsListener((v, insets) -> {
int height = insets.getInsets(WindowInsets.Type.ime()).bottom;
v.setPadding(0, 0, 0, height);
return insets;
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With