I have bottomsheet fragment what shows to user answears to his comment. At the bottom of bottom sheet we have edit text, where user can add new comment. So, when soft keyboa
I ended up getting a satisfactory result with the following code: use this in setupDialog(dialog: Dialog, style: Int) method in BottomSheetFragment
dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
dialog.setOnShowListener {
val bottomSheetDialog = dialog as BottomSheetDialog
val bottomSheet = bottomSheetDialog.findViewById(android.support.design.R.id.design_bottom_sheet) as FrameLayout?
BottomSheetBehavior.from(bottomSheet!!).state = BottomSheetBehavior.STATE_EXPANDED
}