Skip to content

Instantly share code, notes, and snippets.

@helsont
Created August 20, 2015 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helsont/3a7ba68707d7d01d45cf to your computer and use it in GitHub Desktop.
Save helsont/3a7ba68707d7d01d45cf to your computer and use it in GitHub Desktop.
commentEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
// 200 is an arbitrary amount of time to let the keyboard show, and then
// we smooth scroll
recyclerView.postDelayed(new Runnable() {
@Override
public void run() {
recyclerView.smoothScrollToPosition(adapter.getItemCount() - 1);
}
}, 200);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment