Autocompletetextview dropdown behind soft keyboard in dialog fragment

Theory says that android:windowSoftInputMode="adjustPan|adjustResize"should do this but for some reason it doesn't, so you have to do the same programmatically:

getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

Aand the magic happens!!!


[update] in my case.. cause i use bottomShetDialogFragment with autocomplete inside. drop down not show cause i not set dropdownanchor for autocomplete. just add android:dropDownAnchor="@id/layout_above_this_autocomplete" and work perfect

ad news style in your style.xml

<style name="AppBottomSheetDialogTheme" parent="Theme.Design.Light.BottomSheetDialog">
    <item name="bottomSheetStyle">@style/AppModalStyle</item>
    <item name="android:windowIsFloating">false</item>
    <item name="android:windowSoftInputMode">adjustResize</item>
</style>
<style name="AppModalStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="behavior_peekHeight">400dp</item>

</style>

in your bottomshetdialog framgnet. oncreate -> setStyle(DialogFragment.STYLE_NORMAL, R.style.AppBottomSheetDialogTheme)

override fun getTheme(): Int {
    return R.style.AppBottomSheetDialogTheme
}

result