0

Had a problem from recycler view and EditText. The focus is lost because of the view refresh. Have fixed this with below config from manifest.

android:windowSoftInputMode="stateHidden|adjustResize|adjustPan"

However, this breaks my existing functionality. The EditText hidden behind the keyboard. To solve this the config needs to be changed.

android:windowSoftInputMode="adjustResize"

How can I solve both problems with a single config.

halfer
  • 19,824
  • 17
  • 99
  • 186
Sampath Kumar
  • 4,433
  • 2
  • 27
  • 42

1 Answers1

0

After a long hurdle, the workaround was found but not sure whether it is a good one.

From the recycler Adapter:

  • Added focus change listener to the edit-text from onBindViewHolder
  • When the focus gained, the index been captured to variable from adapter
  • Check the last focus index (Step 2) in onBindViewHolder if it is equal to current index then make request focus to current input.

Tested from various builds and it worked fine.

Sampath Kumar
  • 4,433
  • 2
  • 27
  • 42