Created
August 20, 2015 18:21
-
-
Save helsont/3a7ba68707d7d01d45cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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