Bialy
Bialy

Reputation: 975

Prevent Recyclerview from resizing when keyboard is visible

Most questions are asking about how to make the recyclerview resize when the soft keyboard is visible, although I want the opposite. The recyclerview already resizes when KB is visible, I tried removing android:windowSoftInputMode="stateVisible|adjustResize"but the same happens, the recyclerview always resizes. How can I achieve what I want (programmatically is preferred)

Upvotes: 1

Views: 824

Answers (1)

Bikeboy
Bikeboy

Reputation: 553

You could try stating an explicit size for the window your RecyclerView is embedded in, for example if it's in a AlertDialog, following AlertDialog.show() you add:

alertDialog.window!!.setLayout(width: 1000, height: 1300)

Upvotes: 1

Related Questions