0

I want to add android:windowSoftInputMode="adjustPan" only to recycler view.

When I add it into the manifest file it adds it to everything which I don't want.

When I add the line of code in the recycler view it doesn't work.

2 Answers2

1

Simply use below code, don't need to define anything in AndroidManifest file.

 (recyclerView.getLayoutManager() as LinearLayoutManager).stackFromEnd = true
Umesh P
  • 228
  • 2
  • 7
  • 1
    You fixed this problem: https://stackoverflow.com/questions/71723623/on-screen-keyboard-covers-edit-text-in-android-studio –  Apr 22 '22 at 21:22
1

You can try this. Replace the viewItem with your view

In Java

viewItem.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)

In Kotlin

viewItem.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
Sambhav Khandelwal
  • 3,585
  • 2
  • 7
  • 38
Waqar Ahmed
  • 349
  • 4
  • 11