0

I have edittext inside recyclerview item and I want scroll recyclerview item above to keyboard when user click on edittext which is inside the recyclerview row. I saw same in Instagram feed list but I am not able achieve like Instagram. Check Instagram screenshot what I am going to achieve.

[enter image description here][1]KeyboardUtils.registerSoftInputChangedListener(getActivity(), new KeyboardUtils.OnSoftInputChangedListener() {
        @Override
        public void onSoftInputChanged(int height) {
         enter image description here
            recyclerViewPostList.smoothScrollBy(0, height);
        }
    });
  • yes I am trying to scroll by x and y accordingly keyboard height but did not get the well output. **KeyboardUtils.registerSoftInputChangedListener(getActivity(), new KeyboardUtils.OnSoftInputChangedListener() { @Override public void onSoftInputChanged(int height) { recyclerViewPostList.smoothScrollBy(0, height); } });** – Pandurang Bangar Sep 25 '19 at 04:51
  • 2
    Possible duplicate of [Move layouts up when soft keyboard is shown?](https://stackoverflow.com/questions/1964789/move-layouts-up-when-soft-keyboard-is-shown) – Zain Sep 25 '19 at 05:13

1 Answers1

0

add this line into your manifiest as below into your activity tag.

 android:windowSoftInputMode="adjustResize"

or you can also add it from your activity by puttion below code oncreate of your activity

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

and for Fragment

getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
YuvrajsinhJadeja
  • 1,383
  • 7
  • 23