I use RecyclerView . It looks like this:

enter image description here

After clicking on EditText keyboard hits RecyclerView :

enter image description here

How to make it so that when you open the keyboard RecyclerView scrolled by its size, so that it was like this?

enter image description here

    1 answer 1

    as it turned out, I was looking bad. found the solution in this post.

    In my case, the code looks like this:

     rvPrivateMessaging.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if (bottom < oldBottom){ rvPrivateMessaging.post(new Runnable() { @Override public void run() { rvPrivateMessaging.scrollToPosition( rvPrivateMessaging.getAdapter().getItemCount() - 1); } }); } } });